What’s New¶
v3.5.2 (2022/08/15)¶
New Features¶
Breaking changes¶
Deprecations¶
Bug fixes¶
Make sketch’s _font_size_ optional.
Documentation¶
Correct typos.
Performance¶
Internal Changes¶
v3.5.1 (2022/08/11)¶
New Features¶
Breaking changes¶
Deprecations¶
Bug fixes¶
Fix bug generated when :EXCEPT: keyword is used with subscript subranges (issue #352).
Fix bug of precision error for
pysd.py_backend.allocation.allocate_by_priority()
(issue #353).Fix bug of constant cache assignment.
Documentation¶
Performance¶
Improve the performance of reading
pysd.py_backend.external.External
data with cellrange names by loading the data in memory withpandas
. As recommended byopenpyxl
developers, this is a possible way of improving performance to avoid parsing all rows up each time for getting the data (issue 1867 in openpyxl).
Internal Changes¶
v3.5.0 (2022/07/25)¶
New Features¶
Add support for subscripted arguments in
pysd.py_backend.functions.ramp()
andpysd.py_backend.functions.step()
(issue #344).
Breaking changes¶
Deprecations¶
Bug fixes¶
Fix bug related to the order of elements in 1D GET expressions (issue #343).
Fix bug in request 0 values in allocate by priority (issue #345).
Fix a numerical error in starting time of step and ramp.
Documentation¶
Include new PySD logo.
Performance¶
Internal Changes¶
Ignore ‘distutils Version classes are deprecated. Use packaging.version instead’ error in tests as it is an internal error of xarray.
Add a warning message when a subscript range is duplicated in a variable reference.
v3.4.0 (2022/06/29)¶
New Features¶
Add support for Vensim’s ALLOCATE AVAILABLE (
pysd.py_backend.allocation.allocate_available()
) function (issue #339). Integer allocation cases have not been implemented neither the fixed quantity and constant elasticity curve priority functions.
Breaking changes¶
Deprecations¶
Bug fixes¶
Documentation¶
Improve the documentation of the
pysd.py_backend.allocation
module.
Performance¶
Internal Changes¶
Add a class to manage priority profiles so it can be also used by the many-to-many allocation.
v3.3.0 (2022/06/22)¶
New Features¶
Add support for Vensim’s ALLOCATE BY PRIORITY (
pysd.py_backend.allocation.allocate_by_priority()
) function (issue #263).
Breaking changes¶
Deprecations¶
Bug fixes¶
Fix bug of using subranges to define a bigger range (issue #335).
Documentation¶
Performance¶
Internal Changes¶
Improve error messages for
pysd.py_backend.External
objects.
v3.2.0 (2022/06/10)¶
New Features¶
Add support for Vensim’s GET TIME VALUE (
pysd.py_backend.functions.get_time_value()
) function (issue #332). Not all cases have been implemented.Add support for Vensim’s VECTOR SELECT (
pysd.py_backend.functions.vector_select()
) function (issue #266).
Breaking changes¶
Deprecations¶
Bug fixes¶
Documentation¶
Performance¶
Internal Changes¶
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.