arviz-devs / arviz

Exploratory analysis of Bayesian models with Python
https://python.arviz.org
Apache License 2.0
1.6k stars 397 forks source link

Add example for arviz.InferenceData.map #2304

Closed aadya940 closed 7 months ago

aadya940 commented 9 months ago

Related to #1486


📚 Documentation preview 📚: https://arviz--2304.org.readthedocs.build/en/2304/

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

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.79%. Comparing base (44db4c8) to head (2956423). Report is 5 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2304 +/- ## ========================================== + Coverage 86.73% 86.79% +0.05% ========================================== Files 122 123 +1 Lines 12705 12728 +23 ========================================== + Hits 11020 11047 +27 + Misses 1685 1681 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

OriolAbril commented 7 months ago

Really sorry about the super slow review. The changes look great, there is only a minor thing. The last cell is:

idata.observed_data.school.values
_upper = np.array([
    x.upper() for x in idata.observed_data.school.values
]).T 
idata_with_upper = idata.map(
    lambda ds, **kwargs: ds.assign_coords(**kwargs),
    groups="observed_vars",
    upper=("Upper", _upper),
)
idata_with_upper

where the 1st line isn't doing anything and could be confusing to people who are getting started.

aadya940 commented 7 months ago

Thanks for the Review :-) @OriolAbril