dstansby / pfsspy

Potential Field Source Surface model package for Python
https://pfsspy.readthedocs.io/
Other
40 stars 17 forks source link

Passing a map into `Input` alters the `plot_settings` #325

Closed wtbarnes closed 2 years ago

wtbarnes commented 2 years ago

I don't know if this is really a bug per se, but altering the plot settings of the input magnetic field boundary map

https://github.com/dstansby/pfsspy/blob/26b6eac4ac86b677c997c4125fdf0ba0359efe15/pfsspy/input.py#L45-L49

has the side effect of changing the plot settings on the map outside of Input as well as the plot_settings dictionary is effectively passed by reference. I think it would be better here to instead create a copy of the input map before adding it as an attribute on Input.