Skip to content

Commit

Permalink
Fixed issue with not being able to run basic sim.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus-bio committed Jan 10, 2024
1 parent 7994957 commit a0ca4b5
Show file tree
Hide file tree
Showing 3 changed files with 6,640 additions and 6,366 deletions.
14 changes: 7 additions & 7 deletions ecoli/experiments/metabolism_redux_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def run_ecoli_with_metabolism_redux_classic(
name='metabolism-redux-classic',
raw_output=False,
save=True,
save_times=[1, 200, 400, 600, 800, 1000, 1200, 1300, 1400],
condition = "with_aa", # basal, with_aa
fixed_media = "minimal_plus_amino_acids" # minimal, minimal_plus_amino_acids
save_times=[1, 200, 400, 600, 800, 1000, 1200, 1300, 1400, 1800, 2200, 2400],
# condition = "with_aa", # basal, with_aa
# fixed_media = "minimal_plus_amino_acids" # minimal, minimal_plus_amino_acids
):
# filename = 'default'
sim = EcoliSim.from_file(CONFIG_DIR_PATH + filename + ".json")
Expand All @@ -75,11 +75,11 @@ def run_ecoli_with_metabolism_redux_classic(
sim.emitter = emitter
# sim.initial_state = get_state_from_file(path=f'data/{initial_state_file}.json')
sim.raw_output = raw_output
# sim.save = save
# sim.save_times = save_times
sim.save = save
sim.save_times = save_times

sim.condition = condition
sim.fixed_media = fixed_media
# sim.condition = condition
# sim.fixed_media = fixed_media


# # simplify working with uptake
Expand Down
10 changes: 6 additions & 4 deletions ecoli/library/sim_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def __init__(
jit=False,
total_time=10,
fixed_media = None,
media_timeline=((0, 'minimal'),), # have to change both media_timeline and condition
condition = 'basal',
media_timeline= ((0, 'minimal'),), # e.g. minimal_plus_amino_acids, have to change both media_timeline and condition
condition = None, # e.g. basal, with_aa
operons=True,
trna_charging=True,
ppgpp_regulation=True,
Expand Down Expand Up @@ -68,10 +68,13 @@ def __init__(
self.total_time = total_time
self.random_state = np.random.RandomState(seed = seed)
# Iterable of tuples with the format (time, media_id)
self.condition = condition
if condition is not None:
self.condition = condition
self.sim_data.condition = condition

if fixed_media is not None and media_timeline is not None:
media_timeline = ((0, fixed_media),)

self.media_timeline = media_timeline

self.trna_charging = trna_charging
Expand Down Expand Up @@ -101,7 +104,6 @@ def __init__(
with open(sim_data_path, 'rb') as sim_data_file:
self.sim_data = pickle.load(sim_data_file)

self.sim_data.condition = condition

# Used by processes to apply submass updates to correct unique attr
self.submass_indices = {
Expand Down
Loading

0 comments on commit a0ca4b5

Please sign in to comment.