b45ch1 / algopy

AlgoPy is a Research Prototype for Algorithmic Differentation in Python
79 stars 14 forks source link

Algopy needs an easy update to sync with current numpy releases #56

Closed nicholasferguson closed 3 months ago

nicholasferguson commented 3 months ago

This is my dev environment
Python 3.11 Windows 10 numpy 1.26.4
algopy 0.5.7

In init.py for algopy you can comment out

testing

from numpy.testing import Tester
test = Tester().test

Because numpy (1.26.4) no longer has Tester. This code thus fails

====
Impact when fails

import doctest
import numdifftools as nd
nd.test('--doctest-modules', '--disable-warnings')

This nd.test fails ===== Because numdifftools, nd_algopy.py has this code

try:
import algopy
from algopy import UTPM
except ImportError:
UTPM = algopy = None

since import algopy currently fails, UTPM == None.... and tests fails
==== Though to run successfully that test, another correction is needed in NUMPY

numpy\lib\function_base.py line 4276 has to be commented out.
if a.dtype.kind == "c":
raise TypeError("a must be an array of real numbers")
========RESULT========
nd.test('--doctest-modules', '--disable-warnings')
=============== 164 passed, 8 skipped, 1369 warnings in 42.86s ================

I am still pondering how to present this issue to Numpy.... it appears complicated

b45ch1 commented 3 months ago

I uploaded a new version https://pypi.org/project/algopy/0.6.0/. Please test and let me know if it does not work.