diff --git a/process_bigraph/experiments/comets.py b/process_bigraph/experiments/comets.py index e405d7d..60a69fe 100644 --- a/process_bigraph/experiments/comets.py +++ b/process_bigraph/experiments/comets.py @@ -1,12 +1,11 @@ import numpy as np from pathlib import Path -import matplotlib.pyplot as plt from scipy.ndimage import convolve import cobra from cobra.io import load_model from process_bigraph import Process, ProcessTypes, Composite -from process_bigraph.experiments.parameter_scan import RunProcess +from process_bigraph.processes.parameter_scan import RunProcess # create new types diff --git a/process_bigraph/processes/__init__.py b/process_bigraph/processes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/process_bigraph/experiments/parameter_scan.py b/process_bigraph/processes/parameter_scan.py similarity index 99% rename from process_bigraph/experiments/parameter_scan.py rename to process_bigraph/processes/parameter_scan.py index f95eddf..088fcad 100644 --- a/process_bigraph/experiments/parameter_scan.py +++ b/process_bigraph/processes/parameter_scan.py @@ -36,17 +36,14 @@ class ToySystem(Process): 'kdeg': 'float', 'ksynth': 'float'}}} - def inputs(self): return { 'species': 'map[float]'} - def outputs(self): return { 'species': 'map[float]'} - def update(self, inputs, interval): species = { key: input * (self.config['rates'][key]['ksynth'] - self.config['rates'][key]['kdeg']) @@ -59,7 +56,6 @@ def update(self, inputs, interval): class ODE(Process): config_schema = 'ode_config' - def __init__(self, config, core): super().__init__(config, core) @@ -72,17 +68,14 @@ def __init__(self, config, core): self.species_count, self.species_count) - def inputs(self): return { 'species': f'array[({self.species_count}), float]'} - def outputs(self): return { 'species': f'array[({self.species_count}), float]'} - def update(self, state, interval): total = np.dot( self.config['rates'], @@ -100,7 +93,6 @@ class RunProcess(Step): 'timestep': 'float', 'runtime': 'float'} - def __init__(self, config, core): super().__init__(config, core) @@ -187,18 +179,15 @@ def __init__(self, config, core): self.composite = Composite(composite_config, core=core) - def inputs(self): return self.process.inputs() - def outputs(self): return { 'results': dict( {'time': 'list[float]'}, **self.results_schema)} - def update(self, inputs): # TODO: instead of the composite being a reference it is instead read through # some port and lives in the state of the simulation (??) @@ -265,7 +254,6 @@ class ParameterScan(Step): 'timestep': 'float', 'runtime': 'float'} - def __init__(self, config, core): super().__init__(config, core) @@ -338,18 +326,15 @@ def __init__(self, config, core): self.results_schema = results_schema - def first_process(self): for key, value in self.scan.state.items(): if key.startswith('process_'): return value['instance'].composite.state['process']['instance'] - def outputs(self): return { 'results': self.results_schema} - def update(self, inputs): results = self.scan.update({}, 0.0) diff --git a/setup.py b/setup.py index 6cebdb1..aa87ac8 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages -VERSION = '0.0.20' +VERSION = '0.0.21' with open("README.md", "r") as readme: @@ -29,6 +29,7 @@ # packages=find_packages(), packages=[ 'process_bigraph', + 'process_bigraph.processes', ], classifiers=[ "Development Status :: 3 - Alpha",