salabim 24.0.14.post4__tar.gz → 24.0.16__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {salabim-24.0.14.post4 → salabim-24.0.16}/PKG-INFO +1 -1
- {salabim-24.0.14.post4 → salabim-24.0.16}/pyproject.toml +1 -1
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim/salabim.py +40 -27
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim.egg-info/PKG-INFO +1 -1
- {salabim-24.0.14.post4 → salabim-24.0.16}/README.md +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim/DejaVuSansMono.ttf +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim/LICENSE.txt +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim/__init__.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim/calibri.ttf +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim/mplus-1m-regular.ttf +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim.egg-info/SOURCES.txt +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim.egg-info/dependency_links.txt +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/salabim.egg-info/top_level.txt +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/setup.cfg +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test salabim.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_cap_now.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_componentgenerator.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_datetime.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_distributions.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_misc.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_monitor.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_process.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_queue.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_state.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_store.py +0 -0
- {salabim-24.0.14.post4 → salabim-24.0.16}/tests/test_timeunit.py +0 -0
@@ -8,7 +8,7 @@ authors = [
|
|
8
8
|
{name = "Ruud van der Ham", email = "rt.van.der.ham@gmail.com"}
|
9
9
|
]
|
10
10
|
description = "salabim - discrete event simulation in Python"
|
11
|
-
version = "24.0.
|
11
|
+
version = "24.0.16"
|
12
12
|
readme = "README.md"
|
13
13
|
requires-python = ">=3.7"
|
14
14
|
dependencies = [
|
@@ -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.
|
10
|
+
__version__ = "24.0.16"
|
11
11
|
|
12
12
|
import heapq
|
13
13
|
import random
|
@@ -7879,11 +7879,11 @@ by adding:
|
|
7879
7879
|
|
7880
7880
|
Note
|
7881
7881
|
----
|
7882
|
-
The component has to be scheduled.
|
7882
|
+
The component has to be scheduled or interrupted.
|
7883
7883
|
|
7884
7884
|
Use resume() to resume
|
7885
7885
|
"""
|
7886
|
-
if self.status.value
|
7886
|
+
if self.status.value not in (scheduled, interrupted):
|
7887
7887
|
raise ValueError(self.name() + " component not scheduled")
|
7888
7888
|
self.set_mode(mode)
|
7889
7889
|
if self.status.value == interrupted:
|
@@ -11725,14 +11725,20 @@ class Environment:
|
|
11725
11725
|
format="GIF",
|
11726
11726
|
)
|
11727
11727
|
else:
|
11728
|
-
|
11729
|
-
|
11730
|
-
|
11731
|
-
|
11732
|
-
|
11733
|
-
|
11734
|
-
|
11735
|
-
|
11728
|
+
for _ in range(2): # normally runs only once
|
11729
|
+
try:
|
11730
|
+
self._images[0].save(
|
11731
|
+
self._video_name,
|
11732
|
+
disposal=2,
|
11733
|
+
save_all=True,
|
11734
|
+
append_images=self._images[1:],
|
11735
|
+
duration=round(1000 / self._real_fps),
|
11736
|
+
optimize=False,
|
11737
|
+
)
|
11738
|
+
break
|
11739
|
+
except ValueError: # prevent bug in Python 3.13
|
11740
|
+
self._images=[image.convert("RGB") for image in self._images]
|
11741
|
+
|
11736
11742
|
else:
|
11737
11743
|
if PythonInExcel or AnacondaCode:
|
11738
11744
|
with b64_file_handler(self._video_name, mode="b", result=_pie_result) as f:
|
@@ -11747,15 +11753,20 @@ class Environment:
|
|
11747
11753
|
format="GIF",
|
11748
11754
|
)
|
11749
11755
|
else:
|
11750
|
-
|
11751
|
-
|
11752
|
-
|
11753
|
-
|
11754
|
-
|
11755
|
-
|
11756
|
-
|
11757
|
-
|
11758
|
-
|
11756
|
+
for _ in range(2): # normally runs only once
|
11757
|
+
try:
|
11758
|
+
|
11759
|
+
self._images[0].save(
|
11760
|
+
self._video_name,
|
11761
|
+
disposal=2,
|
11762
|
+
save_all=True,
|
11763
|
+
append_images=self._images[1:],
|
11764
|
+
loop=self._video_repeat,
|
11765
|
+
duration=round(1000 / self._real_fps),
|
11766
|
+
optimize=False,
|
11767
|
+
)
|
11768
|
+
except ValueError: # prevent bug in Python 3.13
|
11769
|
+
self._images=[image.convert("RGB") for image in self._images]
|
11759
11770
|
|
11760
11771
|
del self._images
|
11761
11772
|
elif self._video_out == "png":
|
@@ -11804,7 +11815,6 @@ class Environment:
|
|
11804
11815
|
ao.make_pil_image(self.t())
|
11805
11816
|
if ao._image_visible and (include_topleft or not ao.getattr("in_topleft", False)):
|
11806
11817
|
image.paste(ao._image, (int(ao._image_x), int(self._height - ao._image_y - ao._image.size[1])), ao._image.convert("RGBA"))
|
11807
|
-
|
11808
11818
|
return image.convert(mode)
|
11809
11819
|
|
11810
11820
|
def insert_frame(self, image: Any, number_of_frames: int = 1) -> None:
|
@@ -11819,6 +11829,8 @@ class Environment:
|
|
11819
11829
|
nuumber_of_frames: int
|
11820
11830
|
Number of 1/30 second long frames to be inserted
|
11821
11831
|
"""
|
11832
|
+
|
11833
|
+
|
11822
11834
|
if self._video_out is None:
|
11823
11835
|
raise ValueError("video not set")
|
11824
11836
|
if isinstance(image, (Path, str)):
|
@@ -11844,6 +11856,7 @@ class Environment:
|
|
11844
11856
|
open_cv_image = cv2.cvtColor(numpy.array(image), cv2.COLOR_RGB2BGR)
|
11845
11857
|
self._video_out.write(open_cv_image)
|
11846
11858
|
|
11859
|
+
|
11847
11860
|
def _save_frame(self):
|
11848
11861
|
self._exclude_from_animation = "not in video"
|
11849
11862
|
image = self._capture_image("RGBA", self._video_mode)
|
@@ -25118,7 +25131,7 @@ def resize_with_pad(im, target_width, target_height):
|
|
25118
25131
|
"""
|
25119
25132
|
Resize PIL image keeping ratio and using black background.
|
25120
25133
|
"""
|
25121
|
-
if im.height ==
|
25134
|
+
if im.height == target_height and im.width == target_width:
|
25122
25135
|
return im
|
25123
25136
|
target_ratio = target_height / target_width
|
25124
25137
|
im_ratio = im.height / im.width
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|