modelx v0.20.0 (17 September 2022)#

This release introduces the following enhancements, changes and bug fixes.

To update modelx, run the following command:

>>> pip install modelx --upgrade

If you’re using Anaconda, use the conda command instead:

>>> conda update modelx

If you’re using the Spyder plugin for modelx, the spymx-kernels pakcage is also updated, so update it as well by either:

>>> pip install spymx-kernels --upgrade

or on Anaconda,

>>> conda update spymx-kernels

Enhancements#

Saving multiple pandas DataFrame and Series objects in one Excel file#

Prior to v0.20.0, pandas DataFrame and Series objects referenced in a model are written to separate files when the model is saved.

With modelx v0.20.0, Model.new_pandas and UserSpace.new_pandas have the sheet parameter to indicate the name of the sheet the pandas object is written on. This enables multiple pandas objects to be written to separate sheets in the same Excel file.

New methods and properties for IOSpec operations#

IOSpec objects are those whose types are derived from BaseIOSpec, such as PandasData and ModuleData. IOSpec objects are associated with data objects referenced in models, and specify how the data objects should be written to files.

The methods and properties below are introduced to handle IOSpec objects.

Backward Incompatible Changes#

Deprecated old methods#

From v0.20.0, the following methods are deprecated. These methods were introduced in early versions of modelx long before the intoduction of Model.new_pandas and UserSpace.new_pandas. Instead of using these methods, consider using Model.new_pandas and UserSpace.new_pandas for storing data in models.

Removed methods#

The following methods are removed from UserSpace. The user should use Model.update_pandas and Model.update_module instead.

  • UserSpace.update_pandas

  • UserSpace.update_module

Renamed classes and methods#

Other changes#

Bug Fixes#

  • Bug in changing the formula of a cells in a base space where the derived cells of the cells were defined in sub spaces of the base space.

  • Deprecation warning on reading Series.