-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix: handle admp valid start index for retention period #138
fix: handle admp valid start index for retention period #138
Conversation
When calling the function, the admp_valid_start_index and the admp_valid_start_date will always be there? What happens if the code doesn't find it? |
chunking_length = dimension_metadata.get("chunkLen") | ||
if isinstance(chunking_length, dict): | ||
chunking_length = chunking_length.get(variable_id) | ||
|
||
coordinate = cls( | ||
coordinate_id=dimension, | ||
units=dimension_metadata.get("units") or "", | ||
minimum_value=minimum_value, # type: ignore | ||
minimum_value=minimum_value or coordinates_info.get("min"), # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand this: if there is a minimum_value
assigned (not None) it takes it, else it takes coordinates_info.get("min")
? What happens if there is no coordinates_info.get("min")
? It throws an error, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't enter the if and then it would have, at max, a None
as minimum value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't throw an error only coordinates_info.get("min")
whatever the value is
Handle values for retention dates as some datasets don't have min and max but only a list of values that should be updated
Handle values for retention dates as some datasets don't have min and max but only a list of values that should be updated
We would set the minimun to the
admp_valid_start_date
whereas some datasets have values and hence we should return only the valid values for the time values. See an example:https://stac.marine.copernicus.eu/metadata/OCEANCOLOUR_ATL_BGC_L4_NRT_009_116/cmems_obs-oc_atl_bgc-pp_nrt_l4-multi-1km_P1M_202311/dataset.stac.json