Giter Club home page Giter Club logo

miros's People

Contributors

aleph2c avatar pajacobson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

julrichkieffer

miros's Issues

class ThreadSafeAttribute from unit tests results in None for fdata.lines

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 

Is there a way to pause and resume a workflow?

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?

"Coverage" cannot collect test class

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 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.