-
Notifications
You must be signed in to change notification settings - Fork 41
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 bug with GDAC data source and BGC dataset #418
Conversation
Allows for: - deep copy (new instance with same parameters and cleared search) - shallow copy (new instance with same parameters and search results if any)
- fix bug raised when dealing with a STATION_PARAMETER index having an empty string
Re-designed how we compute the data mode of a parameter
fix compute to handle a collection of profiles (presumably with STATION_PARAMETERS and PARAMETER_DATA_MODE) or a collection of points (presumably without STATION_PARAMETERS and PARAMETER_DATA_MODE)
❌ 174 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
ftp fsspec is not accepting timeout=0 anymore ValueError: Non-blocking socket (timeout=0) is not supported
""" | ||
idx = copy.copy(indexfs) if isinstance(indexfs, ArgoIndex) else ArgoIndex() | ||
idx = indexfs.copy(deep=True) if isinstance(indexfs, ArgoIndex) else ArgoIndex() |
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.
Here we have a new method copy
for the ArgoIndex
def split(self): | ||
def compute(self, indexfs: Union[None, ArgoIndex]) -> xr.Dataset: | ||
"""Compute <PARAM>_DATA_MODE variables""" | ||
if "STATION_PARAMETERS" in self._obj and "PARAMETER_DATA_MODE" in self._obj: |
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 did not spot this subtility before
@@ -177,6 +177,8 @@ def __init__(self, mode: str = "", src: str = "", ds: str = "", **fetcher_kwargs | |||
raise OptionValueError( | |||
"The 'argovis' data source fetching is only available in 'standard' user mode" | |||
) | |||
if self._src == "gdac" and "bgc" in self._dataset_id: |
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 dont remember why this was removed
@@ -352,24 +354,48 @@ def split_data_mode(ds: xr.Dataset) -> xr.Dataset: | |||
------- | |||
:class:`xr.Dataset` | |||
""" | |||
if ds.argo._type != "profile": |
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.
Raise an error to avoid passing through for the wrong reasons and not detecting it
The data mode splitting method was found to provide erroneous results due to unexpected results from xarray dropna
The
ds.argo.datamode.split
method now use a clean ufunc method to properly extract parameter data mode