unyt icon indicating copy to clipboard operation
unyt copied to clipboard

Names are not pickled/unpickled

Open JBorrow opened this issue 4 years ago • 3 comments

The name attribute of the unyt array is not pickled/unpicked. Requires changes to the following methods:

https://github.com/yt-project/unyt/blob/e86c0500e9c9f29914eed3ef7d8f11c98768eedd/unyt/array.py#L1992

https://github.com/yt-project/unyt/blob/e86c0500e9c9f29914eed3ef7d8f11c98768eedd/unyt/array.py#L2008

JBorrow avatar Oct 11 '21 22:10 JBorrow

Oops! You’ll also need to make sure you can load both new and old pickle files, failing gracefully for old pickles.

ngoldbaum avatar Oct 12 '21 22:10 ngoldbaum

I see this issue was opened only 3 days after https://github.com/sympy/sympy/issues/22241 It doesn't look like the exact same issue but since the sympy bug hasn't been fixed upstream yet it's worth noting that it exists for anyone wishing to work on this.

neutrinoceros avatar Jan 19 '22 09:01 neutrinoceros

I guess these are fundamentally different issues though, name is an attribute on unyt_array that we are just choosing not to store in the pickle.

JBorrow avatar Jan 24 '22 13:01 JBorrow