Releases: SDXorg/pysd
Releases · SDXorg/pysd
3.10.0
New Features
- Parse TABBED ARRAYS Vensim function. (@rogersamso)
- Add support for Vensim’s POWER function. (@rogersamso)
- Add possibility to pass data_files in netCDF format. (@rogersamso)
- Add support for XMILE’s non-negative flows and stocks. (@enekomartinmartinez)
- Add support for XMILE’s MIN and MAX functions with one argument. (@enekomartinmartinez)
Bug fixes
- Set the final_subscripts to an empty dictionary for ELMCOUNT function in pysd.builders.python_exressions_builder.CallBuilder.build_function_call(). (@rogersamso)
- Define comp_subtype of Unchangeable tabbed arrays as Unchangeable. This is done in pysd.builders.python.python_expressions_builder.ArrayBuilder.build(). (@rogersamso)
Documentation
- Add information about slack channel https://slofile.com/slack/sdtoolsandmet-slj3251. (@enekomartinmartinez)
- Update XMILE stocks section. (@enekomartinmartinez)
Internal Changes
- Add a weekly scheduled run to all CI workflows, which run each Monday at 06:00 UTC. (@EwoutH)
- Fix CI pipeline for Python 3.11 and remove Python 3.10 pipeline in favour of 3.11. (@kinow)
- Add non_negative argument in[pysd.translators.structures.abstract_expressions.IntegStructure. (@enekomartinmartinez)
3.9.1
New Features
- Add numpy.py as translation for the call to the function PI(). (@lionel42)
Bug fixes
- Set numpy <1.24 to avoid errors with least squares equation in pysd.py_backend.allocation.allocate_available(). (@enekomartinmartinez)
- Keep the attributes of a component when using pysd.py_backend.model.Macro.set_components() to avoid losing coords or arguments information. (@enekomartinmartinez)
- Set openpyxl <3.1 to avoid errors due to non-backwards compatible changes. (@enekomartinmartinez)
- Include time dependency in random functions to avoid them using constant cache. (@enekomartinmartinez)
Internal Changes
- Run test for Python 3.11 with ubuntu-latest (hdf5-headers need to be installed using apt manager). (@enekomartinmartinez)
3.9.0
New Features
- Parses and ignores reality check functions during translation of Vensim models. (@rogersamso)
Bug fixes
- Fix issue with the classification of variables in modules and submodules (issue #388). When a model had a view with 3 sublevels (e.g. energy-transformation.losses) but another view was defined with only two of them (e.g. energy-transformation), the variables in the second view were placed in the main model file. Now, if this happens, the variables in the second view will be placed in a main.py file (i.e. energy/transformation/main.py). (@rogersamso)
- Fix bug on the CLI when passing a hyphen as first value to the –subview-sep argument (issue #388). (@rogersamso)
- Fix bug on the CLI when parsing initial conditions ([ssue #395). (@rogersamso)
Documentation
- The Splitting Vensim views in different files section in Command Line Usage has been updated to include an example of the usage of the –subview-sep CLI argument. (@rogersamso)
Internal Changes
- The _merge_nested_dicts() method from the pysd.translators.vensim.vensim_file.VensimFile class has been made a static method, as it does not need to access any attribute of the instance, and it does facilitate unit testing. (@rogersamso)
- The pysd/translators/vensim/parsing_grammars/element_object.peg grammar has been modified to be able to parse reality check elements. (@rogersamso)
- pysd.translators.vensim.vensim_element.Constraint and pysd.translators.vensim.vensim_element.TestInputs classes have been added, which inherit from the also newly created pysd.translators.vensim.vensim_element.GenericComponent, which include the parse() and get_abstract_component() methods. (@rogersamso and @enekomartinmartinez)
- The pysd.translators.structures.abstract_model.AbstractSection class now has two extra attributes (constraints and input_tests), which hold the pysd.translators.structures.abstract_model.AbstractConstraint and pysd.translators.structures.abstract_model.AbstractTestInputs objects. (@rogersamso)
3.8.0
New Features
- Adds ncfile.py module with helper functions to export a subset or all of the data_vars in netCDF files generated with PySD to pandas.DataFrame, csv or tab files. (@rogersamso)
- Adds possibility to initialize and export a subset or all external objects to netCDF, and then initialize the external objects from the file. (@rogersamso)
Deprecations
- Deprecate pysd.py_backend.model.Model._get_dependencies() replacing it with pysd.py_backend.model.Model.get_dependencies(). (@enekomartinmartinez)
Bug fixes
- Include new class pysd.py_backend.utils.Dependencies to return by pysd.py_backend.model.Model.get_dependencies() (issue #379). (@lionel42)
Documentation
- Updates the Getting Started page with instructions on how to use the new helper functions for netCDF files. (@rogersamso)
- Updates the Advanced Usage page with instructions on how to export externals to netCDF and initialize a model from it. (@rogersamso)
- Update citation information to include the new paper published in JOSS. (@enekomartinmartinez)
Performance
- Initializing external objects from netCDF file is much faster than reading from spreadsheet files.(@rogersamso)
Internal Changes
- Adds the pysd.py_backend.model.Macro.serialize_externals() and pysd.py_backend.model.Macro.initialize_external_data() methods, and a few other private methods.(@rogersamso)
- Adds the pysd.py_backend.utils.UniqueDims class for renaming model dimensions with unique names.(@rogersamso)
- Force pysd.py_backend.external.External objects to always have the full element dimensions, missing dimensions are filled with numpy.nan. (@enekomartinmartinez)
- Add dependabot configuration for GitHub Actions updates. (@EwoutH)
- Include new error messages for initialization of pysd.py_backend.lookups.HardcodedLookups (issue #376). (@enekomartinmartinez)
- Include new warning message when a translated variable has several types or subtypes. (@enekomartinmartinez)
- Set CI test to run in parallel in 2 cores. (@enekomartinmartinez)
3.7.1
Bug fixes
- Fix bugs with
pandas
release 1.5.0.
3.7.0
New Features
- Simulation results can now be stored as netCDF4 files. (@rogersamso)
- The CLI also accepts netCDF4 file paths after the -o argument. (@rogersamso)
Bug fixes
- Fix bug when a WITH LOOKUPS argument has subscripts. (@enekomartinmartinez)
- Fix bug of exportig csv files with multiple subscripts variables. (@rogersamso)
- Fix bug of missing dimensions in variables defined with not all the subscripts of a range (issue #364). (@enekomartinmartinez)
- Fix bug when running a model with variable final time or time step and progressbar (issue #361). (@enekomartinmartinez)
Documentation
- Add Storing simulation results on a file section in the Getting Started page. (@rogersamso)
- Include cookbook information in the Getting Started page. (@enekomartinmartinez)
- Include an introduction of main historical changes in the About the Project page. (@enekomartinmartinez)
Performance
- Exporting outputs as netCDF4 is much faster than exporting a pandas DataFrame, especially for large models. (@rogersamso)
Internal Changes
- Make PySD work with parsimonius 0.10.0. (@enekomartinmartinez)
- Add netCDF4 dependency for tests. (@rogersamso)
- Improve warning message when replacing a stock with a parameter. (@enekomartinmartinez)
- Include more pytest parametrizations in some test and make them translate the models in temporary directories. (@enekomartinmartinez)
- Include lychee-action in the GHA workflow to check the links. (@enekomartinmartinez)
- Update License. (@enekomartinmartinez)
- Include Maintained? Yes and Contributions welcome badges. (@enekomartinmartinez)
- Update links to the new repository location. (@enekomartinmartinez)
- Reduce relative precision from 1e-10 to 1e-5 to compute the saving times and final time. (@enekomartinmartinez)
- Add convergence tests for Euler integration method. (@enekomartinmartinez)
- Include build docs check in the GHA workflow to avoid warnings with sphinx. (@enekomartinmartinez)
3.6.1
Internal Changes
- Set
parsimonius
requirement to 0.9.0 to avoid a breaking change in the newest version. Pending to update PySD to run it withparsimonious
0.10.0.
3.6.0
New Features
- Include warning messages when a variable is defined in more than one view, when a control variable appears in a view or when a variable doesn’t appear in any view as a workbench variable (issue #357).
- Force variables in a module to be saved alphabetically for being able to compare differences between versions (only for the models that are split by views).
Bug fixes
- Classify control variables in the main file always (issue #357).
Internal Changes
- Include pysd.translators.structures.abstract_model.AbstractControlElement child of pysd.translators.structures.abstract_model.AbstractElement to differentiate the control variables.
3.5.2
Bug fixes
- Make sketch's font_size optional.
Documentation
- Correct typos.
3.5.1
Bug fixes
- Fix bug generated when :EXCEPT: keyword is used with subscript subranges (#352).
- Fix bug of precision error for pysd.py_backend.allocation.allocate_by_priority() (#353).
- Fix bug of constant cache assignment.
Performance
- Improve the performance of reading pysd.py_backend.external.External data with cellrange names by loading the data in memory with pandas. As recommended by openpyxl 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).