8000 [DOC] Migrating Examples to Notebooks: plot_em.ipynb EM estimation of model parameters with a Kalman Filter by PythonHacker24 · Pull Request #164 · pykalman/pykalman · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[DOC] Migrating Examples to Notebooks: plot_em.ipynb EM estimation of model parameters with a Kalman Filter #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

PythonHacker24
Copy link

Examples to Notebook Migration

As mentioned in #129 and following a brief discussion with @fkiraly on Discord, I am initiating the process of migrating examples in the documentation from Python files to a notebook.

If I understand this one file, I can work on migrating all the examples into notebook examples and adding them into the docs correctly.

I would greatly appreciate your input on this, and I look forward to receiving it as soon as possible.

@PythonHacker24
Copy link
Author

I have added the matplotlib in docs group on pyproject.toml. Let me know if it works.

@PythonHacker24
Copy link
Author

@phoeenniixx can you please review this?

Copy link
Collaborator
@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I think this is good!

There are a number of points that could be improved, but these issues are already there with the original example and are not in the scope of a simple migration, I would do this in a second step.

Some things that should be fixed:

  • TeX formulae translated are not exactly correctly transferred, e.g., "timesteps" is displayed at a different index level
  • I would also not use top level headers for every cell - can you turn these into simple markdown cells for now?

@PythonHacker24
Copy link
Author

Great! I think this is good!

There are a number of points that could be improved, but these issues are already there with the original example and are not in the scope of a simple migration, I would do this in a second step.

Some things that should be fixed:

  • TeX formulae translated are not exactly correctly transferred, e.g., "timesteps" is displayed at a different index level
  • I would also not use top level headers for every cell - can you turn these into simple markdown cells for now?

Hey @fkiraly, as per these 2 points, I have attempted to fix the issues. I have removed the top level headers and replaced with normal sized text. Also, Latex equations in the markdown renders well.

@PythonHacker24 PythonHacker24 requested a review from fkiraly July 4, 2025 03:08
Copy link
Collaborator
@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

< 8000 /form>

This is great, thanks!

I think it is a faithful translation, so it is good as migrating gthe example.

Next, may I suggest:

  • proceed with further notebooks
  • there are some differences in expected style in how one would expect notebooks in jupyter, from a commented python file. I will comment below.

Suggestions for improvements to this notebook (separate PR):

  • the first paragraph describes the figure which appears much further down. I suggest you move the description of the figure above the figure.
  • clarity can be improved for statements like "estimtate the hidden state using observations" - try to link the variable names to the statements in English. You can do this by modifying the statement, or by adding another sentence, in direct reference to th epython objects that are manipulated or created in the following cell (this comment applies to all cells)

@fkiraly fkiraly changed the title Migrating Examples to Notebooks: Added plot_em.ipynb (notebook for EM algorithm to estimate model parameters with a Kalman Filter [DOC] Migrating Examples to Notebooks: plot_em.ipynb EM estimation of model parameters with a Kalman Filter Jul 9, 2025
@fkiraly fkiraly added the documentation Documentation & tutorials label Jul 9, 2025
@fkiraly
Copy link
Collaborator
fkiraly commented Jul 9, 2025

The tests do not seem to run - do you know why, @PythonHacker24?

@PythonHacker24
Copy link
Author

@fkiraly I have added another test to verify all the notebooks that will be uploaded, but it should not stop any tests from happening.

On my repository, it started running (on the old PR), and I cross-confirmed that the tests are running and successful for the notebooks.

@PythonHacker24
Copy link
Author

@fkiraly Any updates on this? I need to start working on other notebook migrations and move forward to work on implementing EnFK after that (that's were real fun is gonna start! can't wait to work on it ;) )

@@ -100,3 +100,32 @@ jobs:
- name: Run Unit Tests
run: pytest pykalman/tests/
shell: bash

test-notebooks:
Copy link
Collaborator
@phoeenniixx phoeenniixx Jul 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but the issue could be the indentation?
are test-notebooks and build at the same level? (I think they should be or am I missing something here?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, fixed the indentations, good catch 🙌

Comment on lines 36 to 39
"sphinx.ext.todo",
"sphinx.ext.imgmath",
"numpydoc",
"nbsphinx",
"sphinx.ext.mathjax",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a minor non-blocking comment - I think these should be in alphabetic order?
I mean sphinx.ext.mathjax should be after sphinx.ext.autosummary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation & tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0