-
Notifications
You must be signed in to change notification settings - Fork 1
Experiment mwp #90
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
base: develop
Are you sure you want to change the base?
Experiment mwp #90
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #90 +/- ##
==========================================
Coverage ? 97.63%
==========================================
Files ? 30
Lines ? 1606
Branches ? 268
==========================================
Hits ? 1568
Misses ? 21
Partials ? 17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AndrewSazonov
left a comment
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.
Small suggestion: it would be nice to update the placeholder markdown header cells to use the notebook title and short description I added in the previous PR (and also add one to the new experiment.ipynb). That way the code cells can automatically stretch to the full page width.
rozyczko
left a comment
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.
some minor issues raised
| value = int(value) | ||
| # This line can be removed when scipp resize support | ||
| # resizing with coordinates | ||
| dimensions[dim] = value |
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.
You're modifying dimensions in-place, while iterating over its items. This can lead to BAD things. Consider creating a copy of dimensions before and iterating over the copy (or the other way around)
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.
Thanks!
| """Get the Q values from the dataset.""" | ||
| if self._data is None: | ||
| warnings.warn('No data loaded.', UserWarning) | ||
| return None |
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.
None is not the advertised sc.Variable. Consider changing -> sc.Variable to sc.Variable | None
| if self._data is None: | ||
| raise ValueError('No data to save.') | ||
|
|
||
| import os |
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.
Move the import to the top
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.
Top of the file or top of the function? I believe I put it here to only do the import if we're actually saving data, so after input checking :)
Edit: put it at the top of the file
| 'giving the Experiment an invalid name' | ||
| # WHEN / THEN EXPECT | ||
| with pytest.raises(TypeError): | ||
| experiment.load_hdf5('some_file.h5', name=123) |
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.
Shouldn't the argument be display_name?
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.
It should indeed, I wonder how it passed the test
docs/docs/tutorials/index.md
Outdated
| a model of diffusion | ||
| - [Sample model](sample_model.ipynb) – Learn how to create a model of | ||
| the scattering from your sample | ||
| - [Experiment] (experiment.ipyng) - Learn how to load and bin your data |
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.
This should read experiment.ipynb
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.
Why can't I react with the 'see no evil' emoji?
| import plopp as pp | ||
| import scipp as sc | ||
|
|
||
| # from easyscience.job.experiment import ExperimentBase |
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.
remove commented out code
| ########### | ||
|
|
||
| @staticmethod | ||
| def _in_notebook(): |
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.
this method should probably be typed to return -> bool
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.
Fixed this and another missing type hint :)
Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>
Good point, will do this! |
Add experiment class and minimal functionality