Skip to content

Commit

Permalink
Merge pull request #413 from euroargodev/fix-issue-412
Browse files Browse the repository at this point in the history
Fix issue 412, error when exporting a dataset to netcdf
  • Loading branch information
gmaze authored Nov 26, 2024
2 parents e2033a7 + d05984f commit d637380
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions argopy/data_fetchers/erddap_data_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def pre_process(
Fetched_url = this_ds.attrs.get("Fetched_uri")
else:
Fetched_url = this_ds.attrs.get("history", "").split('\n')[-1].split(' ')[-1]
Fetched_constraints = UriCName(Fetched_url)

# Finally overwrite erddap attributes with those from argopy:
raw_attrs = this_ds.attrs.copy()
Expand Down Expand Up @@ -104,7 +103,7 @@ def pre_process(
this_ds.attrs["Fetched_date"] = pd.to_datetime("now", utc=True).strftime(
"%Y/%m/%d"
)
this_ds.attrs["Fetched_constraints"] = Fetched_constraints
this_ds.attrs["Fetched_constraints"] = UriCName(Fetched_url).cname
this_ds.attrs["Fetched_uri"] = Fetched_url
this_ds = this_ds[np.sort(this_ds.data_vars)]

Expand Down
10 changes: 10 additions & 0 deletions docs/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ What's New
|pypi dwn| |conda dwn|



Coming up next
--------------

Internals
^^^^^^^^^

- Fix bug raising an error when exporting a dataset to netcdf after erddap fetch, :issue:`412`. (:pr:`413`) by `G. Maze <http://www.github.com/gmaze>`_.


v1.0.0 (16 Oct. 2024)
---------------------

Expand Down

0 comments on commit d637380

Please sign in to comment.