- Fix initialization dependencies for :py
pysd.py_backend.statefuls.Smooth
in the builder :pypysd.builders.python.python_expressions_builder.SmoothBuilder
(440
). (@enekomartinmartinez)
- Improve documentation for :py
netCDF4
dependency. (@enekomartinmartinez)
- Support for Python 3.12. (@enekomartinmartinez)
- Support for :py
numpy
>= 1.24. (@enekomartinmartinez) - Correct some warnings management in the tests. (@enekomartinmartinez)
- Set :py
numpy
requirements to >= 1.23 to follow NEP29. (@enekomartinmartinez) - Custom error messages when :py
netCDF4
is missing (435
). (@enekomartinmartinez)
- Add support for XMILE's DELAY function through DelayFixed (
433
). (@enekomartinmartinez)
- Fix bug with :py
pysd.py_backend.output.ModelOutput
initializing all the handlers, and thus, importing netCDF4 when unnecessary (431
). (@enekomartinmartinez)
- Include new method :py
pysd.py_backend.model.Model.copy
which allows copying a model (131
). (@enekomartinmartinez) - :py
pysd.py_backend.model.Model.select_submodel
now takes an optional argument inplace when set to :pyFalse
it will return a modified copy of the model instead of modifying the original model (131
). (@enekomartinmartinez) - :py
pysd.py_backend.model.Model.export
will now save also time component information if changed (e.g. final time, time step...). (@enekomartinmartinez)
- Set the pointer of :py
pysd.py_backend.statefuls.DelayFixed
to 0 during initialization (427
). (@enekomartinmartinez) - :py
pysd.py_backend.model.Model.export
now works with Macros. (@enekomartinmartinez)
- Improve documentation of methods in :py
pysd.py_backend.model.Model
and :pypysd.py_backend.model.Macro
includying cross-references and rewrite the one from :pypysd.py_backend.model.Macro.set_components
. (@enekomartinmartinez) - Include documentation about the new method :py
pysd.py_backend.model.Model.copy
and update documentation from :pypysd.py_backend.model.Model.select_submodel
. (@enekomartinmartinez)
- Improved performace of :py
pysd.py_backend.output.DataFrameHandler
by creating the dataframe at the end of the run (374
and330
). (@easyas314159 and @enekomartinmartinez)
- Move old :py
pysd.py_backend.model.Macro.set_components
to :pypysd.py_backend.model.Macro._set_components
, and create new method with the same name without the new argument. (@enekomartinmartinez) - Move old :py
pysd.py_backend.model.Macro.set_stateful
to :pypysd.py_backend.model.Macro._set_stateful
. (@enekomartinmartinez) - Make integration tests filter only specific warnings. (@enekomartinmartinez)
- Include warnings in :py
pysd.py_backend.model.Macro.set_components
when changing the behaviour of the component (58
). (@enekomartinmartinez)
- Remove support for Python 3.7 and 3.8. (@enekomartinmartinez)
- Update the cellrange retrievel to be compatible with :py
openpyxl
>= 3.1. It breaks the code for lower versions. (@enekomartinmartinez)
- Update benchmarking tools to avoid :py
FutureWarning
for positional keys from :pypandas
. (@enekomartinmartinez)
- Update requirements. (@enekomartinmartinez)
- Update libraries used for building documentation and .readthedocs.yml. (@enekomartinmartinez)
- Force to use :py
xarray
>= 2023.09. (@enekomartinmartinez) - Use pandas[excel] instead of xlrd dependency in the requirements. (@gdrosos)
- Add the possibility to run a model one or several steps at a time, updating model variables in the process. (@rogersamso)
- Add the Running models one (or more) step(s) at a time section in
advanced_usage
. (@rogersamso)
- Modify signature of the :py
pysd.py_backend.output.ModelOutput
class. It now only accepts the path of the results file (@rogersamso) - Add the :py
pysd.py_backend.output.ModelOutput.collect
method to the :pypysd.py_backend.output.ModelOutput
class. (@rogersamso) - Add the :py
pysd.py_backend.model.Model.set_stepper
and :pypysd.py_backend.model.Model.step
methods to the :pypysd.py_backend.model.Model
class. (@rogersamso) - Add several internal methods to the :py
pysd.py_backend.model.Model
class, to avoid code repetition. (@rogersamso) - Add :py
FutureWarning
for Python 3.7 support deprecation. (@enekomartinmartinez)
- 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)
- Set the final_subscripts to an empty dictionary for ELMCOUNT function in :py
pysd.builders.python_expressions_builder.CallBuilder.build_function_call
. (@rogersamso) - Define comp_subtype of Unchangeable tabbed arrays as Unchangeable. This is done in :py
pysd.builders.python.python_expressions_builder.ArrayBuilder.build
. (@rogersamso)
- Add information about slack channel https://slofile.com/slack/sdtoolsandmet-slj3251. (@enekomartinmartinez)
- Update XMILE stocks section. (@enekomartinmartinez)
- 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 :py
pysd.translators.structures.abstract_expressions.IntegStructure
. (@enekomartinmartinez)
- Add :py
numpy.py
as translation for the call to the function PI(). (@lionel42)
- Set :py
numpy
<1.24 to avoid errors with least squares equation in :pypysd.py_backend.allocation.allocate_available
. (@enekomartinmartinez) - Keep the attributes of a component when using :py
pysd.py_backend.model.Macro.set_components
to avoid losing coords or arguments information. (@enekomartinmartinez) - Set :py
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)
- Run test for Python 3.11 with ubuntu-latest (hdf5-headers need to be installed using apt manager). (@enekomartinmartinez)
- Parses and ignores reality check functions during translation of Vensim models. (@rogersamso)
- Fix issue with the classification of variables in modules and submodules (
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 (
388
). (@rogersamso) - Fix bug on the CLI when parsing initial conditions (
395
). (@rogersamso)
- 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)
- The :py
_merge_nested_dicts
method from the :pypysd.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)
- :py
pysd.translators.vensim.vensim_element.Constraint
and :pypysd.translators.vensim.vensim_element.TestInputs
classes have been added, which inherit from the also newly created :pypysd.translators.vensim.vensim_element.GenericComponent
, which include the :pyparse
and :pyget_abstract_component
methods. (@rogersamso and @enekomartinmartinez) - The :py
pysd.translators.structures.abstract_model.AbstractSection
class now has two extra attributes (:pyconstraints
and :pyinput_tests
), which hold the :pypysd.translators.structures.abstract_model.AbstractConstraint
and :pypysd.translators.structures.abstract_model.AbstractTestInputs
objects. (@rogersamso)
- Adds ncfile.py module with helper functions to export a subset or all of the data_vars in netCDF files generated with PySD to :py
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)
- Deprecate :py
pysd.py_backend.model.Model._get_dependencies
replacing it with :pypysd.py_backend.model.Model.get_dependencies
. (@enekomartinmartinez)
- Include new class :py
pysd.py_backend.utils.Dependencies
to return by :pypysd.py_backend.model.Model.get_dependencies
(379
). (@lionel42)
- 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)
- Initializing external objects from netCDF file is much faster than reading from spreadsheet files.(@rogersamso)
- Adds the :py
pysd.py_backend.model.Macro.serialize_externals
and :pypysd.py_backend.model.Macro.initialize_external_data
methods, and a few other private methods.(@rogersamso) - Adds the :py
pysd.py_backend.utils.UniqueDims
class for renaming model dimensions with unique names.(@rogersamso) - Force :py
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 :py
pysd.py_backend.lookups.HardcodedLookups
(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)
- Fix bugs with :py
pandas.DataFrame
1.5.0 (366
). (@enekomartinmartinez)
- Simulation results can now be stored as netCDF4 files. (@rogersamso)
- The CLI also accepts netCDF4 file paths after the -o argument. (@rogersamso)
- Fix bug when a WITH LOOKUPS argument has subscripts. (@enekomartinmartinez)
- Fix bug of exporting csv files with multiple subscripts variables. (@rogersamso)
- Fix bug of missing dimensions in variables defined with not all the subscripts of a range (
364
). (@enekomartinmartinez) - Fix bug when running a model with variable final time or time step and progressbar (
361
). (@enekomartinmartinez)
- 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
page. (@enekomartinmartinez)
- Exporting outputs as netCDF4 is much faster than exporting a pandas DataFrame, especially for large models. (@rogersamso)
- Make PySD work with :py
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)
- Set :py
parsimonius
requirement to 0.9.0 to avoid a breaking-change in the newest version. Pending to update PySD to run it with :pyparsimonious
0.10.0. (@enekomartinmartinez)
- 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 (
357
). (@enekomartinmartinez) - 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). (@enekomartinmartinez)
- Classify control variables in the main file always (
357
). (@enekomartinmartinez)
- Include :py
pysd.translators.structures.abstract_model.AbstractControlElement
child of :pypysd.translators.structures.abstract_model.AbstractElement
to differentiate the control variables. (@enekomartinmartinez)
- Make sketch's font_size optional. (@enekomartinmartinez)
- Correct typos.
- Fix bug generated when :EXCEPT: keyword is used with subscript subranges (
352
). (@enekomartinmartinez) - Fix bug of precision error for :py
pysd.py_backend.allocation.allocate_by_priority
(353
). (@enekomartinmartinez) - Fix bug of constant cache assignment. (@enekomartinmartinez)
- Improve the performance of reading :py
pysd.py_backend.external.External
data with cellrange names by loading the data in memory with :pypandas
. As recommended by :pyopenpyxl
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). (@enekomartinmartinez)
- Add support for subscripted arguments in :py
pysd.py_backend.functions.ramp
and :pypysd.py_backend.functions.step
(344
). (@enekomartinmartinez)
- Fix bug related to the order of elements in 1D GET expressions (
343
). (@enekomartinmartinez) - Fix bug in request 0 values in allocate by priority (
345
). (@enekomartinmartinez) - Fix a numerical error in starting time of step and ramp. (@enekomartinmartinez)
- Include new PySD logo. (@enekomartinmartinez)
- Ignore 'distutils Version classes are deprecated. Use packaging.version instead' error in tests as it is an internal error of xarray. (@enekomartinmartinez)
- Add a warning message when a subscript range is duplicated in a variable reference. (@enekomartinmartinez)
- Add support for Vensim's ALLOCATE AVAILABLE (:py
pysd.py_backend.allocation.allocate_available
) function (339
). Integer allocation cases have not been implemented neither the fixed quantity and constant elasticity curve priority functions. (@enekomartinmartinez)
- Improve the documentation of the :py
pysd.py_backend.allocation
module. (@enekomartinmartinez)
- Add a class to manage priority profiles so it can be also used by the many-to-many allocation. (@enekomartinmartinez)
- Add support for Vensim's ALLOCATE BY PRIORITY (:py
pysd.py_backend.allocation.allocate_by_priority
) function (263
). (@enekomartinmartinez)
- Fix bug of using subranges to define a bigger range (
335
). (@enekomartinmartinez)
- Improve error messages for
pysd.py_backend.External
objects. (@enekomartinmartinez)
- Add support for Vensim's GET TIME VALUE (:py
pysd.py_backend.functions.get_time_value
) function (332
). Not all cases have been implemented. (@enekomartinmartinez) - Add support for Vensim's VECTOR SELECT (:py
pysd.py_backend.functions.vector_select
) function (266
). (@enekomartinmartinez)
- Add support for Vensim's VECTOR SORT ORDER (:py
pysd.py_backend.functions.vector_sort_order
) function (326
). (@enekomartinmartinez) - Add support for Vensim's VECTOR RANK (:py
pysd.py_backend.functions.vector_rank
) function (326
). (@enekomartinmartinez) - Add support for Vensim's VECTOR REORDER (:py
pysd.py_backend.functions.vector_reorder
) function (326
). (@enekomartinmartinez)
- Add the section
/development/adding_functions
with examples for developers. (@enekomartinmartinez)
- Include a template for PR.
- Simplify subscripts dictionaries for :py
pysd.py_backend.data.TabData
objects. (@enekomartinmartinez)
- Improve tests/README.md.
- Minor improvements in the documentation.
- Add Python 3.10 to CI pipeline and include it in the supported versions list. (@enekomartinmartinez)
- Correct LICENSE file extension in the setup.py. (@enekomartinmartinez)
- Move from importlib's :py
load_module
to :pyexec_module
. (@enekomartinmartinez) - Remove warnings related to :py
set
usage. (@enekomartinmartinez) - Move all the missing test to :py
pytest
. (@enekomartinmartinez) - Remove warning messages from test and make test fail if there is any warning. (@enekomartinmartinez)
- The new
Abstract Model Representation <structure/structure_index>
translation and building workflow will allow to add new output languages in the future. (@enekomartinmartinez) - Added new properties to the :py
pysd.py_backend.model.Macro
to make more accessible some information: :py.namespace
, :py.subscripts
, :py.dependencies
, :py.modules
, :py.doc
. (@enekomartinmartinez) - Cleaner Python models: (@enekomartinmartinez)
- :py
_namespace
and :py_dependencies
dictionaries have been removed from the file. - Variables original names, dependencies metadata now are given through :py
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 :py
pysd.py_backend.utils.xrmerge()
. - Arranging and subseting arrays are now done inplace instead of using the magic function :py
pysd.py_backend.utils.rearrange()
.
- :py
- Set the argument :py
flatten_output
from :py.run
to :pyTrue
by default. Previously it was set to :pyFalse
by default. (@enekomartinmartinez) - Move the docstring of the model to a property, :py
.doc
. Thus, it is not callable anymore. (@enekomartinmartinez) - Allow the function :py
pysd.py_backend.functions.pulse
to also perform the operations performed by :pypysd.py_backend.functions.pulse_train()
and :pypysd.py_backend.functions.pulse_magnitude()
. (@enekomartinmartinez) - Change first argument of :py
pysd.py_backend.functions.active_initial
, now it is the stage of the model and not the time. (@enekomartinmartinez) - Simplify the function :py
pysd.py_backend.utils.rearrange()
orienting it to perform simple rearrange cases for user interaction. (@enekomartinmartinez) - Move :py
pysd.py_backend.statefuls.Model
and :pypysd.py_backend.statefuls.Macro
to :pypysd.py_backend.model.Model
and :pypysd.py_backend.model.Macro
, respectively. (@enekomartinmartinez) - Manage all kinds of lookups with the :py
pysd.py_backend.lookups.Lookups
class. (@enekomartinmartinez) - Include a second optional argument to lookups functions to set the final coordinates when a subscripted variable is passed as an argument. (@enekomartinmartinez)
- Remove :py
pysd.py_backend.utils.xrmerge()
, :pypysd.py_backend.functions.pulse_train()
, :pypysd.py_backend.functions.pulse_magnitude()
, :pypysd.py_backend.functions.lookup()
, :pypysd.py_backend.functions.lookup_discrete()
, :pypysd.py_backend.functions.lookup_extrapolation()
, :pypysd.py_backend.functions.logical_and()
, :pypysd.py_backend.functions.logical_or()
, :pypysd.py_backend.functions.bounded_normal()
, :pypysd.py_backend.functions.log()
. (@enekomartinmartinez) - Remove old translation and building files (:py
pysd.translation
). (@enekomartinmartinez)
- Generate the documentation of the model when loading it to avoid losing information when replacing a variable value (
310
,312
). (@enekomartinmartinez) - Make random functions return arrays of the same shape as the variable, to avoid repeating values over a dimension (
309
,312
). (@enekomartinmartinez) - Fix bug when Vensim's :MACRO: definition is not at the top of the model file (
306
,312
). (@enekomartinmartinez) - Make builder identify the subscripts using a main range and subrange to allow using subscripts as numeric values as Vensim does (
296
,301
,312
). (@enekomartinmartinez) - Fix bug of missmatching of functions and lookups names (
116
,312
). (@enekomartinmartinez) - Parse Xmile models case insensitively and ignoring the new lines characters (
203
,253
,312
). (@enekomartinmartinez) - Add support for Vensim's :EXCEPT: keyword (
168
,253
,312
). (@enekomartinmartinez) - Add support for Xmile's FORCST and SAFEDIV functions (
154
,312
). (@enekomartinmartinez) - Add subscripts support for Xmile (
289
,312
). (@enekomartinmartinez) - Fix numeric error bug when using :py
return_timestamps
and time step with non-integer values. (@enekomartinmartinez)
- Review the whole documentation, refract it, and describe the new features. (@enekomartinmartinez)
- The variables defined in several equations are now assigned to a pre-allocated array instead of using :py
pysd.py_backend.utils.xrmerge()
. (@enekomartinmartinez) - The arranging and subseting of arrays is now done inplace instead of using the magic function :py
pysd.py_backend.utils.rearrange()
. (@enekomartinmartinez) - The grammars for Parsimonious are only compiled once per translation. (@enekomartinmartinez)
- The translation and the building of models has been totally modified to use the
Abstract Model Representation <structure/structure_index>
. (@enekomartinmartinez)