Skip to content

Commit

Permalink
Added space after unit in plot
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciocravo committed Jan 16, 2024
1 parent 8952edb commit 8e011c0
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 24 deletions.
15 changes: 2 additions & 13 deletions for_local_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,10 @@
import numpy as np

if __name__ == '__main__':
# Bourbaki

A, B = BaseSpecies()
A + B >> Zero [1]
pass

A(200), B(200)
Sim = Simulation(A | B)
Sim.level = -1
descr = Sim.compile()
Sim.plot_data = False
Sim.duration = 30 * u.hour
Sim.volume = 1*u.m**3
Sim.run()

assert Sim._parameters_for_sbml['volume'][0] > 100
assert Sim.fres['Time'][-1] > 100



Expand Down
3 changes: 0 additions & 3 deletions mobspy/modules/meta_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import re





# Easter Egg: I finished the first version on a sunday at the BnF in Paris
# If anyone is reading this, I highly recommend you study there, it is quite a nice place
class Compiler:
Expand Down
4 changes: 2 additions & 2 deletions mobspy/modules/meta_class_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def create_orthogonal_vector_structure(species):
else:
simlog.error(f'The same characteristic can only be shared through inheritance. ' +
f'There are two characteristics directly added to two meta-species \n'
f'Repetition in: {spe}, {ref_characteristics_to_object[cha] } \n'
f'Characteristics: {spe.get_characteristics()}, '
f'Repetition in: {spe}, {ref_characteristics_to_object[cha]} \n'
f'Characteristics: {spe.get_characteristics()}, '
f'{ref_characteristics_to_object[cha].get_characteristics()} \n')

return ref_characteristics_to_object
Expand Down
8 changes: 4 additions & 4 deletions mobspy/plot_scripts/default_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ def set_plot_units(new_plot_params):
"""
new_plot_params['xlabel'] = 'Time'
if new_plot_params['unit_x'] is not None:
new_plot_params['xlabel'] += f'({new_plot_params["unit_x"]})'
new_plot_params['xlabel'] += f' ({new_plot_params["unit_x"]})'
else:
new_plot_params['xlabel'] += '(s)'
new_plot_params['xlabel'] += ' (s)'

if new_plot_params['output_concentration']:
new_plot_params['ylabel'] = 'Conc.'
else:
new_plot_params['ylabel'] = 'Counts'

if new_plot_params['unit_y'] is not None:
new_plot_params['ylabel'] += f'({new_plot_params["unit_y"]})'
new_plot_params['ylabel'] += f' ({new_plot_params["unit_y"]})'
else:
if new_plot_params['output_concentration']:
new_plot_params['ylabel'] += '(mol/L)'
new_plot_params['ylabel'] += ' (mol/L)'


def stochastic_plot(species, data, plot_params):
Expand Down
3 changes: 1 addition & 2 deletions mobspy/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ def compile(self, verbose=True):
species_counts=self._species_counts,
orthogonal_vector_structure=self.orthogonal_vector_structure,
volume=self.parameters['volume'],
type_of_model=self.parameters[
"simulation_method"],
type_of_model=self.parameters["simulation_method"],
verbose=verbose,
event_dictionary=self.total_packed_events,
continuous_sim=self.parameters['_continuous_simulation'],
Expand Down
Binary file modified test_plot_images/constant_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test_plot_images/deterministic_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test_plot_images/stochastic_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8e011c0

Please sign in to comment.