salabim 24.0.11.post0__py3-none-any.whl → 24.0.12__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
salabim/salabim.py CHANGED
@@ -1,13 +1,13 @@
1
- # _ _ _ ____ _ _ ___ _ _
2
- # ___ __ _ | | __ _ | |__ (_) _ __ ___ |___ \ | || | / _ \ / |/ |
3
- # / __| / _` || | / _` || '_ \ | || '_ ` _ \ __) || || |_ | | | | | || |
4
- # \__ \| (_| || || (_| || |_) || || | | | | | / __/ |__ _| _ | |_| | _ | || |
5
- # |___/ \__,_||_| \__,_||_.__/ |_||_| |_| |_| |_____| |_| (_) \___/ (_)|_||_|
1
+ # _ _ _ ____ _ _ ___ _ ____
2
+ # ___ __ _ | | __ _ | |__ (_) _ __ ___ |___ \ | || | / _ \ / ||___ \
3
+ # / __| / _` || | / _` || '_ \ | || '_ ` _ \ __) || || |_ | | | | | | __) |
4
+ # \__ \| (_| || || (_| || |_) || || | | | | | / __/ |__ _| _ | |_| | _ | | / __/
5
+ # |___/ \__,_||_| \__,_||_.__/ |_||_| |_| |_| |_____| |_| (_) \___/ (_)|_||_____|
6
6
  # discrete event simulation
7
7
  #
8
8
  # see www.salabim.org for more information, the documentation and license information
9
9
 
10
- __version__ = "24.0.11"
10
+ __version__ = "24.0.12"
11
11
 
12
12
  import heapq
13
13
  import random
@@ -151,9 +151,11 @@ if Pythonista:
151
151
  inf = float("inf")
152
152
  nan = float("nan")
153
153
 
154
- _yieldless = not Pythonista # True, unless running under Pythonista
155
-
156
-
154
+ if Pythonista or AnacondaCode or PythonInExcel:
155
+ _yieldless = False
156
+ else:
157
+ _yieldless=True
158
+
157
159
  class QueueFullError(Exception):
158
160
  pass
159
161
 
@@ -5714,15 +5716,19 @@ class Queue:
5714
5716
 
5715
5717
 
5716
5718
  class Store(Queue):
5717
- def __init__(self, name: str = None, capacity: int = inf, env: "Environment" = None, *args, **kwargs):
5718
- super().__init__(name=name, capacity=capacity, env=env, *args, **kwargs)
5719
+ def __init__(self, name: str = None, monitor: Any = True, fill: Iterable = None, capacity: float = inf, env: "Environment" = None, *args, **kwargs) -> None:
5720
+ super().__init__(name=name, monitor=monitor,fill=None,capacity=capacity, env=env, *args, **kwargs)
5721
+
5719
5722
  with self.env.suppress_trace():
5720
5723
  self._to_store_requesters = Queue(f"{name}.to_store_requesters", env=env)
5721
5724
  self._to_store_requesters._isinternal = True
5722
5725
  self._from_store_requesters = Queue(f"{name}.from_store_requesters", env=env)
5723
5726
  self._from_store_requesters._isinternal = True
5724
5727
 
5725
- self.setup(*args, **kwargs)
5728
+ if fill is not None: # this cannot be done by Queue.__init__ as the requesters are not defined at that time
5729
+ with self.env.suppress_trace():
5730
+ for c in fill:
5731
+ c.enter(self)
5726
5732
 
5727
5733
  def set_capacity(self, cap: float) -> None:
5728
5734
  """
@@ -26796,7 +26802,7 @@ class ImageContainer:
26796
26802
  if not (0 <= t_from < t_to):
26797
26803
  raise ValueError(f"animation_from={t_from} not with 0 and animation_to={t_to}")
26798
26804
  if t_to > self._duration:
26799
- raise ValueError(f"animation_to={t_to} > duration={duration}")
26805
+ raise ValueError(f"animation_to={t_to} > duration={self._duration}")
26800
26806
  if pingpong:
26801
26807
  interval = 2 * (t_to - t_from)
26802
26808
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: salabim
3
- Version: 24.0.11.post0
3
+ Version: 24.0.12
4
4
  Summary: salabim - discrete event simulation in Python
5
5
  Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
6
6
  Project-URL: Homepage, https://salabim.org
@@ -0,0 +1,10 @@
1
+ salabim/DejaVuSansMono.ttf,sha256=Z_oIXp5yp1Zaw2y2p3vaxwHhjHpG0MFbmwhxSh4aIEI,335068
2
+ salabim/LICENSE.txt,sha256=qHlBa-POyexatCxDTjSKMlYtkBFQDn9lu-YV_1L6V0U,1106
3
+ salabim/__init__.py,sha256=r7qPLvlmX0dkZDyjuTo8Jo3ex3sD1L4pmK6K5ib9vyw,56
4
+ salabim/calibri.ttf,sha256=RWpf8Uo31RfvGGNaSt9-2sXSuN87AVE_NFMRsV3LhBk,1330156
5
+ salabim/mplus-1m-regular.ttf,sha256=EuFHr90BJjuAn_r5MleJFN-WfkeWJ4tf7DweI5zr8tU,289812
6
+ salabim/salabim.py,sha256=i5fPqlJSk3PRWFFZ7Z6RVsIWRI0EwQIeaN99fu5mCV0,1097596
7
+ salabim-24.0.12.dist-info/METADATA,sha256=PlkVJ2Qk6CFySH31iSJDmGZQ2Yrzolam1TIIuwqQN3A,3450
8
+ salabim-24.0.12.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
9
+ salabim-24.0.12.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
+ salabim-24.0.12.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- salabim/DejaVuSansMono.ttf,sha256=Z_oIXp5yp1Zaw2y2p3vaxwHhjHpG0MFbmwhxSh4aIEI,335068
2
- salabim/LICENSE.txt,sha256=qHlBa-POyexatCxDTjSKMlYtkBFQDn9lu-YV_1L6V0U,1106
3
- salabim/__init__.py,sha256=r7qPLvlmX0dkZDyjuTo8Jo3ex3sD1L4pmK6K5ib9vyw,56
4
- salabim/calibri.ttf,sha256=RWpf8Uo31RfvGGNaSt9-2sXSuN87AVE_NFMRsV3LhBk,1330156
5
- salabim/mplus-1m-regular.ttf,sha256=EuFHr90BJjuAn_r5MleJFN-WfkeWJ4tf7DweI5zr8tU,289812
6
- salabim/salabim.py,sha256=OS8-t8T0hAAM4-VScSc4cJQSw1od-Grb2qZVCa1EJ_0,1097255
7
- salabim-24.0.11.post0.dist-info/METADATA,sha256=nwX2_geOVzA3laKSeaLwg0_oxb_uaGy-cjUaIm7txBs,3456
8
- salabim-24.0.11.post0.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
9
- salabim-24.0.11.post0.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
- salabim-24.0.11.post0.dist-info/RECORD,,