Skip to content

Commit

Permalink
Merge ce1ac90 into 0e5a81b
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikuncar committed Jan 19, 2018
2 parents 0e5a81b + ce1ac90 commit 2cc918b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions essm/variables/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ def __delitem__(cls, expr):
if expr in registry:
del registry[expr]

@property
def function(cls):
"""Return a symbolic function."""
from sage.symbolic.function_factory import function_factory
return function_factory(cls.name + '_function')


@six.add_metaclass(VariableMeta)
class Variable(object):
Expand Down Expand Up @@ -129,6 +135,10 @@ def __new__(
self.definition = definition
return self

def __call__(self, *args):
"""Return function."""
return self.definition.function(*args)

@property
def __doc__(self):
return self.definition.__doc__
Expand Down

0 comments on commit 2cc918b

Please sign in to comment.