-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add get_dt_from_backend func to the builder command #10253
Add get_dt_from_backend func to the builder command #10253
Conversation
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
…eature/dispatch_backend
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5542245283
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @to24toro , I think this simplifies internals of logic requiring backend dt. However, I have a suggestion for different approach.
Note that the pulse builder already supports commands seconds_to_samples
and samples_to_seconds
, and end user doesn't require the dt information other than converting time unit. This makes me think get_dt_from_backend
doesn't need to be a builder command. Instead, you can implement a method to return backend dt directly in the _PulseBuilder
class, e.g. _PulseBuilder.time_resolution
, and let seconds_to_samples
and samples_to_seconds
access this method through _active_builder
function?
Since _PulseBuilder
is a private class, its method is much more maintainable compared with the public builder command.
@nkanazawa1989 |
@@ -0,0 +1,4 @@ | |||
--- | |||
features: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this note because this is now change in the internals (the builder class is protected) so there is no need for end user communication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed at 8effc99.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks this makes code much readable and clean.
Summary
Added a new buillder command get_dt_from_backend to builder.py.
This returns dt differently based with the type of a backend class.
Details and comments
Need to review after #10150.