Skip to content
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

[refactor] Clean up xt_client docstrings to make them match with the … #2677

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

tepals
Copy link
Contributor

@tepals tepals commented Feb 20, 2024

…current guidelines

Additionally make use of typing and remove unused returns.

update.show()
else:
logging.warning("{} is a bad file in {} not transferring latest package.".format(ret, package.path))
except Exception as err:
logging.exception(err)

def list_available_channels(self):
def list_available_channels(self) -> dict:
Copy link
Member

Choose a reason for hiding this comment

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

Can you indicate the type of the key & value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just noticed that this function is not there anymore in the xtadapter, so I will completely remove it. Should I do that as a separate commit in this PR or in a new one?

Copy link
Member

Choose a reason for hiding this comment

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

There are actually no user? If so, the removal can be very simple, and just as a separate commit of this PR. Otherwise, just keep it for later, as a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no actual user, I'll then do it as a separate commit on this PR.

@pieleric
Copy link
Member

BTW, to test your typing, you can install beartype with pip3, and then add at the top of the xt_client.py file:

from beartype.claw import beartype_this_package 
beartype_this_package()                              

Then, run the test cases.
It will raise an exception if a function is ever called with a value or returns a value which does not fit the type.

@tepals tepals force-pushed the refactor-xtclient-docstrings branch from 57fd016 to c2412c6 Compare February 22, 2024 14:52
…current guidelines

Additionally make use of typing and remove unused returns.
The function list_available_channels was removed from the xtadapter, but was not removed here. It is not called anywhere, therefore we can safely remove it here.
@tepals tepals force-pushed the refactor-xtclient-docstrings branch from c2412c6 to 0e85c3d Compare February 23, 2024 10:39
@tepals tepals merged commit ecfe818 into delmic:master Feb 23, 2024
5 checks passed
@tepals tepals deleted the refactor-xtclient-docstrings branch February 23, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants