Skip to content

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

Merged
merged 6 commits into from
Nov 8, 2024
Merged

Conversation

gituser789
Copy link
Contributor

No description provided.

@gituser789 gituser789 self-assigned this Nov 6, 2024
@gituser789 gituser789 added the enhancement New feature or request label Nov 6, 2024
@gituser789 gituser789 added this to the 0.2.0 milestone Nov 6, 2024
Copy link
Collaborator

@SevenOfNinePE SevenOfNinePE left a 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.


# 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')
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

:return: None
:rtype: None
:return: Scope object
:rtype: Scope
"""
if isinstance(channel_label, str) or channel_label is None:
Copy link
Collaborator

@SevenOfNinePE SevenOfNinePE Nov 6, 2024

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

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)
Copy link
Collaborator

@SevenOfNinePE SevenOfNinePE Nov 6, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

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
Copy link
Collaborator

@SevenOfNinePE SevenOfNinePE Nov 6, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

@SevenOfNinePE SevenOfNinePE left a 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

@gituser789
Copy link
Contributor Author

Requested changes are fixed.
Additionally, pylint has been enabled for the github workflow.
For future, additionally run pylint $(git ls-files '*.py') to check for any linting errors (additinal to ruff and pycodestyle).

@SevenOfNinePE SevenOfNinePE merged commit 380aa3a into main Nov 8, 2024
2 checks passed
@gituser789 gituser789 deleted the scope_staticmethod branch December 10, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants