Skip to content

Commit

Permalink
feat: improved use of KiSAO terms
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Sep 16, 2021
1 parent cb1e290 commit a4086e9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Base OS
FROM python:3.9-slim-buster

ARG VERSION="0.1.20"
ARG VERSION="0.1.21"
ARG SIMULATOR_VERSION="2.2.0"

# metadata
Expand Down
4 changes: 2 additions & 2 deletions biosimulators.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
{
"kisaoId": {
"namespace": "KISAO",
"id": "KISAO_0000332"
"id": "KISAO_0000559"
},
"id": "initial_time_step",
"name": "Initial time step",
Expand Down Expand Up @@ -933,7 +933,7 @@
"name": "Newton-type method for solveing non-linear (NL) equations (EQ)",
"kisaoId": {
"namespace": "KISAO",
"id": "KISAO_0000408"
"id": "KISAO_0000569"
},
"modelingFrameworks": [{
"namespace": "SBO",
Expand Down
2 changes: 1 addition & 1 deletion biosimulators_tellurium/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.20'
__version__ = '0.1.21'
8 changes: 4 additions & 4 deletions biosimulators_tellurium/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class PlottingEngine(str, enum.Enum):
'type': ValueType.float,
'default': None,
},
'KISAO_0000332': {
'kisao_id': 'KISAO_0000332',
'KISAO_0000559': {
'kisao_id': 'KISAO_0000559',
'id': 'initial_time_step',
'name': 'Initial time step',
'type': ValueType.float,
Expand Down Expand Up @@ -172,8 +172,8 @@ class PlottingEngine(str, enum.Enum):
},
}
}),
('KISAO_0000408', {
'kisao_id': 'KISAO_0000408',
('KISAO_0000569', {
'kisao_id': 'KISAO_0000569',
'id': 'nleq2',
'name': "Newton-type method for solveing non-linear (NL) equations (EQ)",
'parameters': {
Expand Down
14 changes: 7 additions & 7 deletions tests/test_core_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_exec_sed_task_steady_state_with_biosimulators(self):
),
simulation=sedml_data_model.SteadyStateSimulation(
algorithm=sedml_data_model.Algorithm(
kisao_id='KISAO_0000408',
kisao_id='KISAO_0000569',
),
),
)
Expand Down Expand Up @@ -638,7 +638,7 @@ def _build_sed_doc(self, algorithm=None):
source='model.xml',
language=sedml_data_model.ModelLanguage.SBML.value,
))
if algorithm.kisao_id == 'KISAO_0000408':
if algorithm.kisao_id == 'KISAO_0000569':
doc.simulations.append(sedml_data_model.SteadyStateSimulation(
id='sim_steady_state',
algorithm=algorithm,
Expand All @@ -659,7 +659,7 @@ def _build_sed_doc(self, algorithm=None):
simulation=doc.simulations[0],
))

if algorithm.kisao_id != 'KISAO_0000408':
if algorithm.kisao_id != 'KISAO_0000569':
doc.data_generators.append(sedml_data_model.DataGenerator(
id='data_gen_time',
variables=[
Expand All @@ -686,7 +686,7 @@ def _build_sed_doc(self, algorithm=None):

report = sedml_data_model.Report(id='report')
doc.outputs.append(report)
if algorithm.kisao_id != 'KISAO_0000408':
if algorithm.kisao_id != 'KISAO_0000569':
report.data_sets.append(sedml_data_model.DataSet(id='data_set_time', label='Time', data_generator=doc.data_generators[0]))
report.data_sets.append(sedml_data_model.DataSet(id='data_set_C', label='C', data_generator=doc.data_generators[-1]))

Expand All @@ -702,7 +702,7 @@ def _assert_combine_archive_outputs(self, doc, out_dir):
self.assertEqual(sorted(report.keys()), sorted([d.id for d in doc.outputs[0].data_sets]))

sim = doc.tasks[0].simulation
if doc.simulations[0].algorithm.kisao_id == 'KISAO_0000408':
if doc.simulations[0].algorithm.kisao_id == 'KISAO_0000569':
self.assertIn(report[doc.outputs[0].data_sets[0].id].shape, [(), (1,)])
self.assertIsInstance(report[doc.outputs[0].data_sets[0].id].tolist(), (float, list))
else:
Expand All @@ -711,7 +711,7 @@ def _assert_combine_archive_outputs(self, doc, out_dir):
for data_set_result in report.values():
self.assertFalse(numpy.any(numpy.isnan(data_set_result)))

if doc.simulations[0].algorithm.kisao_id != 'KISAO_0000408':
if doc.simulations[0].algorithm.kisao_id != 'KISAO_0000569':
self.assertIn('data_set_time', report)
numpy.testing.assert_allclose(report[doc.outputs[0].data_sets[0].id],
numpy.linspace(sim.output_start_time, sim.output_end_time, sim.number_of_points + 1))
Expand Down Expand Up @@ -772,7 +772,7 @@ def test_exec_sedml_docs_in_combine_archive_with_all_algorithms(self):
simulator_config=simulator_config)
self.assertEqual(set(results.keys()), set(['sim.sedml']))
self.assertEqual(set(results['sim.sedml'].keys()), set(['report']))
if alg.kisao_id == 'KISAO_0000408':
if alg.kisao_id == 'KISAO_0000569':
self.assertEqual(set(results['sim.sedml']['report'].keys()), set(['data_set_C']))
else:
self.assertEqual(set(results['sim.sedml']['report'].keys()), set(['data_set_time', 'data_set_C']))
Expand Down

0 comments on commit a4086e9

Please sign in to comment.