-
Notifications
You must be signed in to change notification settings - Fork 320
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
Bug: snapshot fails when instantiating InstrumentBase #1209
Bug: snapshot fails when instantiating InstrumentBase #1209
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1209 +/- ##
==========================================
- Coverage 80.16% 80.16% -0.01%
==========================================
Files 49 49
Lines 6762 6761 -1
==========================================
- Hits 5421 5420 -1
Misses 1341 1341 |
It's not so clear to me what is gained by instantiating |
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.
A-OK from me.
yeah, it is more for subclassing |
Merge: 897ffbc 5ea8e0d Author: Mikhail Astafev <[email protected]> Merge pull request #1209 from astafan8/bugfix/meta-attr-name-instrument-base
The problem occurs when one wants to subclass from
InstrumentBase
(or instantiate it). The reason to do so is to create a "virtual" instrument, and to avoid the overhead ofInstrument
class related to the register of instances.The problem is that the snapshot functionality of
InstrumentBase
raises an exception saying "the object does not have attribute_meta_attrs
". This is becausesnapshot_base
uses it, but for some reason_meta_attrs
is only defined in theInstrument
class. This is not correct, hence this PR.Changes:
_meta_attrs
inInstrumentBase
instead ofInstrument
InstrumentBase
Instrument
test to ensure snapshotting still works for it