Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
1.9k stars 490 forks source link

Tests fail: RecursionError: maximum recursion depth exceeded in comparison #3274

Closed yurivict closed 1 month ago

yurivict commented 1 month ago

Summary

cd /usr/ports/math/py-Pyomo/work-py39/pyomo-6.7.2 && /usr/bin/env -i HOME=/usr/ports/math/py-Pyomo/work-py39  PWD="${PWD}"  __MAKE_CONF=/nonexistent OSVERSION=1401500 PATH=/usr/local/libexec/ccache:/usr/ports/math/py-Pyomo/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin TERM=xterm-256color XDG_DATA_HOME=/usr/ports/math/py-Pyomo/work-py39  XDG_CONFIG_HOME=/usr/ports/math/py-Pyomo/work-py39  XDG_CACHE_HOME=/usr/ports/math/py-Pyomo/work-py39/.cache  HOME=/usr/ports/math/py-Pyomo/work-py39 PATH=/usr/local/libexec/ccache:/usr/ports/math/py-Pyomo/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/math/py-Pyomo/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES LDSHARED="cc -shared" PYTHONDONTWRITEBYTECODE= PYTHONOPTIMIZE= PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" /usr/local/bin/python3.9 -m pytest -k '' -rs -v -o addopts= 
==================================================================================== test session starts ====================================================================================
platform freebsd14 -- Python 3.9.19, pytest-8.1.1, pluggy-1.5.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/usr/ports/math/py-Pyomo/work-py39/pyomo-6.7.2/.hypothesis/examples'))
Using --randomly-seed=78011075
rootdir: /usr/ports/math/py-Pyomo/work-py39/pyomo-6.7.2
configfile: setup.cfg
plugins: anyio-4.3.0, hypothesis-6.98.18, datadir-1.5.0, cov-4.1.0, randomly-3.12.0, timeout-2.1.0, time-machine-2.11.0, rerunfailures-11.1.2, flaky-3.8.1, forked-1.6.0, aspectlib-2.0.0, xdist-3.5.0, env-0.6.2, mock-3.10.0, parallel-0.1.1
collected 16709 items / 2 errors / 21 skipped                                                                                                                                               

========================================================================================== ERRORS ===========================================================================================
____________________________________________________________ ERROR collecting pyomo/contrib/viewer/tests/test_data_model_item.py ____________________________________________________________
pyomo/contrib/viewer/tests/test_data_model_item.py:51: in <module>
    x = pyo.units.m
pyomo/core/base/units_container.py:1084: in __getattr__
    pint_registry = self._pint_registry
pyomo/core/base/units_container.py:1084: in __getattr__
    pint_registry = self._pint_registry
pyomo/core/base/units_container.py:1084: in __getattr__
    pint_registry = self._pint_registry
E   RecursionError: maximum recursion depth exceeded in comparison
!!! Recursion detected (same locals & position)
____________________________________________________________ ERROR collecting pyomo/contrib/viewer/tests/test_data_model_tree.py ____________________________________________________________
pyomo/contrib/viewer/tests/test_data_model_tree.py:47: in <module>
    _x = pyo.units.m
pyomo/core/base/units_container.py:1084: in __getattr__
    pint_registry = self._pint_registry
pyomo/core/base/units_container.py:1084: in __getattr__
    pint_registry = self._pint_registry
pyomo/core/base/units_container.py:1084: in __getattr__
    pint_registry = self._pint_registry
E   RecursionError: maximum recursion depth exceeded in comparison
!!! Recursion detected (same locals & position)
================================================================================== short test summary info ==================================================================================
SKIPPED [1] pyomo/contrib/appsi/solvers/tests/test_gurobi_persistent.py:24: unittest.case.SkipTest
SKIPPED [1] pyomo/contrib/appsi/solvers/tests/test_highs_persistent.py:26: unittest.case.SkipTest
SKIPPED [1] pyomo/contrib/interior_point/tests/test_inverse_reduced_hessian.py:32: unittest.case.SkipTest: inverse_reduced_hessian tests require numpy, scipy, and asl
SKIPPED [1] pyomo/contrib/interior_point/tests/test_realloc.py:30: unittest.case.SkipTest: Regularization tests require ASL
SKIPPED [1] pyomo/contrib/interior_point/tests/test_reg.py:33: unittest.case.SkipTest: Regularization tests require ASL
SKIPPED [1] pyomo/contrib/pynumero/algorithms/solvers/tests/test_cyipopt_interfaces.py:29: unittest.case.SkipTest: Pynumero needs the ASL extension to run CyIpoptSolver tests
SKIPPED [1] pyomo/contrib/pynumero/algorithms/solvers/tests/test_cyipopt_solver.py:31: unittest.case.SkipTest: Pynumero needs the ASL extension to run CyIpoptSolver tests
SKIPPED [1] pyomo/contrib/pynumero/algorithms/solvers/tests/test_implicit_functions.py:40: unittest.case.SkipTest: PyNumero ASL extension is necessary to test implicit function solvers
SKIPPED [1] pyomo/contrib/pynumero/algorithms/solvers/tests/test_pyomo_ext_cyipopt.py:30: unittest.case.SkipTest: Pynumero needs the ASL extension to run CyIpoptSolver tests
SKIPPED [1] pyomo/contrib/pynumero/examples/tests/test_cyipopt_examples.py:44: unittest.case.SkipTest: Pynumero needs the ASL extension to run CyIpopt tests
SKIPPED [1] pyomo/contrib/pynumero/examples/tests/test_examples.py:23: unittest.case.SkipTest: Pynumero examples need ASL
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_cyipopt_interface.py:28: unittest.case.SkipTest: Pynumero needs the ASL extension to run CyIpopt tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_dynamic_model.py:31: unittest.case.SkipTest: Pynumero needs the ASL extension to run CyIpoptSolver tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_external_asl_function.py:25: unittest.case.SkipTest: Pynumero needs the ASL extension to run NLP tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_external_grey_box_model.py:30: unittest.case.SkipTest: Pynumero needs the ASL extension to run cyipopt tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_external_pyomo_block.py:33: unittest.case.SkipTest: Pynumero needs the ASL extension to run cyipopt tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_external_pyomo_model.py:31: unittest.case.SkipTest: Pynumero needs the ASL extension to run cyipopt tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_nlp.py:28: unittest.case.SkipTest: Pynumero needs the ASL extension to run NLP tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_nlp_projections.py:27: unittest.case.SkipTest: Pynumero needs the ASL extension to run NLP tests
SKIPPED [1] pyomo/contrib/pynumero/interfaces/tests/test_pyomo_grey_box_nlp.py:30: unittest.case.SkipTest: Pynumero needs the ASL extension to run cyipopt tests
SKIPPED [1] pyomo/contrib/solver/tests/solvers/test_gurobi_persistent.py:21: unittest.case.SkipTest
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================== 21 skipped, 2 errors in 22.60s ===============================================================================
*** Error code 2

Version: 6.7.2 Python-3.9 FreeBSD 14.0

jsiirola commented 1 month ago

I have been unable to reproduce this. It almost looks like the UnitsContainer.__init__() is never being called. Can you provide more information about your environment?