-
Notifications
You must be signed in to change notification settings - Fork 24
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
Switching netcdf3 & netcdf4 filetype detection to file magic 🧙 #64
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64 +/- ##
==========================================
+ Coverage 90.29% 90.48% +0.18%
==========================================
Files 14 14
Lines 938 946 +8
==========================================
+ Hits 847 856 +9
+ Misses 91 90 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if dataset.data_model == "NETCDF4": | ||
filetype = "netCDF4" | ||
elif dataset.data_model == "NETCDF3_CLASSIC": | ||
filetype = "netCDF3" |
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 function should return an enum, not a string.
Everything in this library should be super strictly typed.
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.
@rabernat Should these be similar to how it's done in pangeo-forge-recipes
?, ie.
class FileType(AutoName):
netcdf3 = auto()
netcdf4 = auto()
grib = auto()
...
filetype = FileType("netcdf3")
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 looks good!
Sounds good, ready to merge? |
Thanks again @norlandrhagen ! |
#43 (comment)