Skip to content

Commit

Permalink
Merge pull request #27 from UC-Davis-molecular-computing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
EricESeverson authored Jul 11, 2021
2 parents ec733b1 + ef1a3e5 commit 93c64d6
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 115 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The core of the simulator uses a [batching algorithm](https://arxiv.org/abs/2005
* [First example protocol](#first-example-protocol)
* [Larger state protocol](#larger-state-protocol)
* [Protocol with Multiple Fields](#protocol-with-multiple-fields)
* [Simulating Chemical Reaction Networks (CRNs)](#simulating-chemical-reaction-networks-crns)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion ppsim/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.1.3' # version line; WARNING: do not remove or change this line or comment
version = '0.1.5' # version line; WARNING: do not remove or change this line or comment
8 changes: 6 additions & 2 deletions ppsim/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ def run(self, run_until: Union[float, ConvergenceDetector] = None,
Defaults to True.
"""
if len(self.snapshots) == 0 and timer is True:
self.add_snapshot(TimeUpdate())
if type(run_until) is float or type(run_until) is int:
self.add_snapshot(TimeUpdate(time_bound=run_until))
else:
self.add_snapshot(TimeUpdate())

end_time = None
# stop_condition() returns True when it is time to stop
Expand Down Expand Up @@ -499,8 +502,9 @@ def get_next_time():
snapshot.update()

if len(self.snapshots) == 1 and type(self.snapshots[0]) is TimeUpdate:
self.snapshots[0].pbar.close()
self.snapshots.pop()
print()
# print()

@property
def reactions(self) -> str:
Expand Down
Loading

0 comments on commit 93c64d6

Please sign in to comment.