hydromt icon indicating copy to clipboard operation
hydromt copied to clipboard

Remove root from meta on exporting data catalog to yml

Open jensdebruijn opened this issue 11 months ago • 0 comments

HydroMT version checks

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

Reproducible Example

from hydromt.data_catalog import DataCatalog
import os

data_catalog = DataCatalog()
data_catalog.to_yml(os.path.abspath("data_catalog.yml"), root=os.path.abspath("."))

Current behaviour

Root is not removed in to_yml when root and yml_dir are equal. Here, I believe root should be removed from data_dict["meta"] rather than the data_dict itself.

https://github.com/Deltares/hydromt/blob/69ad608b374cc28e9266bb9f5d7551a1fd882f4a/hydromt/data_catalog.py#L1022

Desired behaviour

Root removed from data_dict

Additional context

No response

jensdebruijn avatar Mar 07 '24 07:03 jensdebruijn