MCLF / henselization

Generic Completions/Henselizations in Sage
GNU General Public License v2.0
6 stars 1 forks source link

ticket 24934 appears again in Sage-10.1 #46

Closed YijunYuan closed 11 months ago

YijunYuan commented 12 months ago
sage: import henselization
Your installation of Sage has a known issue: https://trac.sagemath.org/ticket/24934. We tried to install a workaround for this problem but failed to do so. Please make sure that you are using the latest stable version of Sage. If you are using the latest stable version of Sage already, please report this issue at https://github.com/MCLF/henselization/issues including the traceback below.
Traceback (most recent call last):
  File "/home/yijunyuan/sage-10.1/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/henselization-0.0.0-py3.11.egg/henselization/monkey/util.py", line 91, in patch
    self._patch()
  File "/home/yijunyuan/sage-10.1/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/henselization-0.0.0-py3.11.egg/henselization/monkey/trac_24934.py", line 30, in _patch
    del sage.rings.number_field.order.AbsoluteOrder.__reduce__
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AbsoluteOrderFactory' object has no attribute '__reduce__'
saraedum commented 11 months ago

Without importing henselization, does this return True for you?

K = QuadraticField(-1, 'i')
loads(dumps(K.maximal_order())) is K.maximal_order()

It does for me with Sage 10.1. So I don't understand how this is possible.

YijunYuan commented 11 months ago

Without importing henselization, does this return True for you?

K = QuadraticField(-1, 'i')
loads(dumps(K.maximal_order())) is K.maximal_order()

It does for me with Sage 10.1. So I don't understand how this is possible.

Yes, it returns True for me.

I rebuilt Sage 10.1 to make the environment clean. Here are some tests, all of which start with a fresh startup of Sage 10.1:

test 1

sage: import henselization
Your installation of Sage has a known issue: https://trac.sagemath.org/ticket/24934. We tried to install a workaround for this problem but failed to do so. Please make sure that you are using the latest stable version of Sage. If you are using the latest stable version of Sage already, please report this issue at https://github.com/MCLF/henselization/issues including the traceback below.
Traceback (most recent call last):
  File "/home/yijunyuan/sage-10.1/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/henselization/monkey/util.py", line 91, in patch
    self._patch()
  File "/home/yijunyuan/sage-10.1/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/henselization/monkey/trac_24934.py", line 30, in _patch
    del sage.rings.number_field.order.AbsoluteOrder.__reduce__
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AbsoluteOrderFactory' object has no attribute '__reduce__'

test 2

sage: from henselization import *
Your installation of Sage has a known issue: https://trac.sagemath.org/ticket/24934. We tried to install a workaround for this problem but failed to do so. Please make sure that you are using the latest stable version of Sage. If you are using the latest stable version of Sage already, please report this issue at https://github.com/MCLF/henselization/issues including the traceback below.
Traceback (most recent call last):
  File "/home/yijunyuan/sage-10.1/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/henselization/monkey/util.py", line 91, in patch
    self._patch()
  File "/home/yijunyuan/sage-10.1/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/henselization/monkey/trac_24934.py", line 30, in _patch
    del sage.rings.number_field.order.AbsoluteOrder.__reduce__
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AbsoluteOrderFactory' object has no attribute '__reduce__'

test 3

sage: K = QuadraticField(-1, 'i')
sage: loads(dumps(K.maximal_order())) is K.maximal_order()
True

Additional information:

How do I install henselization?

wget https://github.com/MCLF/henselization/archive/refs/heads/master.zip

then

./sage --pip install master.zip
Processing ./master.zip
  Preparing metadata (setup.py) ... done
Collecting patchy
  Downloading patchy-2.8.0-py3-none-any.whl (9.7 kB)
Collecting recursive-monkey-patch==0.3.0
  Downloading recursive_monkey_patch-0.3.0-py2.py3-none-any.whl (7.8 kB)
Building wheels for collected packages: henselization
  Building wheel for henselization (setup.py) ... done
  Created wheel for henselization: filename=henselization-0.0.0-py3-none-any.whl size=49342 sha256=1d77e17169da0060aed42768c46643d49e998f99bc4756de54f5279bd6352539
  Stored in directory: /tmp/pip-ephem-wheel-cache-crr_lhrx/wheels/75/66/a4/1fd471f261c84d7ac64dd21aa69e1e63e68a25a145be45c479
Successfully built henselization
Installing collected packages: recursive-monkey-patch, patchy, henselization
Successfully installed henselization-0.0.0 patchy-2.8.0 recursive-monkey-patch-0.3.0

System?

OS: Ubuntu 23.10 on Windows 10 x86_64 Kernel: 5.15.90.1-microsoft-standard-WSL2 CPU: 13th Gen Intel i9-13980HX (32) @ 2.419GHz

saraedum commented 11 months ago

That's really bizarre, the system should detect that there is no need to patch here.

A stupid workaround is to do:

sage: QuadraticField(-1, 'i').maximal_order()
Gaussian Integers in Number Field in i with defining polynomial x^2 + 1 with i = 1*I
sage: import henselization

I don't understand yet, why this works.

saraedum commented 11 months ago

Fixed in #47.