Skip to content

Commit

Permalink
Add dashes to rename
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelLucaAdams committed Oct 25, 2024
1 parent 6704923 commit 541bce4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sdf_xarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@


def _rename_with_underscore(name: str) -> str:
"""A lot of the variable names have spaces and slashes in them, which
are not valid in xarray dimension names. So we replace them with
underscores."""
return name.replace("/", "_").replace(" ", "_")
"""A lot of the variable names have spaces, forward slashes and dashes in them, which
are not valid in netCDF names so we replace them with underscores."""
return name.replace("/", "_").replace(" ", "_").replace("-", "_")


def combine_datasets(path_glob: Iterable | str, **kwargs) -> xr.Dataset:
Expand Down

0 comments on commit 541bce4

Please sign in to comment.