You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can argue this is consistent with how you're supposed to work with pandas and xarray, where the inplace operations are mostly discouraged or removed; although you might as well make the object immutable in that case to avoid confusion?
The text was updated successfully, but these errors were encountered:
Another thought: this can be avoided entirely by not using exclude_unset. This then writes all the defaults to the TOML, but that's fine. I mostly prefer having the settings in that way, because it explicitly communicates what e.g. the solver settings are.
Here's an MWE:
If you now check the TOML, I'd expect to see a non-default saveat entry, but instead:
I believe this is due to the (expected) behavior of exlude_unset, see also:
pydantic/pydantic#5749
Creating a new object does work, probably because the solver entry is detected as being set by pydantic?
TOML:
Given that this seems expected behavior by pydantic, I'm not sure it's easy to fix (without dirty hacks).
A pragmatic solution might be something like this:
The update method just returns a new object.
You can argue this is consistent with how you're supposed to work with pandas and xarray, where the
inplace
operations are mostly discouraged or removed; although you might as well make the object immutable in that case to avoid confusion?The text was updated successfully, but these errors were encountered: