Skip to content

Commit

Permalink
Merge branch 'master' into writers
Browse files Browse the repository at this point in the history
  • Loading branch information
schymans committed Jun 17, 2020
2 parents a2a587d + 08eb362 commit e6154f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions essm/_generator.py
Expand Up @@ -222,6 +222,7 @@ def newvar(
expr = ''
else:
expr = 'expr = ' + str(expr)

context = {
"name": name,
"doc": doc,
Expand All @@ -230,6 +231,7 @@ def newvar(
"latex_name": latex_name,
"default": default,
"expr": expr

}
self.vars.append(context)

Expand Down Expand Up @@ -262,6 +264,7 @@ def var(self, var1):
expr = dict_attr.get('expr')
self.newvar(name, doc, units, assumptions, latex_name, value, expr)


def write(self, filename):
"""Serialize itself to a filename."""
with open(filename, 'w') as out:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_equations.py
Expand Up @@ -4,7 +4,7 @@
import pytest

from essm import Eq
from essm._generator import EquationWriter
from essm._generator import EquationWriter, VariableWriter
from essm.equations import Equation
from essm.variables import Variable
from essm.variables.units import (joule, kelvin, kilogram, meter, mole, second,
Expand Down

0 comments on commit e6154f5

Please sign in to comment.