-
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
Refactor read_qdm_harvard function #11
Conversation
💖 Thank you for opening your first pull request in this repository! 💖 A few things to keep in mind:
⭐ No matter what, we are really grateful that you put in the effort to do this! ⭐ |
magali/_io.py
Outdated
x = np.arange(shape[1]) * spacing | ||
y = np.arange(shape[0]) * spacing | ||
z = np.full(shape, sensor_sample_distance) | ||
data = vd.make_xarray_grid( | ||
(x, y, z), | ||
|
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.
Maybe remove these blank lines.
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.
Well done @YagoMCastro! Made a few suggestions to improve the names and wording in the docstrings. Code itself is good and helps simplify the function. Thanks!
magali/_io.py
Outdated
return data | ||
|
||
|
||
def _set_qdm_data_grid(contents): |
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.
How about _extract_data_qdm_harvard
? It's not really "setting" the data but extracting it from the contents
dict.
magali/_io.py
Outdated
return (x, y, z), data_names, bz | ||
|
||
|
||
def _create_grid_qdm_data(coordinates, data_names, bz, path): |
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.
How about _create_qdm_harvard_grid
?
magali/_io.py
Outdated
|
||
def _create_grid_qdm_data(coordinates, data_names, bz, path): | ||
""" | ||
Grid QDM microscopy data in the Harvard group format. |
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.
Update accordingly.
magali/_io.py
Outdated
This is the file type used by Roger Fu's group to distribute QDM data. It's | ||
a Matlab binary file that has the data and some information about grid | ||
spacing. |
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.
Not relevant to this functions.
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 functions makes the xarray.Dataset
and sets appropriate metadata.
Co-authored-by: Leonardo Uieda <leo@uieda.com>
Co-authored-by: Leonardo Uieda <leo@uieda.com>
Co-authored-by: Leonardo Uieda <leo@uieda.com>
Co-authored-by: Leonardo Uieda <leo@uieda.com>
Co-authored-by: Leonardo Uieda <leo@uieda.com>
Co-authored-by: Leonardo Uieda <leo@uieda.com>
Well done! Merging. |
🎉 Congrats on merging your first pull request and welcome to the team! 🎉 If you would like to be added as a author on the Zenodo archive of the next release, add your full name, affiliation, and ORCID (optional) to the We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved. |
Created two private functions in order to make the code easier to read
Relevant issues/PRs: