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

BUG? Check if a data source is in DataCatalog #501

Closed
2 tasks done
hboisgon opened this issue Sep 6, 2023 · 1 comment · Fixed by #513
Closed
2 tasks done

BUG? Check if a data source is in DataCatalog #501

hboisgon opened this issue Sep 6, 2023 · 1 comment · Fixed by #513
Labels
Bug Something isn't working DataCatalog & DataAdapters issues related to the DataCatalog and DataAdapters
Milestone

Comments

@hboisgon
Copy link
Contributor

hboisgon commented Sep 6, 2023

HydroMT version checks

  • I have checked that this issue has not already been reported.
  • I have checked that this bug exists on the latest version of HydroMT.

Reproducible Example

import hydromt
dc = hydromt.DataCatalog("artifact_data")
"merit_hydro" in dc
Traceback (most recent call last):
File "", line 1, in
TypeError: argument of type 'DataCatalog' is not iterable

Current behaviour

This returns an Error that DataCatalog is not iterable while this use to work (return True or False) before and is used at least in hydromt_wflow plugin a couple of times...

Anyway maybe it was not the best way to check if a data source is in data catalog and the option 'merit_hydro' in dc.sources is better and works but as it is used, I thought good to investigate why it does not work anymore and inform plugins accordingly before releasing.

Desired behaviour

The Error could stay but the change in behavior should be reported.

Additional context

No response

@hboisgon hboisgon added Bug Something isn't working Needs refinement issue still needs refinement DataCatalog & DataAdapters issues related to the DataCatalog and DataAdapters labels Sep 6, 2023
@hboisgon hboisgon added this to the Q3 milestone Sep 6, 2023
@DirkEilander
Copy link
Contributor

This has indeed been deprecated, but we can discuss if it is still required. The current syntax is

"merit_hydro" in dc.get_source_names()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working DataCatalog & DataAdapters issues related to the DataCatalog and DataAdapters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants