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

Implement RaggedArray.from_xarray() #51

Merged
merged 6 commits into from
Nov 20, 2022

Conversation

milancurcic
Copy link
Member

@milancurcic milancurcic commented Nov 11, 2022

  • Implementation
  • Test
  • Docs

Closes #44

@milancurcic milancurcic added the enhancement New feature or request label Nov 11, 2022
@milancurcic milancurcic self-assigned this Nov 11, 2022
Copy link
Contributor

@philippemiron philippemiron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a test to check if the dimension names are not "traj" and "obs". Also, you can do from clouddrift import RaggedArray directly because __init__.py imports automatically the class in the dataformat.py.

@philippemiron
Copy link
Contributor

philippemiron commented Nov 15, 2022

Actually, I have two more comments to discuss:

  • wouldn't it be more useful also to have the default parameters (dim_traj: str = "traj", dim_obs: str = "obs") on the from_netcdf method?
  • we could also copy/paste this wrapper and call it from_zarr and it should work seamlessly

@milancurcic
Copy link
Member Author

Thanks, Philippe.

On the first point, yes, it would be more useful, but I chose to leave it alone for now because we're considering removing readers and writers for file formats (parquet and netcdf). The rationale is that the users will work with data in xarray or awkward, and they can read and write from and to files from those libraries.

And similar for zarr. Most likely we'll just show the user how to do it from xarray. Less likely, you're right, it can be the same wrapper as from_netcdf.

Another reason that it wouldn't be part of this PR is that I want to keep PRs small and focused (single feature).

@milancurcic milancurcic mentioned this pull request Nov 15, 2022
3 tasks
@milancurcic
Copy link
Member Author

Thank you for the review!

@milancurcic milancurcic merged commit 05fc41c into Cloud-Drift:main Nov 20, 2022
@milancurcic milancurcic deleted the from_xarray branch November 20, 2022 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement RaggedArray.from_xarray()
2 participants