You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to set the doc string for a cell outside of a module import? After creating a cell with new_cell, I want to add a doc string, but using the doc property or set_property method return an error.
The text was updated successfully, but these errors were encountered:
The doc property of a Cells is linked to the docstring in its Formula.
>>>foo.formuladeffoo(x):
"""this is foo's doc"""returnx>>>foo.doc"this is foo's doc"
So to change doc, you can redefine the Formula
>>>deftemp(x):
... """foo's doc is updated"""
... returnx>>>foo.formula=temp>>>foo.formuladeffoo(x):
"""foo's doc is updated"""returnx>>>foo.doc"foo's doc is updated"
The name temp can be anything. It gets replaced with foo.
If Formula is defined by a lambda function, doc is None because lambda functions don't have docstrings.
I'm planning to enhance modelx so that Cells with lambda functions can have docs.
I also want to allow such operation as foo.doc = "foo's doc is updated", which updates the docstring in its Formula.
Is it possible to set the doc string for a cell outside of a module import? After creating a cell with new_cell, I want to add a doc string, but using the doc property or set_property method return an error.
The text was updated successfully, but these errors were encountered: