diffrax icon indicating copy to clipboard operation
diffrax copied to clipboard

added new kalman-filter example

Open simon-bachhuber opened this issue 2 years ago • 3 comments

I wrote a little additional example that showcases diffrax in a maybe not so obvious way. It also showcases equinox and the ability to freeze parameters. Let me know what you think (and what needs to be changed). Greetings

simon-bachhuber avatar Sep 14 '22 13:09 simon-bachhuber

This is quite nice.

A few high-level comments to begin with. Can you:

  • tweak the introduction to follow the same style as the current examples? In particular a bit of discussion, some references etc? Atm terms like LTISystem show up without explanation.
  • add this to the list of examples in mkdocs.yml?
  • run the pre-commit hooks to autoformat this?
  • Import jax.random as jr? (This is what I've settled on going forward.)
  • Follow the Equinox style for docstrings?
  • To tidy things up a bit: run the notebook afresh so that the cells increment 1-2-3-..., and delete the empty last cell?

patrick-kidger avatar Sep 15 '22 03:09 patrick-kidger

Before i actually address these things.

-- tweak the introduction to follow the same style as the current examples? In particular a bit of discussion, some references etc? Atm terms like LTISystem show up without explanation.

Will try to do that. I just wanted to feel you out before i invest any more time if you consider it a good enough example.

-- add this to the list of examples in mkdocs.yml? Will do that.

-- run the pre-commit hooks to autoformat this? I am not sure what that means ^^

-- Import jax.random as jr? (This is what I've settled on going forward.) Sure.

-- Follow the Equinox style for docstrings? Will try to do that.

-- To tidy things up a bit: run the notebook afresh so that the cells increment 1-2-3-..., and delete the empty last cell? Hehe yes definitely needs a bit more detail love.

simon-bachhuber avatar Sep 15 '22 12:09 simon-bachhuber

Yep, checking if there was interest before polishing this definitely makes a lot of sense.

Regarding the pre-commit hooks: see CONTRIBUTING.md. These are a set of scripts that run when you commit (and which the tests here will also check) that autoformat your code, check it for common errors, etc. Super useful for keeping things automatically tidy.

patrick-kidger avatar Sep 15 '22 14:09 patrick-kidger

Sorry this took so long.

  • pre-commit hooks pass (i.e. notebook is autoformatted)
  • added some introductory words on Kalman-Filter and LTI systems
  • add this to the list of examples in mkdocs.yml? done

simon-bachhuber avatar Oct 23 '22 11:10 simon-bachhuber

Also, i could not run neither pytest nor mkdocs as they both throw some error.

For pytest this is weird because i did not change any source files.

For mdocs i would have ran it to see the notebook after nbconvert. However, it gives following error ERROR - Error reading page 'examples/steady_state.ipynb': Additional properties are not allowed ('id' was unexpected)

simon-bachhuber avatar Oct 23 '22 11:10 simon-bachhuber

For pytest -- I think this is due to an upstream change in JAX. If you rebase/merge the current latest version of Diffrax, do you still get an error? (And if so what error?)

For mkdocs: again I think this is due to an upstream change. Try installing the specifically pinned versions in docs/requirements.txt.

patrick-kidger avatar Oct 24 '22 01:10 patrick-kidger

pytest Works now. Took about ~30 Minutes.

mkdocs Works with pinned versions of nbformat / nbconvert.

Also fixed some typography in the notebook.

simon-bachhuber avatar Oct 24 '22 08:10 simon-bachhuber

And merged! Thank you for contributing.

patrick-kidger avatar Oct 28 '22 04:10 patrick-kidger