Ouranosinc / xclim

Library of derived climate variables, ie climate indicators, based on xarray.
https://xclim.readthedocs.io/en/stable/
Apache License 2.0
333 stars 59 forks source link

MBCn: `base_kws_vars` copied to avoid global changes #1999

Closed coxipi closed 6 days ago

coxipi commented 6 days ago

Pull Request Checklist:

What kind of change does this PR introduce?

Does this PR introduce a breaking change?

No

Other information:

coxipi commented 6 days ago

Reassigning a dict in a function works btw:

import copy 
dd = {"a":1, "b":2}
def ff(dd): 
    dd = copy.deepcopy(dd)
    dd["a"] = 2
ff(dd)
dd
>>> {"a":1, "b":2}
coxipi commented 6 days ago

@tlogan2000 I will be merging this once the tests are passed to address the bug you have found, thanks.

coveralls commented 6 days ago

Coverage Status

coverage: 89.399% (+0.001%) from 89.398% when pulling d31f51ec73e76b1999a47eeb651dbe29e98721ce on mbcn_params_dict_local into 5c4cf5fa07ca58d21ca6d5824ff899c48db322ac on main.