-
Notifications
You must be signed in to change notification settings - Fork 0
change scope classmethods to staticmethods #10
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
Conversation
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.
Incooperation of deep copy is necessary.
examples/scope_example.py
Outdated
|
||
# compare both waveforms | ||
pss.Scope.compare_channels(meas_il_ib, gecko_il_ib, meas_il_ob, gecko_il_ob, shift=[-67.53e-6, 0, -67.53e-6, 0], timebase='us') | ||
# pss.HandleScope.compare_channels(meas_il_ib, gecko_il_ib, meas_il_ob, gecko_il_ob, shift=[-67.53e-6, 0, -67.53e-6, 0], timebase='us') |
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.
What is the reason for comment out? It shall plot the function, or is it obsolete because also other functions plots the function?
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.
fixed
pysignalscope/scope.py
Outdated
:return: None | ||
:rtype: None | ||
:return: Scope object | ||
:rtype: Scope | ||
""" | ||
if isinstance(channel_label, str) or channel_label is None: |
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.
Before assigning any value to the dataset attribute a deep copy is necessary. Otherwise you overwrite the origin data of the data set.
So each function needs a deep copy, like
cur_channel=copy(channel)
Then the attributes of cur_channel can be updated and cur_channel can be returned
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.
fixed
pysignalscope/scope.py
Outdated
self.channel_data = np.abs(self.channel_data) | ||
if self.channel_label is not None: | ||
self.channel_label = '|' + self.channel_label + '|' | ||
channel.channel_data = np.abs(channel.channel_data) |
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.
Before calculation of absolute values a copy of the data are necessary. Otherwise you overwrite the origin channel data.
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.
fixed
pysignalscope/scope.py
Outdated
self.channel_data = self.channel_data ** 2 | ||
if self.channel_label is not None: | ||
self.channel_label = self.channel_label + '²' | ||
channel.channel_data = channel.channel_data ** 2 |
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.
Before calculation of square values a copy of the data are necessary. Otherwise you overwrite the origin channel data.
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.
fixed
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.
Update of my own comments due to typo and wrong wording
Requested changes are fixed. |
No description provided.