Skip to content

Commit 4ad279b

Browse files
committed
Add argument for controlling frequency of colony simulation timepoints
1 parent d56bc52 commit 4ad279b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

colony/experiments/antibiotics.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
N_BINS = (10, 10)
4747
TAGGED_MOLECULES_PATH = os.path.join(
4848
os.path.dirname(__file__), 'antibiotics_tagged_molecules.csv')
49-
NUM_EMISSIONS = 100
5049

5150

5251
def get_antibiotics_timeline(
@@ -96,6 +95,7 @@ def get_antibiotics_timeline(
9695
def simulate(
9796
emitter_config, simulation_time, num_cells, pulse_concentration,
9897
add_aa, anaerobic, antibiotic_threshold, update_fields, seed,
98+
num_emissions=100
9999
):
100100
'''Run the simulation
101101
@@ -116,6 +116,7 @@ def simulate(
116116
fields. This often needs to be set to False to avoid
117117
breaking FBA.
118118
seed: Seed for whole cell model random number generators.
119+
num_emissions: Number of times to emit data.
119120
120121
Returns:
121122
vivarium.core.emitter.Emitter: An emitter from which the
@@ -180,7 +181,7 @@ def simulate(
180181
initial_state = {}
181182
settings = {
182183
'emitter': emitter_config,
183-
'emit_step': max(simulation_time // NUM_EMISSIONS, 1),
184+
'emit_step': max(simulation_time // num_emissions, 1),
184185
'timeline': timeline_config,
185186
'experiment_id': timestamp(datetime.datetime.utcnow()),
186187
}
@@ -316,6 +317,11 @@ def main():
316317
default=0,
317318
help='Let wcEcoli update the environment fields.',
318319
)
320+
parser.add_argument(
321+
'--emissions',
322+
type=int,
323+
default=100,
324+
help='Number of times to emit data over simulation.')
319325
args = parser.parse_args()
320326
if args.atlas:
321327
with open(SECRETS_PATH, 'r') as f:
@@ -338,6 +344,7 @@ def main():
338344
args.antibiotic_threshold,
339345
args.update_fields,
340346
args.seed,
347+
args.emissions,
341348
)
342349

343350

0 commit comments

Comments
 (0)