Salabim

Latest version: v24.0.8

Safety actively analyzes 641872 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 25

24.0.8

- Bug in `Component.wait()` in *yieldless* mode caused a process to come to a standstill if the wait condition was met immediately. Fixed.

24.0.7

- In initializing Environment, it is now possible to directly present parameters for `Environment.animation_parameters`, e.g.


env = sim.Environment(trace=True, animation=True, speed=5)


is equivalent to


env = sim.Enviroment(trace=True)
env.animation_parameters(animation=True, speed=5)


or


env = sim.Enviroment(trace=True)
env.animation(True)
env.speed(5)


This can make code a bit smaller and more readable.

- Using a Path object as the spec parameter for `Environment.AnimateImage()`raised an error. Fixed.

24.0.6

From this version on, the monitor associated with a state (`State.value`) has a `value` property. In previous version only `_value` was supported.

So now, we can say


mystate.value.value += 1


as an alternative to


my_state.set(my_state() + 1)

24.0.5

- When merging monitors, all monitors had to be of the same type.
From this version on, that's not required anymore.
(Inspired by a comment by Yin Chi Chang)

- The *Monitor.as_dataframe()* now has additional parameters (in line with methods *Monitor.xt()* and *Monitor.tx()*):


ex0 : bool
if False (default), include zeroes. if True, exclude zeroes

exoff : bool
if False (default), include self.off. if True, exclude self.off's
non level monitors will return all values, regardless of exoff

force_numeric : bool
if True (default), convert non numeric tallied values numeric if possible, otherwise assume 0
if False, do not interpret x-values, return as list if type is list

add_now : bool
if True (default), the last tallied x-value and the current time is added to the result
if False, the result ends with the last tallied value and the time that was tallied
non level monitors will never add now
if now is <= last tallied value, nothing will be added, even if add_now is True


Note that `add_now` is True by default, whereas in salabim <= 24.0.4 now was not added.
(Inspired by a comment by Yin Chi Chang)

- Bug in `Environment.getfontsize_to_fit` fixed.

- Bug when in `Resource.release()` with an anonymous resource fixed.

- From this version the changelog is not anymore a .txt file, but a markdown (.md) file. This allows for more clear explanations. You can find the file changelog.md in the GitHub repo. Alternatively, the rendered changelog is available on www.salabim.org/changelog.html

Older versions

24.0.4

==========================

Although there's no functional change, this is a major upgrade,
that could result in bugs or unexpected behaviour.
Please report any bug or problem.

Internal organization completely changed. Now uses git for version
control. That means that it is much easier for the developer
to push new versions.

And for publishing on PyPI salabim now uses a pyproject.toml file.
This also makes publishing easier for the developer.

Changed the styling of the salabim logo, which will be visible on the
website, readme, manual, etc.
Also the Environment.modelname() method now shows the new styling.

24.0.2

==========================

Added functionality (0)
-----------------------

Salabim now also supports rounded rectangles, which can result in more pleasing animations.

Therefore, the spec argument (tuple) of sim.AnimateRectangle now has an optional fifth item,
which is the radius of the corners of the rounded rectangle.

The same holds for the rectangle0 and rectangle1 (tuple) parameters of sim.Animate.

Note that if the radius is too big, the radius will be adjusted.

Changed functionality (0)
-------------------------

Under Pythonista, yieldless is False by default, now.
This can be useful for models which have no active components (and just env.run() statements).

Bug fix (0)
-----------

In version 23.3.12 the naming of components, queues, etc. was changed.
Unfortunately, the role of , and . at the end of the name were swapped.
From this version, the naming/sequence number system works again as intended and documented. So
for i in range(3):
car = Car('Audi.')
print(car.name(), car.sequence_number())
for i in range(3):
car = Car('BMW,')
print(car.name(), car.sequence_number())

will now (again) result in:
Audi.0 0
Audi.1 1
Audi.2 2
BMW.1 1
BMW.2 2
BMW.3 3

Bug fix (1)
-----------

Under PyPy yieldless did not work properly. Fixed.

Clarification (0)
-----------------

The salabim documentation states that models could run much faster under PyPy.
("We have found 6 to 7 times faster execution compared to CPython.")

In practice, the performance gain is much smaller. It is not uncommon that
models run even slower under PyPy!
Therefore, the paragraph about PyPy has been removed from the documentation.

(Inspired by a comment by Luc van den Brink)

Clarification (1)
-----------------

For the alternative UI the package PySimpleGUI is required.
Just recently, PySimpleGUI has changed its license to a more restrictive one.
And for commercial applications, charges apply.
If you want to use the real open-source version (which I recommend), please install
PySimpleGUI with
pip install PySimpleGUI==4.60.5
of course, this version is not maintained any more, but the package is rather stable.

I have also cloned the old PySimpleGUIfile repository to salabim, so you can just
copy pysimplegui.py (the only required file) from that repo to your model folder.

This information is also added to the documentation.

Page 1 of 25

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.