salabim 24.0.6__py3-none-any.whl → 24.0.7__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.6"
10
+ __version__ = "24.0.7"
11
11
 
12
12
  import heapq
13
13
  import random
@@ -10057,6 +10057,9 @@ class Environment:
10057
10057
  This is particularly useful when running a simulation on a server.
10058
10058
  Note that this will show a slight performance increase, when creating videos.
10059
10059
 
10060
+ Any valid parameter for Environment.animation_parameters() will be forwarded to animation_parameters(), e.g.
10061
+ env = sim.Environment(trace=True, animation=True, speed=5)
10062
+
10060
10063
  Note
10061
10064
  ----
10062
10065
  The trace may be switched on/off later with trace
@@ -10089,6 +10092,7 @@ class Environment:
10089
10092
  if isdefault_env:
10090
10093
  name = "default environment"
10091
10094
  _set_name(name, Environment._nameserialize, self)
10095
+
10092
10096
  self._nameserializeMonitor = {} # required here for to_freeze functionality
10093
10097
  self._time_unit = _time_unit_lookup(time_unit)
10094
10098
  self._time_unit_name = time_unit
@@ -10239,6 +10243,15 @@ class Environment:
10239
10243
 
10240
10244
  self.an_clocktext()
10241
10245
 
10246
+ ap_parameters= [parameter for parameter in inspect.signature(self.animation_parameters).parameters]
10247
+ ap_kwargs={}
10248
+ for k,v in list(kwargs.items()):
10249
+ if k in ap_parameters:
10250
+ del kwargs[k]
10251
+ ap_kwargs[k]=v
10252
+ if ap_kwargs:
10253
+ self.animation_parameters(**ap_kwargs)
10254
+
10242
10255
  self.setup(*args, **kwargs)
10243
10256
 
10244
10257
  # ENVIRONMENT ANNOTATION START
@@ -26664,7 +26677,10 @@ class ImageContainer:
26664
26677
 
26665
26678
  def init(self, spec):
26666
26679
  can_animate(try_only=True) # to load PIL
26680
+
26667
26681
  if isinstance(spec, (str, Path)):
26682
+ spec=str(spec) # to process Path correctly
26683
+
26668
26684
  if spec == "":
26669
26685
  im = Image.new("RGBA", (1, 1), (0, 0, 0, 0))
26670
26686
  # (0, 0) raises an error on some platforms
@@ -27102,7 +27118,7 @@ reset()
27102
27118
  set_environment_aliases()
27103
27119
 
27104
27120
  if __name__ == "__main__":
27105
- sys.path.insert(0, str(Path.cwd() / "misc"))
27121
+ sys.path.insert(0, str(Path(__file__).parent / ".." / "misc"))
27106
27122
  try:
27107
27123
  import salabim_exp
27108
27124
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: salabim
3
- Version: 24.0.6
3
+ Version: 24.0.7
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
@@ -3,8 +3,8 @@ salabim/LICENSE.txt,sha256=qHlBa-POyexatCxDTjSKMlYtkBFQDn9lu-YV_1L6V0U,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=SZiOHDFUZuBReQtdElsUmOsDdPBYjhOFo-9nXGypjxk,1094051
7
- salabim-24.0.6.dist-info/METADATA,sha256=u32xh-FoKdDNMsNEc7lVRunBKk2Yfvd7Frujwlx7NFQ,3449
8
- salabim-24.0.6.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
9
- salabim-24.0.6.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
- salabim-24.0.6.dist-info/RECORD,,
6
+ salabim/salabim.py,sha256=4Us0WVX4WgUAFPJHhqhqNy4KIbvUVT8y6OzARNKxcdY,1094652
7
+ salabim-24.0.7.dist-info/METADATA,sha256=WPcaUjh7FP9IU0rPz0LhpjadyuclSJ3nppG4jV5NMhs,3449
8
+ salabim-24.0.7.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
9
+ salabim-24.0.7.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
10
+ salabim-24.0.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (70.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5