Skip to content

Commit

Permalink
chore: minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed May 7, 2024
1 parent e86b184 commit 3361a92
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dist/
refresh-env.sh
smoldyn-2.72-mac/
build/
c.sh
commit.sh
install.sh
push-image.sh
release.sh
Expand Down
29 changes: 14 additions & 15 deletions biosimulator_processes/processes/comparator_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
20 changes: 0 additions & 20 deletions c.sh

This file was deleted.

0 comments on commit 3361a92

Please sign in to comment.