Skip to content
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

Use dims instead of coords #499

Merged
merged 4 commits into from
May 9, 2022
Merged

Conversation

tomicapretto
Copy link
Collaborator

I realized we were using the term coords for things that are actually dims in the xarray world.

This PR updates several places where we were wrongly using coords.

On top of that, I renamed the dimensions we use for group-specific terms:

  • factor + "_coord_group_factor" is now factor + "__factor_dim"
  • expr + "_coord_group_expr" is now expr + "__expr_dim"

which are clearer, shorter, and safer.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov-commenter
Copy link

codecov-commenter commented May 8, 2022

Codecov Report

Merging #499 (7af79b6) into main (355ed59) will decrease coverage by 0.15%.
The diff coverage is 89.15%.

@@            Coverage Diff             @@
##             main     #499      +/-   ##
==========================================
- Coverage   90.47%   90.32%   -0.16%     
==========================================
  Files          29       29              
  Lines        2320     2459     +139     
==========================================
+ Hits         2099     2221     +122     
- Misses        221      238      +17     
Impacted Files Coverage Δ
bambi/families/likelihood.py 93.61% <ø> (ø)
bambi/utils.py 67.74% <71.42%> (+7.74%) ⬆️
bambi/models.py 85.14% <84.50%> (-1.59%) ⬇️
bambi/terms.py 77.50% <85.18%> (-3.85%) ⬇️
bambi/backend/pymc.py 80.00% <85.71%> (+0.09%) ⬆️
bambi/families/univariate.py 88.18% <90.00%> (ø)
bambi/backend/terms.py 96.22% <95.23%> (-0.12%) ⬇️
bambi/families/multivariate.py 97.56% <96.55%> (+20.20%) ⬆️
bambi/defaults/defaults.py 80.55% <100.00%> (ø)
bambi/priors/scaler.py 95.71% <100.00%> (+0.12%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8bdedf8...7af79b6. Read the comment docs.

Copy link
Collaborator

@aloctavodia aloctavodia left a comment

Choose a reason for hiding this comment

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

LGTM

@tomicapretto tomicapretto merged commit a854b54 into bambinos:main May 9, 2022
@tomicapretto tomicapretto deleted the coords_to_dims branch May 9, 2022 22:13
aloctavodia added a commit that referenced this pull request Jun 1, 2022
* Extract args (#493)

* fix multinomial family with group-specific terms

* Refactorize how we compute predictions

* remove unintentional brms file and black

* remove typo from test

* rerun categorical regression

* add shooter data again

* Update coords of terms

* Fixed stack order in predict for categorical group specific terms and message label in bernoulli family

* [no ci] docstring

* Add utils to extract labels when we use multinomial family. Also add 'c' function which was not added before.

* Add coordinate for predictions in multinomial model

* Use dims instead of coords (#499)

* Update to use dims instead of coords. Also rename group-specific dims

* update examples that used coords

* Update changelog

* Fix how we look for dims. This should fix tests

* Fix typos (#501)

* Don't modify original dataset (#502)

* Don't modify original dataset

* update changelog

* black and lint

* [no ci] update changelog

* [no ci] minor updates to CONTRIBUTING

* [no ci] update docs conf

* Remove draws argument from model predict (#504)

* Prepare 0.8.0 release (#505)

* Prepare release (update formulae reqs)

* Update changelog

* Update publish-docs-release.yml

* Update publish-docs-release.yml

* Add workflow_dispatch to .yml to run manually

* merge changes

* update backend to PyMC v4

Co-authored-by: Tomás Capretto <tomicapretto@gmail.com>
Co-authored-by: Hector Munoz <23343812+hectormz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants