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

Tracker API variable arguments bug #138

Open
JoOkuma opened this issue Aug 31, 2024 · 0 comments
Open

Tracker API variable arguments bug #138

JoOkuma opened this issue Aug 31, 2024 · 0 comments

Comments

@JoOkuma
Copy link
Member

JoOkuma commented Aug 31, 2024

When not using kwargs,

    tracker = Tracker(cfg)
    tracker.track(foreground, contours)

it results in the error below

Traceback (most recent call last):
  File "/Users/jordao.bragantini/Softwares/ultrack/ultrack/core/_test/test_autotune.py", line 50, in <module>
    main()
  File "/Users/jordao.bragantini/Softwares/ultrack/ultrack/core/_test/test_autotune.py", line 35, in main
    tracker.track(foreground, contours)
  File "/Users/jordao.bragantini/Softwares/ultrack/ultrack/core/tracker.py", line 97, in track
    track(config=self.config, *args, **kwargs)
  File "/Users/jordao.bragantini/Softwares/ultrack/ultrack/utils/deprecation.py", line 36, in _update_from_dict
    return func(*args, **kwargs)
  File "/Users/jordao.bragantini/Softwares/ultrack/ultrack/utils/deprecation.py", line 36, in _update_from_dict
    return func(*args, **kwargs)
TypeError: track() got multiple values for argument 'config'

I think they should not take variable args without keywords (e.g. *args), for example:

    @functools.wraps(track)
    def track(self, *args, **kwargs) -> None:
        track(config=self.config, *args, **kwargs)
        self.status = TrackerStatus.SOLVED

cc @ilan-theodoro

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

1 participant