Skip to content
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

adding in initial lower-level support for MAS files #101

Closed
wants to merge 1 commit into from

Conversation

thepeteriley
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

Codecov Report

Merging #101 (68a210f) into main (81d2dd0) will decrease coverage by 12.97%.
The diff coverage is 0.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #101       +/-   ##
===========================================
- Coverage   87.35%   74.37%   -12.98%     
===========================================
  Files          29       30        +1     
  Lines         957     1124      +167     
===========================================
  Hits          836      836               
- Misses        121      288      +167     
Impacted Files Coverage Δ
psipy/psihdf/psihdf.py 0.00% <0.00%> (ø)

@dstansby
Copy link
Collaborator

Is the goal of this PR to enable users to access the numpy arrays of the data directly? If so, two thoughts:

  1. Ideally users should never have to use the raw numpy array, but use it with the grid and unit information attached. That's the reason why I made the classes in the first place! If there's a use case that's driving the need to use a raw array, I'd suggest opening an issue, and working out a way to do what is required through the main classes that exist already.
  2. It's should be possible to get the data once it's been loaded into a Variable object through my_variable.data. This returns an xarray.DataArray, and then you can use the .values attribute on that to get the numpy array (so my_variable.data.values in total).

@thepeteriley
Copy link
Collaborator Author

Is the goal of this PR to enable users to access the numpy arrays of the data directly? If so, two thoughts:

  1. Ideally users should never have to use the raw numpy array, but use it with the grid and unit information attached. That's the reason why I made the classes in the first place! If there's a use case that's driving the need to use a raw array, I'd suggest opening an issue, and working out a way to do what is required through the main classes that exist already.
  2. It's should be possible to get the data once it's been loaded into a Variable object through my_variable.data. This returns an xarray.DataArray, and then you can use the .values attribute on that to get the numpy array (so my_variable.data.values in total).

Yes, this makes sense. I suppose it would have been a convenient way to pack in some lower-level routines into an existing package, but I can appreciate that it would probably make things confusing for the user. It's probably better to package these up into a separate repo, like psipytools (or something catchier?), since they would probably be used for different applications anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants