Skip to content

Commit

Permalink
feat(dispatch): expanded support for connecting SED-ML to Vega
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Jul 29, 2021
1 parent 026fe52 commit 439bbeb
Show file tree
Hide file tree
Showing 17 changed files with 715 additions and 504 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pypi"
flask = {version = "<2"}
connexion = {extras = ["swagger-ui"],version = ">=2.7.0"}
requests = "*"
biosimulators-utils = {version = ">=0.1.97", extras = ["bngl", "cellml", "lems", "logging", "neuroml", "sbml", "smoldyn"]}
biosimulators-utils = {version = ">=0.1.98", extras = ["bngl", "cellml", "lems", "logging", "neuroml", "sbml", "smoldyn"]}
python-dateutil = "*"
gunicorn = "*"
flask-cors = "*"
Expand Down
212 changes: 106 additions & 106 deletions Pipfile.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def handler(body, file=None):
sed_model_spec = {
"_type": "SedModel",
"id": model.id,
"name": model.name,
"source": model.source,
"language": model.language,
"changes": [],
Expand All @@ -111,6 +112,7 @@ def handler(body, file=None):
for sim in sed_doc.simulations:
sed_sim_spec = {
"id": sim.id,
"name": sim.name,
"algorithm": {
"_type": "SedAlgorithm",
"kisaoId": sim.algorithm.kisao_id,
Expand Down Expand Up @@ -149,6 +151,7 @@ def handler(body, file=None):
for task in sed_doc.tasks:
sed_task_spec = {
"id": task.id,
"name": task.name,
}

if isinstance(task, Task):
Expand All @@ -169,6 +172,7 @@ def handler(body, file=None):
sed_data_generator_spec = {
'_type': 'SedDataGenerator',
'id': data_generator.id,
'name': data_generator.name,
'variables': [],
'math': data_generator.math,
}
Expand All @@ -184,6 +188,7 @@ def handler(body, file=None):
sed_doc_output_specs = {
'_type': 'SedReport',
'id': output.id,
'name': output.name,
'dataSets': [],
}

Expand All @@ -194,11 +199,13 @@ def handler(body, file=None):
data_set_specs = {
'_type': 'SedDataSet',
'id': data_set.id,
'name': data_set.name,
'dataGenerator': {
'_type': 'SedDataGenerator',
'_resultsDataSetId': get_results_data_set_id(
content, output, data_set),
'id': data_set.data_generator.id,
'name': data_set.data_generator.name,
'variables': [],
'math': data_set.data_generator.math,
}
Expand All @@ -218,6 +225,7 @@ def handler(body, file=None):
sed_doc_output_specs = {
'_type': 'SedPlot2D',
'id': output.id,
'name': output.name,
'curves': [],
'xScale': None,
'yScale': None,
Expand All @@ -237,11 +245,13 @@ def handler(body, file=None):
curve_specs = {
'_type': 'SedCurve',
'id': curve.id,
'name': curve.name,
'xDataGenerator': {
'_type': 'SedDataGenerator',
'_resultsDataSetId': get_results_data_set_id(
content, output, curve.x_data_generator),
'id': curve.x_data_generator.id,
'name': curve.x_data_generator.name,
'variables': [],
'math': curve.x_data_generator.math,
},
Expand All @@ -250,6 +260,7 @@ def handler(body, file=None):
'_resultsDataSetId': get_results_data_set_id(
content, output, curve.y_data_generator),
'id': curve.y_data_generator.id,
'name': curve.y_data_generator.name,
'variables': [],
'math': curve.y_data_generator.math,
},
Expand Down Expand Up @@ -280,6 +291,7 @@ def handler(body, file=None):
sed_doc_output_specs = {
'_type': 'SedPlot3D',
'id': output.id,
'name': output.name,
'surfaces': [],
'xScale': None,
'yScale': None,
Expand All @@ -302,11 +314,13 @@ def handler(body, file=None):
surface_specs = {
'_type': 'SedSurface',
'id': surface.id,
'name': surface.name,
'xDataGenerator': {
'_type': 'SedDataGenerator',
'_resultsDataSetId': get_results_data_set_id(
content, output, surface.x_data_generator),
'id': surface.x_data_generator.id,
'name': surface.x_data_generator.name,
'variables': [],
'math': surface.x_data_generator.math,
},
Expand All @@ -315,6 +329,7 @@ def handler(body, file=None):
'_resultsDataSetId': get_results_data_set_id(
content, output, surface.y_data_generator),
'id': surface.y_data_generator.id,
'name': surface.y_data_generator.name,
'variables': [],
'math': surface.y_data_generator.math,
},
Expand All @@ -323,6 +338,7 @@ def handler(body, file=None):
'_resultsDataSetId': get_results_data_set_id(
content, output, surface.z_data_generator),
'id': surface.z_data_generator.id,
'name': surface.z_data_generator.name,
'variables': [],
'math': surface.z_data_generator.math,
},
Expand Down
2 changes: 1 addition & 1 deletion apps/combine-service/src/spec/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,7 @@ components:
value: http://omex-libary.org/MyCombineArchive.omex
predictate:
_type: uri
value: https://dublincore.org/specifications/dublin-core/dcmi-terms/title
value: http://dublincore.org/specifications/dublin-core/dcmi-terms/title
object:
_type: literal
value: Title of my COMBINE archive
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
{
"_type": "SedDataSet",
"id": "data_set_time",
"name": null,
"label": "time",
"dataGenerator": {
"_type": "SedDataGenerator",
Expand All @@ -117,6 +118,7 @@
{
"_type": "SedDataSet",
"id": "data_set_T",
"name": null,
"label": "T",
"dataGenerator": {
"_type": "SedDataGenerator",
Expand All @@ -130,6 +132,7 @@
{
"_type": "SedDataSet",
"id": "data_set_E",
"name": null,
"label": "E",
"dataGenerator": {
"_type": "SedDataGenerator",
Expand All @@ -143,6 +146,7 @@
{
"_type": "SedDataSet",
"id": "data_set_I",
"name": null,
"label": "I",
"dataGenerator": {
"_type": "SedDataGenerator",
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions apps/combine-service/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_get_sedml_specs_for_combine_archive_file(self):
self.FIXTURES_DIR, self.TEST_CASE + '.sed-specs.json')
with open(sed_output_specs_filename, 'r') as file:
expected_combine_specs = json.load(file)
self.assertEqual(combine_specs, expected_combine_specs)
self.assertEqual(combine_specs, expected_combine_specs, combine_specs)

fid.close()

Expand Down Expand Up @@ -1464,7 +1464,7 @@ def test_get_metadata_for_combine_archive_file_as_rdf_triples(self):
},
'predicate': {
'_type': 'RdfUriNode',
'value': 'https://dublincore.org/specifications/dublin-core/dcmi-terms/title',
'value': 'http://dublincore.org/specifications/dublin-core/dcmi-terms/title',
},
'object': {
'_type': 'RdfLiteralNode',
Expand Down
Loading

0 comments on commit 439bbeb

Please sign in to comment.