Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API for measurement.__iter__() is broken #1748

Closed
danieldube opened this issue Sep 27, 2024 · 3 comments
Closed

Python API for measurement.__iter__() is broken #1748

danieldube opened this issue Sep 27, 2024 · 3 comments

Comments

@danieldube
Copy link

danieldube commented Sep 27, 2024

Problem Description

When I run the following Python code, I would expect to iterate over the measurement channels. Instead, a TypeError is raised.

    measurement = Measurement(str(measurement_path))
    for channel in measurement:
        for message in channel:
            print(message)
Traceback (most recent call last):
  File "/home/uidg4302/projects/cls_dspace/python/src/tools/analyze_acc.py", line 18, in <module>
    main()
  File "/home/uidg4302/python/cls_venv/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/uidg4302/python/cls_venv/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/uidg4302/python/cls_venv/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/uidg4302/python/cls_venv/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/uidg4302/projects/cls_dspace/python/src/tools/analyze_acc.py", line 12, in main
    for channel in measurement:
  File "/home/uidg4302/python/cls_venv/lib/python3.8/site-packages/ecal/measurement/measurement.py", line 215, in __iter__
    return Measurement.Iterator(self)
TypeError: __init__() missing 1 required positional argument: 'channel_type'

I think the Measurement.__init__() has a bug and is not using the constructor for Measurement.Iterator correctly.

Please see:

return Measurement.Iterator(self)

and:

def __init__(self, measurement, channel_type):

How to reproduce

See above how to reproduce the issue.

How did you get eCAL?

Download from Release Page

Environment

-eCAL: 5.12.6
-OS: Ubuntu 20.04
-Python: 3.8
-Compiler and CMake: not applicable

eCAL System Information

No response

@KerstinKeller
Copy link
Contributor

Thanks for reporting. This issue was introduced with fe84826 and will be fixed ASAP.

@danieldube
Copy link
Author

Thanks a lot for the fast reply, Kerstin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants