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

add var_names to to_dataframe #2277

Merged
merged 5 commits into from
Nov 14, 2023
Merged

add var_names to to_dataframe #2277

merged 5 commits into from
Nov 14, 2023

Conversation

ahartikainen
Copy link
Contributor

@ahartikainen ahartikainen commented Sep 9, 2023

Fixes #2260

Description

Add var_names and var_filter to to_dataframe function. Follows similar logic as in extract function.

Checklist

  • Follows official PR format
  • New features are properly documented (with an example if appropriate)?
  • Includes new or updated tests to cover the new feature
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

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

@ahartikainen
Copy link
Contributor Author

@OriolAbril how should we handle the cases when some variable is not found in all groups. I currently have it in "ignore" mode.

@OriolAbril
Copy link
Member

I think that is fine. If I say var_names = ["theta", "diverging", "obs"] I want all their ocurrences to be added to the dataframe, not to error out because diverging is not in the posterior or things like that.

@ahartikainen
Copy link
Contributor Author

I need to tests this still manually, but I think after it we can merge this.

Copy link

codecov bot commented Nov 12, 2023

Codecov Report

Merging #2277 (8b4ef78) into main (eb88f3a) will decrease coverage by 0.01%.
The diff coverage is 88.88%.

@@            Coverage Diff             @@
##             main    #2277      +/-   ##
==========================================
- Coverage   86.89%   86.88%   -0.01%     
==========================================
  Files         122      122              
  Lines       12628    12638      +10     
==========================================
+ Hits        10973    10981       +8     
- Misses       1655     1657       +2     
Files Coverage Δ
arviz/data/inference_data.py 82.56% <91.66%> (+0.04%) ⬆️
arviz/utils.py 88.02% <83.33%> (-0.25%) ⬇️

@ahartikainen ahartikainen merged commit 2034668 into main Nov 14, 2023
10 of 11 checks passed
@ahartikainen ahartikainen deleted the feature/pandas_vars branch November 14, 2023 17:23
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.

Add vars / vars_name for to_dataframe
2 participants