Use namedtuples in schedules
See original GitHub issueWhat is the expected enhancement?
Often when working with schedules come across objects like (1, SamplePulse(p0, duration=5)), a Tuple[int, ScheduleComponent]. This happens when looking at instructions or children of a schedule, for instance.
The request is to use a named tuple, so instead of doing sched_pair[0] and [1] I could use sched_pair.time and sched_pair.schedule
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Write Pythonic and Clean Code With namedtuple - Real Python
With namedtuple() , you can create immutable sequence types that allow you to access their values using descriptive field names and the dot...
Read more >Understand how to use NamedTuple and Dataclass in Python
It has attributes sender, receiver, date, amount and _fields , which allow us to access the attribute by both name and index. Create...
Read more >python - When and why should I use a namedtuple instead of ...
Tuples are immutable, whether named or not. namedtuple only makes the access more convenient, by using names instead of indices. You can only...
Read more >Python namedtuples and Set Operations - BoTree Technologies
Let us say we have a schedule of a room in form of time-slots and each slot ... created by using the namedtuple()...
Read more >_replace method of namedtuple class from the ... - Pythontic.com
The _replace() method replaces one or more values with the given new values and returns a named tuple with the updated values. The...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No one is working on it afaik 😄 I think it will be fine to keep the entire implementation in the file
qiskit-terra/qiskit/pulse/schedule.py. After implementation, I think there are some tests that would be easier to understand if we made use of the names. If you have any questions, or if you need some resources and pointers for getting started, just let me know in this thread!I’m considering this stale, as we will likely replace explicitly timed instructions with relatively timed instructions removing the need for tuples in the first place. Feel free to reopen if you disagree.