New in this release
SdePy was upgraded to the current NumPy pseudo-random numbers generation
framework, based on the PCG-64 algorithm (#33, #35, #38, #40).
The following additions were made:
-
SDEs and stochasticity source classes now accept upon instantiation
a new optional parameterrng
, to locally set the
random number generator used by each instance.
Suchrng
is expected to expose the interface
used bynumpy.random.Generator
andnumpy.random.RandomState
instances. -
In case no
rng
parameter is given, random number generation
is delegated to a globalnumpy.random.default_rng()
object,
created upon import: absent any user intervention,
unmodified pre-existing code will rely on PCG-64
random number generation after upgrading to current
NumPy and SdePy releases. -
To access the stably reproducible NumPy legacy random generation,
it is recommended to instantiate sources and SDEs with the
rng=numpy.random.RandomState(SEED)
parameter. As a result,
each object is served the random numbers stream formerly obtained
from the global NumPy random state after anumpy.random.seed(SEED)
call. -
Compatibility with legacy NumPy versions was maintained, if now deprecated:
in such case, SdePy silently falls back on the legacy global NumPy random state.
The present SdePy version safeguards functional compatibility with
code written for previous versions, note however that, if such code is run
with current NumPy and SdePy versions, it will
break pseudo-random numbers reproducibility:
-
numpy.random.seed
calls no longer affect SdePy objects. -
To reproduce the default output of former SdePy versions,
numpy.random.seed(SEED)
statements may be replaced
with the following assignment:sdepy.infrastructure.default_rng = numpy.random.RandomState(SEED)
Any other use of such global variable should rather be avoided,
in favor of therng
keyword.
Improvements
The testing suite was updated, and its interface sdepy.test()
extended,
for use beyond NumPy legacy random generation;
GitHub Actions were updated accordingly, to perform CI tests using
both legacy and current NumPy random generation (#36, #37).
Changes
Python 3.5 is no longer supported (#39, #41).
Checksums
MD5
31a9dc7d4233ac3ec6fa910e81f370f6 sdepy-1.2.0-py3-none-any.whl
bb5c233606eb69a77e6ed9397d8732b8 sdepy-1.2.0.tar.gz