-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fixes/methods on AdlerData. #80
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #80 +/- ##
===========================================
+ Coverage 69.84% 86.40% +16.56%
===========================================
Files 3 3
Lines 63 103 +40
===========================================
+ Hits 44 89 +45
+ Misses 19 14 -5 ☔ View full report in Codecov by Sentry. |
I noticed get_phase_parameters_in_filter returns "phase_parameters" and "phase_parameters_err" whereas populate_phase_parameters accepts "parameters" and "parameters_err". I've added a very minor commit to update everything to be like "phase_parameter", this way the output of get can be used directly in populate e.g:
|
Just some minor suggestions before merging. In AdlerData default None values lead to very small/large numbers being stored when variable is not set, print_data therefore displays output even when a filter has not been set. |
Also get_phase_parameters_in_filter breaks if there is no model and so you cannot retrieve observation metadata:
E.g. you might start populating AdlerData with just metadata before fitting a model. Expected behaviour would be to return the metadata and empty values for model variables? Just adding a model_name makes it work, but maybe we want to force people to do this
|
I've changed I think this is much clearer/better behaviour. Good catch! I have also changed how the arrays are initialised. Instead of The alternative is to use dtype=object (and filling arrays with None). However, I'd then probably have to write type-checking, as there would be nothing to stop someone setting a value to "cheese" or a dictionary or an entire function or something equally silly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey just tested the changes and they work great thanks. Defaulting to zeros for number of observations and the get_phase_parameters_in_filter
and print_data
makes sense to me!
Fixes #70.
AdlerData.print_data()
will clearly print out the data stored in AdlerData.Fixes #74.
AdlerData.get_phase_parameters_in_filter()
returns a dictionary of the phase parameters in a specified filter and model. Chose a dictionary for clarity here.Fixes #72.
Fixes #73.
test_object.populate_phase_parameters("u", "model_1", 11.0, 12.0, 13, 14.0, 15.0, 16.0, [17.0], [18.0])
will update/populate everything, as before, buttest_object.populate_phase_parameters("u", model_name="model_2", H=25.0, H_err=26.0, parameters=[27.0, 27.5], parameters_err=[28.0, 28.5])
will add a new model,model_2
, and its parameters, without changing any of the others. Existing models can also be updated.Review Checklist for Source Code Changes