salabim 25.0.11__py3-none-any.whl → 25.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- salabim/salabim.py +28 -28
- {salabim-25.0.11.dist-info → salabim-25.0.13.dist-info}/METADATA +1 -1
- {salabim-25.0.11.dist-info → salabim-25.0.13.dist-info}/RECORD +5 -5
- {salabim-25.0.11.dist-info → salabim-25.0.13.dist-info}/WHEEL +0 -0
- {salabim-25.0.11.dist-info → salabim-25.0.13.dist-info}/top_level.txt +0 -0
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__ = "25.0.
|
10
|
+
__version__ = "25.0.13"
|
11
11
|
import heapq
|
12
12
|
import random
|
13
13
|
import time
|
@@ -54,7 +54,7 @@ Windows = sys.platform.startswith("win")
|
|
54
54
|
MacOS = platform.system == "Darwin"
|
55
55
|
PyPy = platform.python_implementation() == "PyPy"
|
56
56
|
Chromebook = "penguin" in platform.uname()
|
57
|
-
|
57
|
+
pyodide = "pyodide" in sys.modules
|
58
58
|
|
59
59
|
_color_name_to_ANSI = dict(
|
60
60
|
dark_black="\033[0;30m",
|
@@ -122,7 +122,7 @@ if Pythonista:
|
|
122
122
|
inf = float("inf")
|
123
123
|
nan = float("nan")
|
124
124
|
|
125
|
-
if Pythonista or
|
125
|
+
if Pythonista or pyodide:
|
126
126
|
_yieldless = False
|
127
127
|
else:
|
128
128
|
_yieldless = True
|
@@ -163,8 +163,8 @@ def yieldless(value: bool = None) -> bool:
|
|
163
163
|
if value:
|
164
164
|
if Pythonista:
|
165
165
|
raise ValueError("yiedless mode is not allowed under Pythonista")
|
166
|
-
if
|
167
|
-
raise ValueError("yiedless mode is not allowed under
|
166
|
+
if pyodide:
|
167
|
+
raise ValueError("yiedless mode is not allowed under pyodide")
|
168
168
|
_yieldless = value
|
169
169
|
return _yieldless
|
170
170
|
|
@@ -2897,7 +2897,7 @@ class Monitor:
|
|
2897
2897
|
|
2898
2898
|
if False, all parameters are scaled for positioning and scaling
|
2899
2899
|
objects.
|
2900
|
-
|
2900
|
+
|
2901
2901
|
Returns
|
2902
2902
|
-------
|
2903
2903
|
reference to AnimateMonitor object : AnimateMonitor
|
@@ -3678,7 +3678,7 @@ class AnimateMonitor(DynamicClass):
|
|
3678
3678
|
|
3679
3679
|
if False, all parameters are scaled for positioning and scaling
|
3680
3680
|
objects.
|
3681
|
-
|
3681
|
+
|
3682
3682
|
Note
|
3683
3683
|
----
|
3684
3684
|
All measures are in screen coordinates
|
@@ -4412,7 +4412,7 @@ class Queue:
|
|
4412
4412
|
|
4413
4413
|
if False, all parameters are scaled for positioning and scaling
|
4414
4414
|
objects.
|
4415
|
-
|
4415
|
+
|
4416
4416
|
Returns
|
4417
4417
|
-------
|
4418
4418
|
reference to AnimationQueue object : AnimationQueue
|
@@ -7680,7 +7680,6 @@ Maybe this a non yieldless model. In that case:
|
|
7680
7680
|
- run salabim_unyield.py"""
|
7681
7681
|
)
|
7682
7682
|
self.env._any_yield = True
|
7683
|
-
self._process = p(**kwargs)
|
7684
7683
|
self._process_isgenerator = True
|
7685
7684
|
else:
|
7686
7685
|
if not self.env._yieldless and not self.env._any_yield:
|
@@ -7699,7 +7698,7 @@ by adding:
|
|
7699
7698
|
|
7700
7699
|
extra = "process=" + process_name
|
7701
7700
|
if self.env._yieldless:
|
7702
|
-
self._glet = greenlet.greenlet(self._process, parent=self.env._glet)
|
7701
|
+
self._glet = greenlet.greenlet(lambda: self._process(**kwargs), parent=self.env._glet) # ***
|
7703
7702
|
|
7704
7703
|
if self.status.value != current:
|
7705
7704
|
self._remove()
|
@@ -10605,11 +10604,11 @@ class Environment:
|
|
10605
10604
|
self._zoom_factor = 1.1
|
10606
10605
|
|
10607
10606
|
self.last_s0 = ""
|
10608
|
-
if
|
10607
|
+
if pyodide:
|
10609
10608
|
if blind_animation is None:
|
10610
10609
|
blind_animation = True
|
10611
10610
|
if not blind_animation:
|
10612
|
-
raise ValueError("blind_animation may not be False under
|
10611
|
+
raise ValueError("blind_animation may not be False under pyodide")
|
10613
10612
|
else:
|
10614
10613
|
if blind_animation is None:
|
10615
10614
|
blind_animation = False
|
@@ -13410,6 +13409,12 @@ class Environment:
|
|
13410
13409
|
self.step()
|
13411
13410
|
|
13412
13411
|
def do_simulate_and_animate(self):
|
13412
|
+
self._x0z = self._x0
|
13413
|
+
self._y0z = self._y0
|
13414
|
+
self._x1z = self._x1
|
13415
|
+
self._y1z = self._y1
|
13416
|
+
self._scalez = self._last_scalez = self._scale
|
13417
|
+
|
13413
13418
|
if Pythonista:
|
13414
13419
|
if self._animate3d:
|
13415
13420
|
self.running = False
|
@@ -13420,12 +13425,7 @@ class Environment:
|
|
13420
13425
|
raise SimulationStopped
|
13421
13426
|
else:
|
13422
13427
|
self.root.after(0, self.simulate_and_animate_loop)
|
13423
|
-
self._x0z = self._x0
|
13424
|
-
self._y0z = self._y0
|
13425
|
-
self._x1z = self._x1
|
13426
|
-
self._y1z = self._y1
|
13427
13428
|
|
13428
|
-
self._scalez = self._last_scalez = self._scale
|
13429
13429
|
self.root.mainloop()
|
13430
13430
|
if self._animate and self.running:
|
13431
13431
|
if self._video:
|
@@ -18348,7 +18348,7 @@ class AnimateQueue(DynamicClass):
|
|
18348
18348
|
if ((max_length is not None) and n >= max_length) or not self.visible_t:
|
18349
18349
|
break
|
18350
18350
|
|
18351
|
-
if c in prev_aos and self.env._scalez != self.env._last_scalez:
|
18351
|
+
if c in prev_aos and self.env._scalez != self.env._last_scalez: # if scale changed (due to zooming), rerender the animation_objects
|
18352
18352
|
animation_objects = self.current_aos[c] = prev_aos[c]
|
18353
18353
|
del prev_aos[c]
|
18354
18354
|
else:
|
@@ -18495,7 +18495,7 @@ class Animate3dQueue(DynamicClass):
|
|
18495
18495
|
|
18496
18496
|
if False, all parameters are scaled for positioning and scaling
|
18497
18497
|
objects.
|
18498
|
-
|
18498
|
+
|
18499
18499
|
Note
|
18500
18500
|
----
|
18501
18501
|
All parameters, apart from queue, id, arg, screen_coordinates and parent can be specified as:
|
@@ -25160,7 +25160,7 @@ def _check_overlapping_parameters(obj, method_name0, method_name1, process=None)
|
|
25160
25160
|
|
25161
25161
|
@functools.lru_cache()
|
25162
25162
|
def _screen_dimensions():
|
25163
|
-
if
|
25163
|
+
if pyodide:
|
25164
25164
|
return 1024, 768
|
25165
25165
|
if Pythonista:
|
25166
25166
|
screen_width, screen_height = ui.get_screen_size()
|
@@ -27188,7 +27188,7 @@ def _std_fonts():
|
|
27188
27188
|
|
27189
27189
|
|
27190
27190
|
def fonts():
|
27191
|
-
if
|
27191
|
+
if pyodide:
|
27192
27192
|
return []
|
27193
27193
|
if not hasattr(fonts, "font_list"):
|
27194
27194
|
fonts.font_list = []
|
@@ -27461,7 +27461,7 @@ def can_animate(try_only: bool = True) -> bool:
|
|
27461
27461
|
except ImportError:
|
27462
27462
|
ImageGrab = None
|
27463
27463
|
|
27464
|
-
if not Pythonista and not
|
27464
|
+
if not Pythonista and not pyodide:
|
27465
27465
|
from PIL import ImageTk
|
27466
27466
|
except ImportError:
|
27467
27467
|
if try_only:
|
@@ -27470,7 +27470,7 @@ def can_animate(try_only: bool = True) -> bool:
|
|
27470
27470
|
|
27471
27471
|
g.dummy_image = Image.new("RGBA", (1, 1), (0, 0, 0, 0))
|
27472
27472
|
|
27473
|
-
if not Pythonista and not
|
27473
|
+
if not Pythonista and not pyodide:
|
27474
27474
|
try:
|
27475
27475
|
import tkinter
|
27476
27476
|
import tkinter.font
|
@@ -3,8 +3,8 @@ salabim/LICENSE.txt,sha256=eTPlcDJz4G0096Qv-wfMjm1Wxbd4ilDlsYg5rN4HjWQ,1106
|
|
3
3
|
salabim/__init__.py,sha256=r7qPLvlmX0dkZDyjuTo8Jo3ex3sD1L4pmK6K5ib9vyw,56
|
4
4
|
salabim/calibri.ttf,sha256=RWpf8Uo31RfvGGNaSt9-2sXSuN87AVE_NFMRsV3LhBk,1330156
|
5
5
|
salabim/mplus-1m-regular.ttf,sha256=EuFHr90BJjuAn_r5MleJFN-WfkeWJ4tf7DweI5zr8tU,289812
|
6
|
-
salabim/salabim.py,sha256=
|
7
|
-
salabim-25.0.
|
8
|
-
salabim-25.0.
|
9
|
-
salabim-25.0.
|
10
|
-
salabim-25.0.
|
6
|
+
salabim/salabim.py,sha256=rLGzdIdR-47AMTFpwqiQ2Z-iKp_waKtxvedaANc8MxU,1126159
|
7
|
+
salabim-25.0.13.dist-info/METADATA,sha256=fxORqLZqIV-hnDvVbZDAywd65VXly4TwTZIkXQqDYoI,3400
|
8
|
+
salabim-25.0.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
+
salabim-25.0.13.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
|
10
|
+
salabim-25.0.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|