Releases: SDXorg/pysd
3.5.0
New Features
- Add support for subscripted arguments in pysd.py_backend.functions.ramp() and pysd.py_backend.functions.step() (issue #344).
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.
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.
3.4.0
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.
Documentation
- Improve the documentation of the pysd.py_backend.allocation module.
3.3.0
New Features
- Add support for Vensim’s ALLOCATE BY PRIORITY (
pysd.py_backend.allocation.allocate_by_priority()
) function (issue #263).
Bug fixes
- Fix bug of using subranges to define a bigger range (issue #335).
Internal Changes
- Improve error messages for
pysd.py_backend.External
objects.
3.2.0
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).
3.1.0
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).
Documentation
- Add the section Adding new functions with examples for developers.
3.0.1
Including suggestions made by @blsqr:
Update development status to beta
Test now fail if there is any warning message
The tests that were still working with unittest have been moved to pytest
Test and add support for Python 3.10
Improve the test documentation
Move from SourceFileLoader.load_module() to importlib.util.spec_from_file_location.loader.exec_module() to avoid deprecation in Python 3.12
Correct some other warnings
Bug correction:
TabData objects' coordinates now are simplified in the model file, using the _subscript_dict as other objects.
3.0.0
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 from run() to True by default. Previously it was set to False 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 by pysd.py_backend.functions.pulse_train() and pysd.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 and pysd.py_backend.statefuls.Macro to pysd.py_backend.model.Model and pysd.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.
2.2.4
Update progressbar dependency to progressbar2
2.2.3
Solve bug when converting to floats 0-d dataarrays
2.2.2
Solve missing smile grammar in packages