Ouranosinc / xscen

A climate change scenario-building analysis framework.
https://xscen.readthedocs.io/
Apache License 2.0
15 stars 2 forks source link

Dont change mutable input argument of search_data_catalog #413

Closed aulemahal closed 3 months ago

aulemahal commented 3 months ago

Pull Request Checklist:

What kind of change does this PR introduce?

If this argument is coming from a config dictionary, this had the unwanted consquence of changing the config entry from a path to a DataCatalog instance. Which could have unexpected consequences.

In our usual xscen usage, the config dictionary is an instance of xscen.config.ConfigDict which has the magical ability of copying itself each time a section is accessed (i.e. CONFIG['section'] actually returns a copy of the "section" sub-dictionary and not a reference to the CONFIG dictionary itself.). And so we didn't notice the issue.

Does this PR introduce a breaking change?

I hope not.

Other information: