From 3361a92ba7f713d4763e1a2fb7e32906bae55e6e Mon Sep 17 00:00:00 2001 From: alexPatrie Date: Tue, 7 May 2024 13:32:33 -0400 Subject: [PATCH] chore: minor refactor --- .gitignore | 2 +- .../processes/comparator_process.py | 29 +++++++++---------- c.sh | 20 ------------- 3 files changed, 15 insertions(+), 36 deletions(-) delete mode 100755 c.sh diff --git a/.gitignore b/.gitignore index b6c7161f9..9b59054b2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ dist/ refresh-env.sh smoldyn-2.72-mac/ build/ -c.sh +commit.sh install.sh push-image.sh release.sh diff --git a/biosimulator_processes/processes/comparator_process.py b/biosimulator_processes/processes/comparator_process.py index 0c8b4d39b..834b5c74c 100644 --- a/biosimulator_processes/processes/comparator_process.py +++ b/biosimulator_processes/processes/comparator_process.py @@ -47,21 +47,6 @@ def __init__(self, config=None, core=None): self.model_parameter_ids[simulator_name] = simulator_instance.model_parameters_list self.reactions[simulator_name] = simulator_instance.reaction_list - - def _set_simulator_instances(self) -> Dict: - simulator_instances = {} - for simulator in self.config['simulators']: - module_name = simulator + '_process' - class_name = simulator.replace(simulator[0], simulator[0].upper()) + 'Process' - import_statement = f'biosimulator_processes.processes.{module_name}' - simulator_module = __import__(import_statement, fromlist=[class_name]) - simulator_instance = getattr(simulator_module, class_name) - simulator_instances[simulator] = simulator_instance(config={ - 'model': { - 'model_source': self.config['sbml_model_file']} - }) - return simulator_instances - def initial_state(self): # TODO: get these values from constructor return { @@ -121,3 +106,17 @@ def update(self, state, interval): results[simulator]['validation_score'] = diff # TODO: make this more fine-grained with MSE return results + + def _set_simulator_instances(self) -> Dict: + simulator_instances = {} + for simulator in self.config['simulators']: + module_name = simulator + '_process' + class_name = simulator.replace(simulator[0], simulator[0].upper()) + 'Process' + import_statement = f'biosimulator_processes.processes.{module_name}' + simulator_module = __import__(import_statement, fromlist=[class_name]) + simulator_instance = getattr(simulator_module, class_name) + simulator_instances[simulator] = simulator_instance(config={ + 'model': { + 'model_source': self.config['sbml_model_file']} + }) + return simulator_instances diff --git a/c.sh b/c.sh deleted file mode 100755 index 11c246019..000000000 --- a/c.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -branch="$1" - -if [ "${branch}" == "" ]; then - echo "Please specify a branch..." - read -r branch - if [ "${branch}" == "" ]; then - branch="main" - fi -fi - -echo "Enter commit message: " -read -r msg - -python3 ./scripts/fix_notebooks.py -git add --all -git commit -m "${msg}" -git push origin "${branch}" -