-
Notifications
You must be signed in to change notification settings - Fork 107
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
Get filepaths to downloaded hdf5 granule files #59
Conversation
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 like the additions you've made here, but I have concerns about how modular/flexible the filepath list would be given that it is explicitly tied to the download process (and thus cannot be used for locally available files that have already been downloaded). I can think of a few different ways to approach this that remedy that, but overall I think it would be better to have filepaths
be a property of the granules class that is filled in during the download process (if a download occurs) OR can be filled in during initialization (of the icesat2data object, which would consequently initialize a granules object). In either case you would access it using region_a.granules.filepaths
, similar to what you've included. This also removes the need for a login/authentication in order to write a unit test (unit tests for new functions are encouraged and would be super appreciated - thanks for offering! As an aside, thinking about how to unit test things has done wonders for my code-writing, given the authentication issue you note. Our current approach is to have as many functions as possible be independent of a login, and then we test the login independently using a secure key in Travis CI).
Would you be able to refactor this with this flexibility in mind? Apologies for not getting you on the dev team list yesterday!
Ok done, but I'll probably need to refactor it later to account for the items below 👇
I'll need to have a rethink about how to do this. I see you've added some new tests for
Wait until you start writing integration tests 😆 But yes, good to have unit tests be as independent as possible. |
Plus changed filepath.extend to filepaths.append.
Should be using reg_a.granules.avail instead of reg_a.granules
Reformat CONTRIBUTORS.rst, add myself, fix typo
Updated Contributers, added my name
update documentation and readme with clearer install instructions (including for windows users)
Update codecov badge to point to 'development' branch
Fix test failures in test_granules.py
* add black pre-commit hook and reformat files using black * add github action workflow with flake8 on PRs
* moved examples to top level dir and updated docs links * grammar edits * add pypi deployment to travis * add notes about development branch to contribution_guidelines * migrate from travis-ci.org to travis-ci.com and start using Travis-CI GitHub App to do CI checks (because webhook from travis-ci.org wasn't reporting the status back to GH, making it challenging to merge some PRs given the branch protection rules).
Do so via a `download_path` property that can be set by the user, either before or after a download has occured. The `filepaths` property would then return the full paths to each of the granule files for loading into h5py or xarray.
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 think this is being handled here:
Line 1 in c5e58b1
from pathlib import Path |
and
Line 1 in c5e58b1
# NOTE: This is just a (quick and dirty) test for the data object |
We are still discussing the best strategy for interoperability between modules that may require some of the same methods (e.g. query
and data
). Our next Team Meeting would be a good place to discuss these ideas before officially implement them.
Sorry, must have missed that branch! Probably should refactor and port the unit tests here over to there, but I'll take a closer look first and probably come to the next meeting (if my timezone works out) to see where things are at for icepyx. |
cb9fa86
to
e7a9af0
Compare
@weiji14 Browsing through some of these older/open PRs (I was remembering that this one was waiting for read-in functionality consideration, which #222 does). Updated thoughts on this (and if we want to pursue any of it, could you update the base so we can see where the differences are more easily)? |
Closing this as it's not really relevant anymore, especially with the new |
Before h5py, h5netcdf, xarray, and other readers can open the HDF5 files are, we'll need to figure out where the filepaths to actually are! This is the first step in resolving #35. Users can access a
filepaths
property in theIcesat2Data.granules
class after they've downloaded the granules (or they can set theIcesat2data.granules.filepaths
property if they've downloaded the files already).gives:
Users can then load the data files from the filepaths, e.g. as follows:
I can write unit tests for this
if someone finds a way to securely authenticate to the NSIDC servers without putting my uid/password up 😆Done: Unit tests written!