OpenABM-Covid19
OpenABM-Covid19 copied to clipboard
Fixed Pandas v2 issues and updated python to a supported version
Moved to Python 3.8.17 minimum Tests pass against 3.8, 3.9, 3.10 Dockerfile updated to allow python version to be injected requirements.txt updated for current versions of libraries on python 3.8.17 Signed-off-by: Adam Fowler [email protected]
Tests pass on python 3.8, 3.9, 3.10 with the following warnings:-
==================================================================================== warnings summary =====================================================================================
tests/test_infection_dynamics.py::TestClass::test_introduce_new_strain[1-test_params0]
/usr/local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but tests/test_infection_dynamics.py::TestClass::test_introduce_new_strain[1-test_params0] returned [17132, 27], which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`?
warnings.warn(
tests/test_infection_dynamics.py::TestClass::test_introduce_new_strain[0-test_params1]
/usr/local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but tests/test_infection_dynamics.py::TestClass::test_introduce_new_strain[0-test_params1] returned [17132, 17059], which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`?
warnings.warn(
tests/adapter_covid19/test_gdp_models.py::TestClass::test_optimiser
/usr/local/lib/python3.10/site-packages/adapter_covid19/gdp.py:1001: DeprecationWarning: `method='interior-point'` is deprecated and will be removed in SciPy 1.11.0. Please use one of the HiGHS solvers (e.g. `method='highs'`) in new code.
r = linprog(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================= 308 passed, 3 warnings in 922.04s (0:15:22) =======================================================================
Python 3.11 has the below errors:-
__________________________________________________________________ ERROR collecting tests/adapter_covid19/test_personal_bankruptcy_models.py __________________________________________________________________
/usr/local/lib/python3.11/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
/usr/local/lib/python3.11/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/local/lib/python3.11/site-packages/_pytest/python.py:531: in collect
self._inject_setup_module_fixture()
/usr/local/lib/python3.11/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
/usr/local/lib/python3.11/site-packages/_pytest/python.py:310: in obj
self._obj = obj = self._getobj()
/usr/local/lib/python3.11/site-packages/_pytest/python.py:528: in _getobj
return self._importtestmodule()
/usr/local/lib/python3.11/site-packages/_pytest/python.py:617: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/local/lib/python3.11/site-packages/_pytest/pathlib.py:565: in import_path
importlib.import_module(module_name)
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
???
<frozen importlib._bootstrap>:1176: in _find_and_load
???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:690: in _load_unlocked
???
/usr/local/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
tests/adapter_covid19/test_personal_bankruptcy_models.py:9: in <module>
from adapter_covid19.personal_insolvency import PersonalBankruptcyModel
/usr/local/lib/python3.11/site-packages/adapter_covid19/personal_insolvency.py:9: in <module>
from adapter_covid19.data_structures import (
/usr/local/lib/python3.11/site-packages/adapter_covid19/data_structures.py:634: in <module>
@dataclass
/usr/local/lib/python3.11/dataclasses.py:1230: in dataclass
return wrap(cls)
/usr/local/lib/python3.11/dataclasses.py:1220: in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
/usr/local/lib/python3.11/dataclasses.py:958: in _process_class
cls_fields.append(_get_field(cls, name, type, kw_only))
/usr/local/lib/python3.11/dataclasses.py:815: in _get_field
raise ValueError(f'mutable default {type(f.default)} for field '
E ValueError: mutable default <class 'adapter_covid19.data_structures.ModelParams'> for field model_params is not allowed: use default_factory
=========================================================================================== short test summary info ===========================================================================================
ERROR tests/adapter_covid19/test_corporate_bankruptcy_models.py - ValueError: mutable default <class 'adapter_covid19.data_structures.ModelParams'> for field model_params is not allowed: use default_factory
ERROR tests/adapter_covid19/test_data_structures.py - ValueError: mutable default <class 'adapter_covid19.data_structures.ModelParams'> for field model_params is not allowed: use default_factory
ERROR tests/adapter_covid19/test_economics.py - ValueError: mutable default <class 'adapter_covid19.data_structures.ModelParams'> for field model_params is not allowed: use default_factory
ERROR tests/adapter_covid19/test_gdp_models.py - ValueError: mutable default <class 'adapter_covid19.data_structures.ModelParams'> for field model_params is not allowed: use default_factory
ERROR tests/adapter_covid19/test_personal_bankruptcy_models.py - ValueError: mutable default <class 'adapter_covid19.data_structures.ModelParams'> for field model_params is not allowed: use default_factory
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 5 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================== 5 errors in 1.54s ==============================================================================================