To install this Python statechart library:
pip3 install miros
The full documentation can be found here
Python statecharts
Home Page: https://aleph2c.github.io/miros/html/
To install this Python statechart library:
pip3 install miros
The full documentation can be found here
I think it would be good to add links to testing recipe on Testing page, because when I open Testing page and see nothing it is a bit disappointing.
I was interested in collecting test coverage for the miros code.
While running the test with "coverage run -m pytest" I get the following:
miros/examples/single_unit_three_stage_charger_3_test.py:28 /home/xxx/play/PyProjects/miros/miros/examples/single_unit_three_stage_charger_3_test.py:28: PytestCollectionWarning: cannot collect test class 'TestOutputCsv' because it has a __init__ constructor (from: miros/examples/single_unit_three_stage_charger_3_test.py) class TestOutputCsv:
The problem is solved at https://docs.pytest.org/en/latest/warnings.html
For example, pytest will emit a warning if it encounters a class that matches
python_classes but also defines an __init__ constructor, as this prevents the
class from being instantiated
The solution is to name the class at line 28, "TestOutputCsv" to something like "XTestOutputCsvX".
These two files need changing:
miros/examples/single_unit_three_stage_charger_3_test.py
miros/examples/single_unit_three_stage_charger_4_test.py
My configuration:
Linux, Centos 7 python --version Python 3.7.3 coverage --version Coverage.py, version 4.5.3 with C extension Documentation at https://coverage.readthedocs.io pytest --version This is pytest version 5.0.1, setuptools registered plugins: pytest-cov-2.7.1 pytest-httpbin-1.0.0
When I ran unit tests under coverage, attempts to access the previous frame in class
ThreadSafeAttribute in method get the call at line 42 returns fdata.lines as None.
The test is miros/test/thread_safe_attributes_test.py:536.
The problem is in miros/miros/thread_safe_atributes.py.
I have slightly modified the code starting at line 41 in miros/miros/thread_safe_atributes.py:
fdata = FrameData(*inspect.getframeinfo(previous_frame)) previous_line = "FooBar" try: previous_line = fdata.lines[0] # Original line except TypeError as err: print(f"fdata={fdata}: {err}") print(f"previous_frame: {previous_frame}") #raise if self.is_not_atomic(previous_line):
This "trace" reports: (slightly edited)
fdata=FrameData(filename='.../miros/test/thread_safe_attributes_test.py', line_number=270, function_name='thread_runner', lines=None, index=None): 'NoneType' object is not subscriptable
This error gets repeated many times before reporting:
Fatal Python error: could not acquire lock for <_io.BufferedWriter name=''> at interpreter shutdown, possibly due to daemon threads
Without the previous_line = "FooBar"
the test would hang and I had to
kill it with ^C. This ^C reports:
^CException ignored in: Traceback (most recent call last): File "/home/cecilm/anaconda3/envs/py37/lib/python3.7/threading.py", line 1281, in _shutdown t.join() File "/home/cecilm/anaconda3/envs/py37/lib/python3.7/threading.py", line 1032, in join self._wait_for_tstate_lock() File "/home/cecilm/anaconda3/envs/py37/lib/python3.7/threading.py", line 1048, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt
Obviously the code is dead locked.
I downloaded the miros repo from github yesterday, Jan 23, 2020.
My configuration:
python --version Python 3.7.3 coverage --version Coverage.py, version 4.5.3 with C extension Documentation at https://coverage.readthedocs.io pytest --version This is pytest version 5.0.1, setuptools registered plugins: pytest-cov-2.7.1 pytest-httpbin-1.0.0
I'm interested in exposing transitions as links in a web app, but I cannot find any examples after a quick glance that would indicate whether or not miros allows for pausing and resuming workflows. Does miros allow for this use case?
I'm sorry for rushing the previous issue.
skipped ** for the header Link
should be "there are" instead of "their are" I guess Link
instead of oven.list_spy
, there should be oven.live_spy
Link
is owen.start_at(door_closed)
missing before oven.post_fifo
call? https://aleph2c.github.io/miros/html/zero_to_one.html#zero-to-one-zero-to-one:~:text=.spy())-,def%20spy_on_buzz()%3A%0A%20%20oven%20%3D%20ToasterOvenMock(name%3D%22oven%22),-%23%20Send%20the%20buzz
should there be "toasting" instead of "toaster"? Link
lines 256-260, 278-282 should be highlighted Link
lines 40-41 should be highlighted Link
the entire "buzz" method should be highlighted Link
the ToasterOvenMock(ToasterOven).__init__
method should be highlighted too Link
lines 322-323 should be highlighted Link
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.