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

Add metadata handling object #149

Merged
merged 25 commits into from
Aug 14, 2023
Merged

Add metadata handling object #149

merged 25 commits into from
Aug 14, 2023

Conversation

sandorkertesz
Copy link
Collaborator

@sandorkertesz sandorkertesz commented Aug 4, 2023

Relates to #146

Still work in progress but there is a basic implementation.

The implementation contains the base class Metadata and the following derived classes:

See the notebook for examples: https://earthkit-data.readthedocs.io/en/feature-metadata-object/examples/metadata.html

The new classes Field and FieldList provide abstraction for fields and fieldlists. The GRIB implementation and the newly created numpy field + fieldlist are based on these (the NetCDF fieldlist is still to be redesigned):

  • Field is a base class for: GribField, NumpyField
  • FieldList is a base class for: GribFieldList, NumpyFieldList

NumpyField is a combination of a numpy array and a Metadata object, while NumpyFieldList is a sequence of these fields. A NumpyFieldList can be created with FieldList.from_numpy(). It has an experimental write support.

The following example shows how to create a NumpyFieldList from the results of field based computations: https://earthkit-data.readthedocs.io/en/feature-metadata-object/examples/numpy_fieldlist.html

Copy link

@oiffrig oiffrig left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good so far, I'll try it out

docs/examples/metadata.ipynb Outdated Show resolved Hide resolved
docs/examples/numpy_fieldlist.ipynb Outdated Show resolved Hide resolved
tests/sources/test_numpy_list.py Show resolved Hide resolved
@sandorkertesz sandorkertesz changed the title WIP: add metadata handling object Add metadata handling object Aug 14, 2023
@sandorkertesz sandorkertesz merged commit 7dedbfa into develop Aug 14, 2023
8 checks passed
@sandorkertesz sandorkertesz deleted the feature/metadata-object branch August 14, 2023 10:28
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.

2 participants