Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build model update #797

Merged
merged 15 commits into from
May 25, 2022
Merged

Build model update #797

merged 15 commits into from
May 25, 2022

Conversation

BryanRumsey
Copy link
Contributor

No description provided.

@BryanRumsey BryanRumsey self-assigned this May 14, 2022
@BryanRumsey BryanRumsey added this to the 1.6.10 milestone May 19, 2022
@BryanRumsey BryanRumsey added the enhancement New feature or request label May 19, 2022
@BryanRumsey BryanRumsey marked this pull request as ready for review May 19, 2022 22:51
@BryanRumsey BryanRumsey mentioned this pull request May 20, 2022
@BryanRumsey BryanRumsey requested a review from mdip226 May 20, 2022 19:56
Copy link
Contributor

@mdip226 mdip226 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/CLE_examples_convergence.ipynb)
unused:
import numpy
parameter_values=None

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/Events.ipynb)
unused:
parameter_values=None

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/KineticModelForStyrenePolymerization.ipynb)
TimeSpan class not defined throws error

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/Live Output with Python Solvers.ipynb)
unused:
parameter_values=None
typo:
"Resume Resume"

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/Model_Pre_Compilation.ipynb)
why perf counter say Time to complete 20 runs using pre compiled model and solver: 0.1910390830016695
when it took 10.3 sec
non-precompiled took 3m 19s and says 199.717

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/Negative_Timespan_Example.ipynb)
typos:
'we must swift'


Process Results


To visualize the results with the infection event at t=0 we must swift the time sub array in the results by the added simulation time.

Simulate Infection with past population data

To model population data from prior to the infection we need to modify the infect event trigger by the ent time of the add period. We do this using the variable solver to modify the infect_start parameter.

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/Run GillesPy2 Simulations in Parallel.ipynb)
dask import, maybe add a comment about installation?

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/SBML_Import_Test.ipynb)
libsbml required import?

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/hybrid_continuous_species.ipynb)
(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/hybrid_switching_example.ipynb)
match case in filename

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/AdvancedFeatures/hybrid_switching_example.ipynb)
typo: threshold


Run the Simulations


The hybrid switching condition is based on a coefficient of variance for each species. The error threshhold for this condition can be user modified by instantiating the solver, and calling the run function from it, rather than the solver.

The default value is 0.03 and is a threshold to the coefficient of variance for each species at the selected forward step (t + tau).

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/DataVisualization.ipynb)
typo: add ()


Run the Simulations


model.run creates a Results object with a list of Trajectory objects.

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/Models/ExtraModels/Dimerization.ipynb)
unused named argument
cell 6 "run" can be model.run()

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/Models/ExtraModels/Opioid_Model.ipynb)
typo: opoid to opioid

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/Models/ExtraModels/Oregonator.ipynb)
oregonator drop off at t=3.5?

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/Models/ExtraModels/SpeedComparisons/hybrid_switching_decay_model_performance.ipynb)
unused math, random
match case in filename
unused named argument

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/Models/ExtraModels/Brusselator.ipynb)
unused named argument (i think in all of the ExtraModels/StartingModels, and the ones in the examples dir)

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/examples/StartingModels/VilarOscillator/VilarOscillator.py)
maybe put this in another directory?, it's lonely in this one

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/gillespy2/solvers/cpp/example_models.py)
can't tell if this is used anywhere

(https://github.com/StochSS/GillesPy2/blob/bb8eabc583a570bbd4097705d8e4ea9ae453ed3d/test/TestingBattery.ipynb)
invalid syntax in cell 20 with the url
some unused model imports
that status bar is awesome

@mdip226
Copy link
Contributor

mdip226 commented May 23, 2022

The tests are still running but I might have to pause them for now and come back to them

],
TauLeapingSolver: [
VilarOscillator()
build_vilar_oscillator()
],
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./test_python_solver_perf.py::TestPythonSolverPerf::test_python_solver_perf Failed with Error: A model is required to run the simulation.
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/home/mdip/Projects/GillesPy2/test/test_python_solver_perf.py", line 57, in test_python_solver_perf
    perf_data = python_profiler.run_profiler(model, solver)
  File "/home/mdip/Projects/GillesPy2/test/profiling/python_profiler.py", line 43, in run_profiler
    solver.run(number_of_trajectories=trajectories, t=timesteps, timeout=0)
  File "/home/mdip/Projects/GillesPy2/gillespy2/solvers/numpy/ssa_solver.py", line 90, in run
    self = NumPySSASolver(model=model)
  File "/home/mdip/Projects/GillesPy2/gillespy2/solvers/numpy/ssa_solver.py", line 38, in __init__
    raise SimulationError("A model is required to run the simulation.")
gillespy2.core.gillespyError.SimulationError: A model is required to run the simulation.

Copy link
Contributor

@mdip226 mdip226 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more:

./test_StochML.py::TestStochML::test_StochML_from_and_to_model Failed with Error: could not convert string to float: 'None'
  File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/home/mdip/Projects/GillesPy2/test/test_StochML.py", line 30, in test_StochML_from_and_to_model
    stochml_model = stochml.to_model('model')
  File "/home/mdip/Projects/GillesPy2/gillespy2/core/model.py", line 1331, in to_model
    model.volume = float(expr)
ValueError: could not convert string to float: 'None'

@mdip226
Copy link
Contributor

mdip226 commented May 23, 2022

i think that's it!

@briandrawert briandrawert merged commit 2350b90 into develop May 25, 2022
@briandrawert briandrawert deleted the build-model branch May 25, 2022 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants