8000 Add a `description` to `Parameter`s by SengerM · Pull Request #1153 · pymeasure/pymeasure · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a description to Parameters #1153

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pymeasure/experiment/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
list of strings, this argument can be either a single condition or
a list of conditions. If the group_by argument is provided as a dict
this argument is ignored.
:description: A string providing a human-friendly description for the

Check warning on line 45 in pymeasure/experiment/parameters.py

View workflow job for this annotation

GitHub Actions / Docs and Linting

W291 trailing whitespace
parameter.

Check warning on line 46 in pymeasure/experiment/parameters.py

View workflow job for this annotation

GitHub Actions / Docs and Linting

W191 indentation contains tabs

Check failure on line 46 in pymeasure/experiment/parameters.py

View workflow job for this annotation

GitHub Actions / Docs and Linting

E101 indentation contains mixed spaces and tabs
"""

def __init__(self, name, default=None, ui_class=None, group_by=None, group_condition=True):
def __init__(self, name, default=None, ui_class=None, group_by=None, group_condition=True, description=None):

Check failure on line 49 in pymeasure/experiment/parameters.py

View workflow job for this annotation

GitHub Actions / Docs and Linting

E501 line too long (113 > 100 characters)
self.name = name
separator = ": "
if separator in name:
Expand All @@ -71,6 +73,10 @@
elif group_by is not None:
raise TypeError("The provided group_by argument is not valid, should be either a "
"string, a list of strings, or a dict with {string: condition} pairs.")

Check warning on line 76 in pymeasure/experiment/parameters.py

View workflow job for this annotation

GitHub Actions / Docs and Linting

W191 indentation contains tabs

Check failure on line 76 in pymeasure/experiment/parameters.py

View workflow job for this annotation

GitHub Actions / Docs and Linting

E101 indentation contains mixed spaces and tabs

Check warning on line 76 in pymeasure/experiment/parameters.py

View workflow job for this annotation

GitHub Actions / Docs and Linting

W293 blank line contains whitespace
if description is not None and not isinstance(description, str):
raise TypeError("The provided description argument is not a string.")
self._description = description

@property
def value(self):
Expand Down
Loading
0