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

Fix bug that overwrites ensemble ancil data in calculate_point_estimates method #83

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

drewoldag
Copy link
Collaborator

@drewoldag drewoldag commented Jan 17, 2024

This fixes issue #82

Updated logic in calculate_point_estimates to conditionally create or append to ancil dictionary.

Problem & Solution Description (including issue #)

Prior to this change the last step in the calculate_point_estimates function would call qp_ensemble.set_ancil(...). That function will replace any existing ancil dictionary with the new one that is passed in.

Now, we'll check to see if the ensemble's ancil data is non-None. If so, we append the new dictionary to the existing ancil dictionary. If an ancil dictionary hasn't already been created, we'll add the new dictionary to the ensemble as the ancil dict.

Code Quality

  • My code follows the code style of this project
  • I have written unit tests or justified all instances of #pragma: no cover; in the case of a bugfix, a new test that breaks as a result of the bug has been added
  • My code contains relevant comments and necessary documentation for future maintainers; the change is reflected in applicable demos/tutorials (with output cleared!) and added/updated docstrings use the NumPy docstring format
  • Any breaking changes, described above, are accompanied by backwards compatibility and deprecation warnings

@drewoldag drewoldag self-assigned this Jan 17, 2024
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fd13285) 97.17% compared to head (06847f1) 97.18%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #83   +/-   ##
=======================================
  Coverage   97.17%   97.18%           
=======================================
  Files          32       32           
  Lines        1736     1738    +2     
=======================================
+ Hits         1687     1689    +2     
  Misses         49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@OliviaLynn OliviaLynn left a comment

Choose a reason for hiding this comment

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

Looks good!

@drewoldag drewoldag merged commit c0e32bb into main Jan 17, 2024
7 checks passed
@drewoldag drewoldag deleted the issue/82/point-estimate-mixin-overwrites-ancil branch January 17, 2024 23:28
@drewoldag drewoldag linked an issue Jan 17, 2024 that may be closed by this pull request
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.

PointEstimateMixin overwrites existing ancil data
3 participants