What’s New¶
v3.1.0 (2022/06/02)¶
New Features¶
Add support for Vensim’s VECTOR SORT ORDER (
pysd.py_backend.functions.vector_sort_order()
) function (issue #326).Add support for Vensim’s VECTOR RANK (
pysd.py_backend.functions.vector_rank()
) function (issue #326).Add support for Vensim’s VECTOR REORDER (
pysd.py_backend.functions.vector_reorder()
) function (issue #326).
Breaking changes¶
Deprecations¶
Bug fixes¶
Documentation¶
Add the section Adding new functions with examples for developers.
Performance¶
Internal Changes¶
Include a template for PR.
v3.0.1 (2022/05/26)¶
New Features¶
Breaking changes¶
Deprecations¶
Bug fixes¶
Simplify subscripts dictionaries for
pysd.py_backend.data.TabData
objects.
Documentation¶
Improve tests/README.md.
Minor improvements in the documentation.
Performance¶
Internal Changes¶
Add Python 3.10 to CI pipeline and include it in the supported versions list.
Correct LICENSE file extension in the setup.py.
Move from importlib’s
load_module()
toexec_module()
.Remove warnings related to
set
usage.Move all the missing test to
pytest
.Remove warning messages from test and make test fail if there is any warning.
v3.0.0 (2022/05/23)¶
New Features¶
The new Abstract Model Representation translation and building workflow will allow to add new output languages in the future.
Added new properties to the
pysd.py_backend.model.Macro
to make more accessible some information:namespace
,subscripts
,dependencies
,modules
,doc
.- Cleaner Python models:
_namespace
and_dependencies
dictionaries have been removed from the file.Variables original names, dependencies metadata now are given through
pysd.py_backend.components.Component.add()
decorator, instead of having them in the docstring.Merging of variable equations is now done using the coordinates to a pre-allocated array, instead of using the magic function
pysd.py_backend.utils.xrmerge()
.Arranging and subseting arrays are now done inplace instead of using the magic function
pysd.py_backend.utils.rearrange()
.
Breaking changes¶
Set the argument
flatten_output
fromrun()
toTrue
by default. Previously it was set toFalse
by default.Move the docstring of the model to a property,
doc
. Thus, it is not callable anymore.Allow the function
pysd.py_backend.functions.pulse()
to also perform the operations performed bypysd.py_backend.functions.pulse_train()
andpysd.py_backend.functions.pulse_magnitude()
.Change first argument of
pysd.py_backend.functions.active_initial()
, now it is the stage of the model and not the time.Simplify the function
pysd.py_backend.utils.rearrange()
orienting it to perform simple rearrange cases for user interaction.Move
pysd.py_backend.statefuls.Model
andpysd.py_backend.statefuls.Macro
topysd.py_backend.model.Model
andpysd.py_backend.model.Macro
, respectively.Manage all kinds of lookups with the
pysd.py_backend.lookups.Lookups
class.Include a second optional argument to lookups functions to set the final coordinates when a subscripted variable is passed as an argument.
Deprecations¶
Remove
pysd.py_backend.utils.xrmerge()
,pysd.py_backend.functions.pulse_train()
,pysd.py_backend.functions.pulse_magnitude()
,pysd.py_backend.functions.lookup()
,pysd.py_backend.functions.lookup_discrete()
,pysd.py_backend.functions.lookup_extrapolation()
,pysd.py_backend.functions.logical_and()
,pysd.py_backend.functions.logical_or()
,pysd.py_backend.functions.bounded_normal()
,pysd.py_backend.functions.log()
.Remove old translation and building files (
pysd.translation
).
Bug fixes¶
Generate the documentation of the model when loading it to avoid lossing information when replacing a variable value (issue #310, PR #312).
Make random functions return arrays of the same shape as the variable, to avoid repeating values over a dimension (issue #309, PR #312).
Fix bug when Vensim’s :MACRO: definition is not at the top of the model file (issue #306, PR #312).
Make builder identify the subscripts using a main range and subrange to allow using subscripts as numeric values as Vensim does (issue #296, issue #301, PR #312).
Fix bug of missmatching of functions and lookups names (issue #116, PR #312).
Parse Xmile models case insensitively and ignoring the new lines characters (issue #203, issue #253, PR #312).
Add support for Vensim’s :EXCEPT: keyword (issue #168, issue #253, PR #312).
Add spport for Xmile’s FORCST and SAFEDIV functions (issue #154, PR #312).
Add subscripts support for Xmile (issue #289, PR #312).
Fix numeric error bug when using
return_timestamps
and time step with non-integer values.
Documentation¶
Review the whole documentation, refract it, and describe the new features.
Performance¶
The variables defined in several equations are now assigned to a pre-allocated array instead of using
pysd.py_backend.utils.xrmerge()
.The arranging and subseting of arrays is now done inplace instead of using the magic function
pysd.py_backend.utils.rearrange()
.The grammars for Parsimonious are only compiled once per translation.
Internal Changes¶
The translation and the building of models has been totally modified to use the Abstract Model Representation.