-
Notifications
You must be signed in to change notification settings - Fork 12
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
Create datasetId also for simulation dataframe (resolves #388) #408
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #408 +/- ##
===========================================
+ Coverage 77.80% 77.84% +0.03%
===========================================
Files 22 22
Lines 2118 2126 +8
Branches 494 498 +4
===========================================
+ Hits 1648 1655 +7
+ Misses 345 344 -1
- Partials 125 127 +2
Continue to review full report at Codecov.
|
@MerktSimon but is not |
@elbaraim it is creating the |
change exp data columns check function to also check sim data
@MerktSimon would be possible to silent this?
I think by adding |
@elbaraim this is actually a feature not a bug. |
absolutely! 😅 |
raise ValueError(f'Visualization requires field {DATASET_ID} to be ' | ||
f'present in simulation table.') | ||
if sim_data is not None: | ||
sim_data[DATASET_ID] = exp_data[DATASET_ID] |
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.
I feel like this line is just asking for trouble. It might work for that one specific use case but is generally not a good solution.
- you don't want to overwrite user provided value
- I don't think we can generally assume that sim_data and exp_data are equally ordered.
Also I generally recommend that if you fix something like this, add one or two test cases to make sure it is not inadvertently broken in the future.
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.
if sim_data is not None and DATASET_ID not in sim_data:
Hence this only applies if there is no user provided datasetId. In these cases exp_data gets a default datasetId (something like 'obsverbale_condition').- I thought in cases without datasetId it would be reasonable to assume same order for sim_data and exp_data. But of course the procedure for creating exp_data's datasetId could be easily applied to sim_data, too.
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.
test wise this could be covered by enhancing each of the plot_by_observable/condition/datasetId tests with a second function call also plotting with simulated data and not only measurement
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.
if sim_data is not None and DATASET_ID not in sim_data:
Hence this only applies if there is no user provided datasetId. In these cases exp_data gets a default datasetId (something like 'obsverbale_condition').
I can only see if sim_data is not None
there. As a proposal for a fix this sounds right.
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.
ah yeah you are right. had to many intermediate versions.
Function check_ex_exp_columns is changed to also check simulation columns and create datasetId column in case it is missing