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

Remove return_gufe kwarg from AlchemiscaleClient.query_networks #206

Merged
merged 5 commits into from
Dec 5, 2023

Conversation

ianmkenney
Copy link
Collaborator

@ianmkenney ianmkenney commented Dec 1, 2023

Fixes #142

This PR removes the return_gufe kwarg from the AlchemiscaleClient.query_networks method.
As it was not a tested feature before, not tests needed to be changed.

Edit: it also doesn't appear to be mentioned in the current docs.

@ianmkenney ianmkenney changed the title Removed return_gufe kwarg from AlchemiscaleClient.query_networks Remove return_gufe kwarg from AlchemiscaleClient.query_networks Dec 1, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (76c439c) 82.25% compared to head (a32f1ba) 82.36%.
Report is 4 commits behind head on main.

Files Patch % Lines
alchemiscale/interface/api.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
+ Coverage   82.25%   82.36%   +0.10%     
==========================================
  Files          22       22              
  Lines        2739     2727      -12     
==========================================
- Hits         2253     2246       -7     
+ Misses        486      481       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dotsdl dotsdl left a comment

Choose a reason for hiding this comment

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

Looks great @ianmkenney! Just a couple notes. I may also add to this PR removal of return_gufe handling for query_networks in the user-facing API that the AlchemiscaleClient talks to (in interface/api.py) before merging.

@@ -136,7 +136,6 @@ def query_networks(
self,
name: Optional[str] = None,
scope: Optional[Scope] = None,
return_gufe=False,
) -> Union[List[ScopedKey], Dict[ScopedKey, AlchemicalNetwork]]:
Copy link
Member

Choose a reason for hiding this comment

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

We also want to update the return type to reflect simplification here.

else:
networks.extend(self._query_resource("/networks", params=params))
params = dict(name=name, **scope.dict())
networks.extend(self._query_resource("/networks", params=params))
Copy link
Member

Choose a reason for hiding this comment

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

I think we can just return the list returned by this method; unclear to me now why I chose to extend/update an empty list/dict here, since it will be freshly created by the underlying method anyway.

Copy link
Member

@dotsdl dotsdl left a comment

Choose a reason for hiding this comment

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

Looks great @ianmkenney! Merge when satisfied!

@ianmkenney ianmkenney merged commit 9e7f1e9 into main Dec 5, 2023
4 checks passed
@ianmkenney ianmkenney deleted the 142-remove-return_gufe branch December 5, 2023 17:31
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.

Remove return_gufe kwarg from AlchemiscaleClient
3 participants