From 3b5ca2ad8a56d629049107b12ac88ff2fa446486 Mon Sep 17 00:00:00 2001
From: PeterMeisrimelModelon
<92585725+PeterMeisrimelModelon@users.noreply.github.com>
Date: Wed, 17 Jan 2024 10:13:17 +0100
Subject: [PATCH] Updating docs and various READMEs; Various cleanup
---
CHANGELOG | 3 ++-
INSTALL | 4 ++--
doc/sphinx/source/changelog.rst | 17 +++++++++++++++++
doc/sphinx/source/installation.rst | 8 ++++----
setup.cfg | 6 +++---
setup.py | 20 ++++++--------------
src/lib/sundials_includes.pxd | 6 ++----
src/solvers/radar5.py | 3 ---
8 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index c1f9039e..f368f58c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,8 @@
--- CHANGELOG ---
---- Assimulo-3.4.4 ---
+--- Assimulo-3.5.0 ---
* Changed "numpy.float" to equivalent "numpy.float64" due to DeprecationWarnings in numpy >= 1.20.
* Improved examples with sparse jacobians by omitting the zeros in the jacobians.
+ * Upgraded to Cython >= 3.
--- Assimulo-3.4.3 ---
* Improved compliance with newer scipy version by instead using corresponding numpy calls when more suitable.
diff --git a/INSTALL b/INSTALL
index 18401e59..7a47af45 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,10 +6,10 @@ INSTALL
=======
*REQUIREMENTS
- - Python-2.7/3.* (with headers)
+ - Python-3 (with headers)
- Numpy, Scipy, Pylab
- Sundials-2.5/2.6/3.1/4.1
- - Cython >= 0.18
+ - Cython >= 3
- C-compiler
- Fortran-compiler
- BLAS
diff --git a/doc/sphinx/source/changelog.rst b/doc/sphinx/source/changelog.rst
index fa714848..cdecb4bf 100644
--- a/doc/sphinx/source/changelog.rst
+++ b/doc/sphinx/source/changelog.rst
@@ -3,6 +3,23 @@
Changelog
==========
+--- Assimulo-3.5.0 ---
+ * Changed "numpy.float" to equivalent "numpy.float64" due to DeprecationWarnings in numpy >= 1.20.
+ * Improved examples with sparse jacobians by omitting the zeros in the jacobians.
+ * Upgraded to Cython >= 3.
+
+--- Assimulo-3.4.3 ---
+ * Improved compliance with newer scipy version by instead using corresponding numpy calls when more suitable.
+
+--- Assimulo-3.4.2 ---
+ * Updated an import statement in one of the examples to resolve compliance issues with scipy 1.10.1.
+
+--- Assimulo-3.4.1 ---
+ * Restored functionality of CVode with 'external_event_detection' = True, which broke with 3.4.0.
+ * CVode now allows rtol = 0.
+ * Added support for CVode (without sensitivities) with non-negative relative tolerance vector.
+ Requires a SUNDIALS installation supporting this, see README.
+
--- Assimulo-3.4.0 ---
* Removed Radau5ODE Fortran implementation.
This change should be seamless since the C implementation is numerically equivalent.
diff --git a/doc/sphinx/source/installation.rst b/doc/sphinx/source/installation.rst
index 34d343a3..756bf565 100644
--- a/doc/sphinx/source/installation.rst
+++ b/doc/sphinx/source/installation.rst
@@ -6,16 +6,16 @@ Installation
Dependencies:
-- `Python-2.7 / 3.* `_
-- `Numpy `_ (>1.6.1 for the solver DASP3)
+- `Python-3 `_
+- `Numpy `_
- `Scipy `_
- `Pylab `_
Additional dependencies for compiling from source:
-- `Python-2.7 / 3.* `_ with headers (python-dev package for Ubuntu)
+- `Python-3 `_ with headers (python-dev package for Ubuntu)
- `Sundials-2.6/2.7/3.1/4.1 `_ (for 64bits machines, install Sundials using -fPIC)
-- `Cython 0.18 `_
+- `Cython 3.0.7 `_
- C compiler
- Fortran compiler
- BLAS (only needed for the solver GLIMDA)
diff --git a/setup.cfg b/setup.cfg
index a7ba0b3c..35115544 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,13 +1,13 @@
[options]
setup_requires =
setuptools
- numpy >= 1.17
+ numpy >= 1.26.3
cython >= 3.0.7
install_requires =
python >= 3.11
- numpy >= 1.17
- scipy >= 1.3
+ numpy >= 1.26.3
+ scipy >= 1.11.4
cython >= 3.0.7
nose >= 1.3.7
matplotlib > 3
diff --git a/setup.py b/setup.py
index b9faff1a..ff29c7a5 100644
--- a/setup.py
+++ b/setup.py
@@ -77,18 +77,18 @@ def remove_prefix(name, prefix):
import numpy.distutils as nd
try:
- # from Cython.Distutils import build_ext ## TODO: obsolete?
+ from Cython.Distutils import build_ext
from Cython.Build import cythonize
except ImportError:
- msg="Please upgrade to a newer Cython version, >= 0.18."
+ msg="Please upgrade to a newer Cython version, >= 3"
logging.error(msg)
raise Exception(msg)
#Verify Cython version
import Cython
cython_version = Cython.__version__.split(".")
-if not (cython_version[0] > '0' or (cython_version[0] == '0' and cython_version[1] >= '18')):
- msg="Please upgrade to a newer Cython version, >= 0.18."
+if not cython_version[0] >= '3':
+ msg="Please upgrade to a newer Cython version, >= 3"
logging.error(msg)
raise Exception(msg)
@@ -661,14 +661,6 @@ def fortran_extensionlists(self):
change_dir = False
ext_list = prepare.cython_extensionlists()
-
-#MAJOR HACK DUE TO NUMPY CHANGE IN VERSION 1.6.2 THAT DOES NOT SEEM TO
-#HANDLE EXTENSIONS OF BOTH TYPE (DISTUTILS AND NUMPY DISTUTILS) AT THE
-#SAME TIME.
-for e in ext_list:
- e.extra_f77_compile_args = []
- e.extra_f90_compile_args = []
-
ext_list += prepare.fortran_extensionlists()
# distutils part
@@ -677,7 +669,7 @@ def fortran_extensionlists(self):
NAME = "Assimulo"
AUTHOR = u"C. Winther (Andersson), C. Führer, J. Åkesson, M. Gäfvert"
AUTHOR_EMAIL = "christian.winther@modelon.com"
-VERSION = "trunk" if version_number_arg == "Default" else version_number_arg
+VERSION = "3.5.0" if version_number_arg == "Default" else version_number_arg
LICENSE = "LGPL"
URL = "http://www.jmodelica.org/assimulo"
DOWNLOAD_URL = "http://www.jmodelica.org/assimulo"
@@ -709,7 +701,7 @@ def fortran_extensionlists(self):
http://www.jmodelica.org/assimulo .
The package requires Numpy, Scipy and Matplotlib and additionally for
-compiling from source, Cython 0.18, Sundials 2.6/2.7/3.1/4.1, BLAS and LAPACK
+compiling from source, Cython >=3, Sundials 2.6/2.7/3.1/4.1, BLAS and LAPACK
together with a C-compiler and a FORTRAN-compiler.
"""
diff --git a/src/lib/sundials_includes.pxd b/src/lib/sundials_includes.pxd
index 32d48935..5a2bc41b 100644
--- a/src/lib/sundials_includes.pxd
+++ b/src/lib/sundials_includes.pxd
@@ -24,8 +24,6 @@ see also Jon Olav Vik:
http://codespeak.net/pipermail/cython-dev/2009-June/005947.html
"""
-#import numpy as N
-#cimport numpy as N
from numpy cimport NPY_DOUBLE, npy_intp, NPY_INT
@@ -393,8 +391,8 @@ cdef extern from "cvodes/cvodes.h":
#Statistics
- int CVodeGetEstLocalErrors(void *cvode_mem, N_Vector ele) #Estimated local errors
- int CVodeGetErrWeights(void *cvode_mem, N_Vector eweight) #Estimated local errors
+ int CVodeGetEstLocalErrors(void *cvode_mem, N_Vector ele) #Estimated local errors
+ int CVodeGetErrWeights(void *cvode_mem, N_Vector eweight) #Estimated local errors
int CVodeGetSensNumRhsEvals(void *cvode_mem, long int *nfSevals)
int CVodeGetNumRhsEvalsSens(void *cvode_mem, long int *nfevalsS)
int CVodeGetSensNumErrTestFails(void *cvode_mem, long int *nSetfails)
diff --git a/src/solvers/radar5.py b/src/solvers/radar5.py
index dbc373f6..b0ce5119 100644
--- a/src/solvers/radar5.py
+++ b/src/solvers/radar5.py
@@ -736,9 +736,6 @@ def _get_rtol(self):
rtol=property(_get_rtol,_set_rtol)
def _get_grid(self):
- """
- TODO
- """
return self._grid
def _set_grid(self, grid):
self._grid