Skip to content

Commit

Permalink
run black
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Jan 30, 2025
1 parent e3a6cc9 commit 5e563d8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/unit/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,17 @@ class Input:
T: u(float, units="kelvin")
n: int


@semantikon_class
@dataclass
class Output:
E: u(float, units="electron_volt")
L: u(float, units="angstrom")


@Workflow.wrap.as_function_node
def run_md(inp: Input) -> Output:
out = Output(E=1., L=2.)
out = Output(E=1.0, L=2.0)
# This line should be removed with the next version of semantikon
out._is_semantikon_class = True
return out
Expand All @@ -246,7 +248,7 @@ def run_md(inp: Input) -> Output:
class TestDataclass(unittest.TestCase):
def test_dataclass(self):
wf = Workflow("my_wf")
inp = Input(T=300., n=100)
inp = Input(T=300.0, n=100)
# This line should be removed with the next version of semantikon
inp._is_semantikon_class = True
wf.node = run_md(inp)
Expand All @@ -255,19 +257,14 @@ def test_dataclass(self):
i_txt = "my_wf.node.inputs.inp"
o_txt = "my_wf.node.outputs.out"
triples = (
(
URIRef(f'{i_txt}.n.value'),
RDFS.subClassOf,
URIRef(f'{i_txt}.value')
),
(URIRef(o_txt), PNS.hasValue, URIRef(f'{o_txt}.E.value'))
(URIRef(f"{i_txt}.n.value"), RDFS.subClassOf, URIRef(f"{i_txt}.value")),
(URIRef(o_txt), PNS.hasValue, URIRef(f"{o_txt}.E.value")),
)
for triple in triples:
self.assertEqual(
len(list(graph.triples(triple))), 1, msg=f"{triple} not found"
)



if __name__ == "__main__":
unittest.main()

0 comments on commit 5e563d8

Please sign in to comment.