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
Establish common data store conventions #330
Comments
Is it possible that a store requires open parameters that are not listed in this convention? |
Yes, of course. A store can have any open parameters. This convention is about a set of common parameters. |
Regarding I agree that tuples are more suitable here, but we should be careful about not breaking anything with the change. Even if we merge my branch into xcube before updating the stores, we also need to confirm that the generator UI is OK with tuples. |
Also -- in |
What do you mean by use? Examples?
Which change? You may confuse the JSON representation of things with the object instances they are deserialized into. A JSON array schema that uses the tuple-item form will usually deserialize a JSON-array into a Python tuple rather than a list. To shorten discussion I'm also fine with |
WKT. But I agree, we should avoid it for time being. |
"use" in the sense of "only accept arrays as the bbox argument" (no longer true, but was when I wrote it). e.g. in xcube-sh:
I think that plain |
No, that is not true. They only validate by JSON schema, that is, only when parameters come as JSON objects. Users can still call our methods without invoking JSON schema validation. |
To be more pythonic, let's please use |
Is your feature request related to a problem? Please describe.
The xcube data store framework should establish common conventions so we have a consistent behaviour across all store implementations. The current store implementations (SH, CCI, CDS) behave slightly different.
Describe the solution you'd like
1. Open parameters
For a constraining open parameter P we introduce the following convention:
Common names are
variable_names: List[str]
,bbox:Union[str,Tuple[float, float, float, float]]
,crs:str
,spatial_res: float
,time_range: Tuple[Optional[str], Optional[str]]
,time_period: str
. A store may require all, or individual parameters, or none at all.E.g. applied to
variable_names
, this meansvariable_names is None
- include all data variablesvariable_names == []
- do not include data variables (schema only)variable_names == ["<var_1>", "<var_2>", ...]
only include data variables named "<var_1>", "<var_2>", ...Describe this convention in docstrings.
EDIT
A store implementation should document its available open parameters
DataStore.get_open_data_params_schema()
method2. Coordinate vs Data Variables
variable_names
shall refer to data variables only.Describe this convention in docstrings.
Additional context
We'll create linked issues and PRs in the store code repos where we fix implementations wrt this issue.
EDIT
This issue resolves only with the following:
The text was updated successfully, but these errors were encountered: