salabim 24.0.6__tar.gz → 24.0.8__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. {salabim-24.0.6 → salabim-24.0.8}/PKG-INFO +1 -1
  2. {salabim-24.0.6 → salabim-24.0.8}/pyproject.toml +1 -1
  3. {salabim-24.0.6 → salabim-24.0.8}/salabim/salabim.py +22 -5
  4. {salabim-24.0.6 → salabim-24.0.8}/salabim.egg-info/PKG-INFO +1 -1
  5. {salabim-24.0.6 → salabim-24.0.8}/tests/test_monitor.py +4 -0
  6. {salabim-24.0.6 → salabim-24.0.8}/README.md +0 -0
  7. {salabim-24.0.6 → salabim-24.0.8}/salabim/DejaVuSansMono.ttf +0 -0
  8. {salabim-24.0.6 → salabim-24.0.8}/salabim/LICENSE.txt +0 -0
  9. {salabim-24.0.6 → salabim-24.0.8}/salabim/__init__.py +0 -0
  10. {salabim-24.0.6 → salabim-24.0.8}/salabim/calibri.ttf +0 -0
  11. {salabim-24.0.6 → salabim-24.0.8}/salabim/mplus-1m-regular.ttf +0 -0
  12. {salabim-24.0.6 → salabim-24.0.8}/salabim.egg-info/SOURCES.txt +0 -0
  13. {salabim-24.0.6 → salabim-24.0.8}/salabim.egg-info/dependency_links.txt +0 -0
  14. {salabim-24.0.6 → salabim-24.0.8}/salabim.egg-info/top_level.txt +0 -0
  15. {salabim-24.0.6 → salabim-24.0.8}/setup.cfg +0 -0
  16. {salabim-24.0.6 → salabim-24.0.8}/tests/test salabim.py +0 -0
  17. {salabim-24.0.6 → salabim-24.0.8}/tests/test_cap_now.py +0 -0
  18. {salabim-24.0.6 → salabim-24.0.8}/tests/test_componentgenerator.py +0 -0
  19. {salabim-24.0.6 → salabim-24.0.8}/tests/test_datetime.py +0 -0
  20. {salabim-24.0.6 → salabim-24.0.8}/tests/test_distributions.py +0 -0
  21. {salabim-24.0.6 → salabim-24.0.8}/tests/test_misc.py +0 -0
  22. {salabim-24.0.6 → salabim-24.0.8}/tests/test_process.py +0 -0
  23. {salabim-24.0.6 → salabim-24.0.8}/tests/test_queue.py +0 -0
  24. {salabim-24.0.6 → salabim-24.0.8}/tests/test_state.py +0 -0
  25. {salabim-24.0.6 → salabim-24.0.8}/tests/test_store.py +0 -0
  26. {salabim-24.0.6 → salabim-24.0.8}/tests/test_timeunit.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: salabim
3
- Version: 24.0.6
3
+ Version: 24.0.8
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
@@ -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.6"
11
+ version = "24.0.8"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.7"
14
14
  dependencies = [
@@ -1,13 +1,13 @@
1
- # _ _ _ ____ _ _ ___ __
2
- # ___ __ _ | | __ _ | |__ (_) _ __ ___ |___ \ | || | / _ \ / /_
3
- # / __| / _` || | / _` || '_ \ | || '_ ` _ \ __) || || |_ | | | | | '_ \
1
+ # _ _ _ ____ _ _ ___ ___
2
+ # ___ __ _ | | __ _ | |__ (_) _ __ ___ |___ \ | || | / _ \ ( _ )
3
+ # / __| / _` || | / _` || '_ \ | || '_ ` _ \ __) || || |_ | | | | / _ \
4
4
  # \__ \| (_| || || (_| || |_) || || | | | | | / __/ |__ _| _ | |_| | _ | (_) |
5
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.8"
11
11
 
12
12
  import heapq
13
13
  import random
@@ -9017,6 +9017,7 @@ by adding:
9017
9017
  self.status._value = waiting
9018
9018
  self._reschedule(scheduled_time, schedule_priority, urgent, "wait", cap_now)
9019
9019
  else:
9020
+ return # ***
9020
9021
  if self.env._yieldless:
9021
9022
  if self is self.env._current_component:
9022
9023
  self.env._glet.switch()
@@ -10057,6 +10058,9 @@ class Environment:
10057
10058
  This is particularly useful when running a simulation on a server.
10058
10059
  Note that this will show a slight performance increase, when creating videos.
10059
10060
 
10061
+ Any valid parameter for Environment.animation_parameters() will be forwarded to animation_parameters(), e.g.
10062
+ env = sim.Environment(trace=True, animation=True, speed=5)
10063
+
10060
10064
  Note
10061
10065
  ----
10062
10066
  The trace may be switched on/off later with trace
@@ -10089,6 +10093,7 @@ class Environment:
10089
10093
  if isdefault_env:
10090
10094
  name = "default environment"
10091
10095
  _set_name(name, Environment._nameserialize, self)
10096
+
10092
10097
  self._nameserializeMonitor = {} # required here for to_freeze functionality
10093
10098
  self._time_unit = _time_unit_lookup(time_unit)
10094
10099
  self._time_unit_name = time_unit
@@ -10239,6 +10244,15 @@ class Environment:
10239
10244
 
10240
10245
  self.an_clocktext()
10241
10246
 
10247
+ ap_parameters= [parameter for parameter in inspect.signature(self.animation_parameters).parameters]
10248
+ ap_kwargs={}
10249
+ for k,v in list(kwargs.items()):
10250
+ if k in ap_parameters:
10251
+ del kwargs[k]
10252
+ ap_kwargs[k]=v
10253
+ if ap_kwargs:
10254
+ self.animation_parameters(**ap_kwargs)
10255
+
10242
10256
  self.setup(*args, **kwargs)
10243
10257
 
10244
10258
  # ENVIRONMENT ANNOTATION START
@@ -26664,7 +26678,10 @@ class ImageContainer:
26664
26678
 
26665
26679
  def init(self, spec):
26666
26680
  can_animate(try_only=True) # to load PIL
26681
+
26667
26682
  if isinstance(spec, (str, Path)):
26683
+ spec=str(spec) # to process Path correctly
26684
+
26668
26685
  if spec == "":
26669
26686
  im = Image.new("RGBA", (1, 1), (0, 0, 0, 0))
26670
26687
  # (0, 0) raises an error on some platforms
@@ -27102,7 +27119,7 @@ reset()
27102
27119
  set_environment_aliases()
27103
27120
 
27104
27121
  if __name__ == "__main__":
27105
- sys.path.insert(0, str(Path.cwd() / "misc"))
27122
+ sys.path.insert(0, str(Path(__file__).parent / ".." / "misc"))
27106
27123
  try:
27107
27124
  import salabim_exp
27108
27125
  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.8
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
@@ -640,5 +640,9 @@ def test_as_dataframe_use_datetime0():
640
640
  df = level_monitor0.as_dataframe()
641
641
  df0=pd.DataFrame({"t":[0,1.3,2.5,4.8,5.0], "level monitor0.x": [0,11,12,14.5,14.5]})
642
642
  assert df0.equals(df)
643
+ df = level_monitor0.as_dataframe(add_now=False)
644
+ df0=pd.DataFrame({"t":[0,1.3,2.5,4.8], "level monitor0.x": [0,11,12,14.5]})
645
+ assert df0.equals(df)
646
+
643
647
  if __name__ == "__main__":
644
648
  pytest.main(["-vv", "-s", "-x", __file__])
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