Hi all,
Thanks to all the contributors to SymPy - such a fantastic project.
The recent 1.9 update changed the internal implementation of the SparseMatrix class. This means pickle files of sparse matrices created with SymPy <=1.8 cannot be loaded by v1.9, and vice versa.
The
radioactivedecay package distributes some pre-calculated SymPy
sparse matices
containing processed nuclear data as part of the package. Currently it uses pickle files for this, but I was wondering if there is a more robust
alternative that is still efficient?
I looked at saving srepr strings to a text file, then reloading through sympify. However srepr of a SparseMarix outputs the full matrix, including Integer(0)'s for every zero element. The results in large file sizes, with slow saving & loading. (radioactivedecay's sparse matrices are circa 1500x1500 in size with 99.7% sparsity, so it really kills performance)
Is anyone aware of a better way to load and save SparseMatrix objects to files?