salabim 24.0.15__tar.gz → 24.0.17__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {salabim-24.0.15 → salabim-24.0.17}/PKG-INFO +1 -1
- {salabim-24.0.15 → salabim-24.0.17}/pyproject.toml +1 -1
- {salabim-24.0.15 → salabim-24.0.17}/salabim/salabim.py +41 -29
- {salabim-24.0.15 → salabim-24.0.17}/salabim.egg-info/PKG-INFO +1 -1
- {salabim-24.0.15 → salabim-24.0.17}/README.md +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim/DejaVuSansMono.ttf +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim/LICENSE.txt +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim/__init__.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim/calibri.ttf +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim/mplus-1m-regular.ttf +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim.egg-info/SOURCES.txt +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim.egg-info/dependency_links.txt +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/salabim.egg-info/top_level.txt +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/setup.cfg +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test salabim.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_cap_now.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_componentgenerator.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_datetime.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_distributions.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_misc.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_monitor.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_process.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_queue.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_state.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/tests/test_store.py +0 -0
- {salabim-24.0.15 → salabim-24.0.17}/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.17"
|
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.17"
|
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:
|
@@ -7956,7 +7956,6 @@ by adding:
|
|
7956
7956
|
lineno = self.lineno_txt(add_at=True)
|
7957
7957
|
self.env.print_trace("", "", self.name() + " resume (" + self.status() + ")", merge_blanks(lineno, self._modetxt()))
|
7958
7958
|
if self.status.value == scheduled:
|
7959
|
-
reason = "hold"
|
7960
7959
|
self._reschedule(self.env._now + self._remaining_duration, priority, urgent, "hold", False)
|
7961
7960
|
else:
|
7962
7961
|
raise Exception(self.name() + " unexpected interrupted_status", self.status.value())
|
@@ -9066,7 +9065,7 @@ by adding:
|
|
9066
9065
|
honored = False
|
9067
9066
|
break
|
9068
9067
|
elif valuetype == 1:
|
9069
|
-
if eval(value.replace("$", "state._value")):
|
9068
|
+
if not eval(value.replace("$", "state._value")):
|
9070
9069
|
honored = False
|
9071
9070
|
break
|
9072
9071
|
elif valuetype == 2:
|
@@ -11725,14 +11724,20 @@ class Environment:
|
|
11725
11724
|
format="GIF",
|
11726
11725
|
)
|
11727
11726
|
else:
|
11728
|
-
|
11729
|
-
|
11730
|
-
|
11731
|
-
|
11732
|
-
|
11733
|
-
|
11734
|
-
|
11735
|
-
|
11727
|
+
for _ in range(2): # normally runs only once
|
11728
|
+
try:
|
11729
|
+
self._images[0].save(
|
11730
|
+
self._video_name,
|
11731
|
+
disposal=2,
|
11732
|
+
save_all=True,
|
11733
|
+
append_images=self._images[1:],
|
11734
|
+
duration=round(1000 / self._real_fps),
|
11735
|
+
optimize=False,
|
11736
|
+
)
|
11737
|
+
break
|
11738
|
+
except ValueError: # prevent bug in Python 3.13
|
11739
|
+
self._images=[image.convert("RGB") for image in self._images]
|
11740
|
+
|
11736
11741
|
else:
|
11737
11742
|
if PythonInExcel or AnacondaCode:
|
11738
11743
|
with b64_file_handler(self._video_name, mode="b", result=_pie_result) as f:
|
@@ -11747,15 +11752,20 @@ class Environment:
|
|
11747
11752
|
format="GIF",
|
11748
11753
|
)
|
11749
11754
|
else:
|
11750
|
-
|
11751
|
-
|
11752
|
-
|
11753
|
-
|
11754
|
-
|
11755
|
-
|
11756
|
-
|
11757
|
-
|
11758
|
-
|
11755
|
+
for _ in range(2): # normally runs only once
|
11756
|
+
try:
|
11757
|
+
|
11758
|
+
self._images[0].save(
|
11759
|
+
self._video_name,
|
11760
|
+
disposal=2,
|
11761
|
+
save_all=True,
|
11762
|
+
append_images=self._images[1:],
|
11763
|
+
loop=self._video_repeat,
|
11764
|
+
duration=round(1000 / self._real_fps),
|
11765
|
+
optimize=False,
|
11766
|
+
)
|
11767
|
+
except ValueError: # prevent bug in Python 3.13
|
11768
|
+
self._images=[image.convert("RGB") for image in self._images]
|
11759
11769
|
|
11760
11770
|
del self._images
|
11761
11771
|
elif self._video_out == "png":
|
@@ -11804,7 +11814,6 @@ class Environment:
|
|
11804
11814
|
ao.make_pil_image(self.t())
|
11805
11815
|
if ao._image_visible and (include_topleft or not ao.getattr("in_topleft", False)):
|
11806
11816
|
image.paste(ao._image, (int(ao._image_x), int(self._height - ao._image_y - ao._image.size[1])), ao._image.convert("RGBA"))
|
11807
|
-
|
11808
11817
|
return image.convert(mode)
|
11809
11818
|
|
11810
11819
|
def insert_frame(self, image: Any, number_of_frames: int = 1) -> None:
|
@@ -11819,6 +11828,8 @@ class Environment:
|
|
11819
11828
|
nuumber_of_frames: int
|
11820
11829
|
Number of 1/30 second long frames to be inserted
|
11821
11830
|
"""
|
11831
|
+
|
11832
|
+
|
11822
11833
|
if self._video_out is None:
|
11823
11834
|
raise ValueError("video not set")
|
11824
11835
|
if isinstance(image, (Path, str)):
|
@@ -11844,6 +11855,7 @@ class Environment:
|
|
11844
11855
|
open_cv_image = cv2.cvtColor(numpy.array(image), cv2.COLOR_RGB2BGR)
|
11845
11856
|
self._video_out.write(open_cv_image)
|
11846
11857
|
|
11858
|
+
|
11847
11859
|
def _save_frame(self):
|
11848
11860
|
self._exclude_from_animation = "not in video"
|
11849
11861
|
image = self._capture_image("RGBA", self._video_mode)
|
@@ -25118,7 +25130,7 @@ def resize_with_pad(im, target_width, target_height):
|
|
25118
25130
|
"""
|
25119
25131
|
Resize PIL image keeping ratio and using black background.
|
25120
25132
|
"""
|
25121
|
-
if im.height ==
|
25133
|
+
if im.height == target_height and im.width == target_width:
|
25122
25134
|
return im
|
25123
25135
|
target_ratio = target_height / target_width
|
25124
25136
|
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
|