modelx v0.14.0 (2 May 2021)¶
This release fixes bugs and introduces enhancements as follows.
Prior to this release
property was read-only, and
it was linked to the docstring of the Cells’s Formula, so
the property for lambda Cells was always None.
With this release,
property now works as setter.
If a Cells has a no-lambda Formula, then the setter replaces
the docstirng of the Formula:
>>> @mx.defcells ... def foo(x): ... """This is foo""" ... return x >>> foo.doc 'This is foo' >>> foo.doc = "foo's doc is updated" >>> foo.formula def foo(x): """foo's doc is updated""" return x >>> foo.doc "foo's doc is updated"
When setting the docstring of a Cells
the input string is not automatically indented:
>>> doc = """This is foo ... ... Unindented docstring ... """ >>> foo.doc = doc >>> foo.formula def foo(x): """This is foo Unindented docstring """ return x
>>> foo.set_doc(doc, insert_indents=True) >>> foo.formula def foo(x): """This is foo Unindented docstring """ return x
If a Cells’ Formula is defined by a lambda function, the doc is kept in the Cells separately from the function:
>>> space.new_cells(name="bar", formula=lambda x: x) <Cells Model1.Space1.bar(x)> >>> space.bar.doc = "I am bar" >>> space.bar.doc 'I am bar'
Model.docwas mistakenly treated as a Reference.
Fixed an error on rebinding a Reference that is referenced directly and indirectly by multiple Cells (GH43).