Skip to content
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 renaming issue #883

Merged
merged 3 commits into from
Apr 15, 2024
Merged

fix renaming issue #883

merged 3 commits into from
Apr 15, 2024

Conversation

DirkEilander
Copy link
Contributor

@DirkEilander DirkEilander commented Apr 12, 2024

Issue addressed

Fixes #881

Explanation

Variables on datasets with only a single variable were not checked. The reason was that we want to automatically convert variable names from tif files (which get the file name as variable by default) if a variable is requested. This is important to make sure we can still read tif files based on the path if not set in the data catalog without getting errors on the variable name. I have moved this functionality to the raster driver and now make sure the check for variables always occurs.

Checklist

  • Updated tests or added new tests
  • Branch is up to date with main
  • Tests & pre-commit hooks pass
  • Updated documentation if needed
  • Updated changelog.rst if needed
  • For predefined catalogs: update the catalog version in the file itself, the references in data/predefined_catalogs.yml, and the changelog in data/changelog.rst

Additional Notes (optional)

@Jaapel this behaviour should also land in #857

hydromt/data_adapter/rasterdataset.py Outdated Show resolved Hide resolved
hydromt/data_adapter/rasterdataset.py Outdated Show resolved Hide resolved
hydromt/data_adapter/rasterdataset.py Outdated Show resolved Hide resolved
Copy link
Contributor

@hboisgon hboisgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm!

Co-authored-by: Jaap Langemeijer <33715902+Jaapel@users.noreply.github.com>
@hboisgon hboisgon merged commit 9cc9eb4 into main Apr 15, 2024
10 checks passed
@hboisgon hboisgon deleted the fix/881 branch April 15, 2024 01:23
Jaapel added a commit that referenced this pull request May 2, 2024
@savente93 savente93 mentioned this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HydroMT renames variable in get_rasterdataset when it is not supposed to
3 participants