AttributeError when load object (ideal and groebner basis) with numpy.load

asked 2021-07-17 20:44:42 +0200

petRUShka gravatar image

updated 2024-04-18 20:10:16 +0200

FrédéricC gravatar image

I've calculated Groebner Basis with sage and have saved it with

    I = Ideal(ideal_generators)
    B = I.groebner_basis(algorithm=groebner_alghorithm);"output/basis_ideal", (B, I))

where ideal_generators is some equations in PolynomialRing of several variables. It was in 2019.

After two years (and several updates of SageMath) I try to load that saved object and get an error: AttributeError: 'TermOrder' object has no attribute '_singular_ringorder_column'.

I've saved several baseis and some of them are loaded fine and some with such error.

How to load that "broken" files?

P.S. Full traceback:

 Traceback (most recent call last):
  File "/home/user/algebra/", line 55, in <module>
    B, I = np.load(filename, allow_pickle=True)
  File "/usr/lib/python3.9/site-packages/numpy/lib/", line 440, in load
    return format.read_array(fid, allow_pickle=allow_pickle,
  File "/usr/lib/python3.9/site-packages/numpy/lib/", line 744, in read_array
    array = pickle.load(fp, **pickle_kwargs)
  File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1925, in sage.rings.polynomial.multi_polynomial_libsingular.unpickle_MPolynomialRing_libsingular (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:19177)
  File "/usr/lib/python3.9/site-packages/sage/rings/polynomial/", line 777, in _multi_variate
    R = MPolynomialRing_libsingular(base_ring, n, names, order)
  File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 384, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular.__init__ (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:5668)
  File "sage/libs/singular/ring.pyx", line 167, in sage.libs.singular.ring.singular_ring_new (build/cythonized/sage/libs/singular/ring.cpp:3856)
AttributeError: 'TermOrder' object has no attribute '_singular_ringorder_column'
edit retag flag offensive close merge delete


Could you please provide the whole code so that we can reproduce ?

tmonteil gravatar imagetmonteil ( 2021-07-17 23:41:10 +0200 )edit