Skip to content

Commit

Permalink
Refactor InfoBoxComponent to add JournalArticle as a valid type for a…
Browse files Browse the repository at this point in the history
…dding objects to workspace

Refactor ExportWorkspaceHandler to include options for exporting bifurcation analysis code in Julia with specified parameters

Refactor handlers.py to simplify construct_metadata function and remove unnecessary code
  • Loading branch information
leon-k-martin committed Sep 30, 2024
1 parent df99b53 commit 824992b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/components/InfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ const InfoBoxComponent: React.FC<IInfoBoxProps> = ({
}) => {
// Valid types for adding objects to workspace
// TODO: add valid type for connectivity
const validTypes = ['Neural Mass Model', 'Noise', 'Coupling', 'Integrator'];
const validTypes = [
'Neural Mass Model',
'Noise',
'Coupling',
'Integrator',
'JournalArticle'
];

const isAddable = selectedNode && validTypes.includes(selectedNode.type);

Expand Down
12 changes: 8 additions & 4 deletions tvb_ext_ontology/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,17 @@ def post(self):
if export_type == "py":
onto_api.experiment.save_code(directory)
LOGGER.info("Saved code")

elif export_type == "jl":
onto_api.experiment.save_model_bifurcation_analysis_code(directory)
p = list(onto_api.experiment.model.metadata.parameters.values())[0].name
onto_api.experiment.save_model_bifurcation_analysis_code(
directory, ICS=p, p_min=-10, p_max=10
) # TODO: remove hardcoding and add option to type in parameters in frontend

elif export_type == "xml":
onto_api.experiment.save_model_specification(directory)
LOGGER.info("Saved model specification")

elif export_type == "yaml":
onto_api.experiment.save_metadata(directory)
LOGGER.info("Saved metadata")
Expand Down Expand Up @@ -258,9 +264,7 @@ def construct_metadata(nodes_data):
"name": custom_get(nodes_data, "parcellation", "DesikanKilliany"),
}
},
"tractogram": {
"label": custom_get(nodes_data, "tractogram", "dTOR"),
},
"tractogram": custom_get(nodes_data, "tractogram", "dTOR"),
},
"coupling": {
"name": custom_get(nodes_data, "coupling", "Linear"),
Expand Down

0 comments on commit 824992b

Please sign in to comment.