pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
259 stars 212 forks source link

update data_container example to pymc 5.6 #559

Closed jessegrabowski closed 11 months ago

jessegrabowski commented 1 year ago

Update how_to/data_container to PyMC 5.6

Related to #333

The data container notebook is out of date. It uses PyMC3, and uses several APIs that are no longer needed/suggested/supported. Most prominent is using pm.Data instead of specifying pm.MutableData, but other small updates include:

I also added a small explanation about the difference between pm.ConstantData and how to set mutable coords using model.add_coord. There might be a better way to do that last one.


:books: Documentation preview :books:: https://pymc-examples--559.org.readthedocs.build/en/559/

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

jessegrabowski commented 1 year ago

Just saw #527, I didn't even know this feature existed. I'll update this notebook to use it in the final example.

OriolAbril commented 1 year ago

Thanks! This is great, we get questions about this quite often

jessegrabowski commented 12 months ago

I refactored the last baby weight example to:

  1. Remove unicode greek names (following the examples style guide)
  2. Include both mutable and constant coords, to highlight the difference

I think (2) is important, since it's not really a documented feature anywhere yet.

review-notebook-app[bot] commented 12 months ago

View / edit / reply to this conversation on ReviewNB

twiecki commented on 2023-07-12T09:26:25Z ----------------------------------------------------------------

Should we just rename this to Using Data containers?


jessegrabowski commented on 2023-07-12T09:46:55Z ----------------------------------------------------------------

I like that better, since users don't need to know what a "shared variable" is to use the data containers API