This issue is part of unitaryHACK26. You have to be registered to complete this issue. Learn more about the PR submission process here and about unitaryHACK rules here!
A note about AI Slop: while we are open to collaboration with LLMs for unitaryHACK, fully AI-generated PRs are not acceptable. It is at the maintainers’ discretion whether or not LLM-generated PRs are the right fit for the issues, and those that appear fully AI-generated may be immediately rejected. Read unitaryHACK’s full AI Policy here
Feature details
Right now, the Tracker object has no defined __repr__ which makes it hard to interact with and debug,
>>> from pennylane import Tracker
>>> tracker = Tracker()
>>> tracker.update(a=2, b="b2", c=1)
>>> print(tracker)
<pennylane.devices.tracker.Tracker object at 0x1304e3a50>
We would like to add a readable __repr__ to this object that shows all of its relevant internals to the user,
>>> print(tracker)
Tracker(active=..., totals=..., persistent=..., ...)
Implementation
To complete this task, please do the following:
- Implement a custom
__repr__ in the Tracker class.
- Add appropriate test(s) in
tests/devices/test_tracker.py here.
Follow development questions, please ask here or consult our guide.
This issue is part of the unitaryHACK event organized by the Unitary Foundation. Please refer to the rules page of the event’s website to confirm whether you are eligible to participate. If you have any comments, questions or complaints about the event please refer to the contact information provided at the bottom of that page.
This issue is part of unitaryHACK26. You have to be registered to complete this issue. Learn more about the PR submission process here and about unitaryHACK rules here!
A note about AI Slop: while we are open to collaboration with LLMs for unitaryHACK, fully AI-generated PRs are not acceptable. It is at the maintainers’ discretion whether or not LLM-generated PRs are the right fit for the issues, and those that appear fully AI-generated may be immediately rejected. Read unitaryHACK’s full AI Policy here
Feature details
Right now, the
Trackerobject has no defined__repr__which makes it hard to interact with and debug,We would like to add a readable
__repr__to this object that shows all of its relevant internals to the user,>>> print(tracker) Tracker(active=..., totals=..., persistent=..., ...)Implementation
To complete this task, please do the following:
__repr__in theTrackerclass.tests/devices/test_tracker.pyhere.Follow development questions, please ask here or consult our guide.
This issue is part of the unitaryHACK event organized by the Unitary Foundation. Please refer to the rules page of the event’s website to confirm whether you are eligible to participate. If you have any comments, questions or complaints about the event please refer to the contact information provided at the bottom of that page.