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

Replace TypeSpecifier by simpler DataType #510

Merged
merged 7 commits into from
Aug 30, 2021

Conversation

forman
Copy link
Member

@forman forman commented Aug 27, 2021

Closes #509

This PR implements more or less the solution indicated in #509.

Checklist:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/source/*
  • Changes documented in CHANGES.md
  • AppVeyor CI passes
  • Test coverage remains or increases (target 100%)

Remember to close associated issues after merge!

@forman forman requested a review from TonioF August 27, 2021 09:34
@forman forman self-assigned this Aug 27, 2021
@forman forman changed the title Forman 509 simpler data type Replace TypeSpecifier by simpler DataType Aug 27, 2021
Copy link
Contributor

@TonioF TonioF left a comment

Choose a reason for hiding this comment

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

See comments.

@property
def alias(self) -> str:
"""The primary alias name."""
return self._aliases[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

aliases might be of length 0

Copy link
Member Author

Choose a reason for hiding this comment

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

No, there is always at least one alias. See constructor.

fs_path = self._convert_data_id_into_fs_path(data_id)
return self.fs.exists(fs_path)
return False

def describe_data(self, data_id: str, type_specifier: str = None) \
def describe_data(self, data_id: str, data_type: DataTypeLike = None) \
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to think about whether we still need data_type as a parameter here. We originally put it in here because the resulting DataDescriptor would be different, depending on whether we ask for a data or a dataset[cube].

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, each datatype has its own descriptor type,

  • xr.Dataset <-> DatasetDescriptor
  • MultiLevelDataset <-> MultiLevelDatasetDescriptor
  • gpd.GeoDataFrame <-> GeoDataFrameDatasetDescriptor

@forman forman marked this pull request as ready for review August 30, 2021 11:38
@forman forman merged commit b280f83 into master Aug 30, 2021
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.

Step away from "type specifiers" introduced in xcube 0.6
2 participants