From bf2d1d0f58d2b5d46b6ee149e1b5d24036240f76 Mon Sep 17 00:00:00 2001 From: cwognum Date: Fri, 26 Jan 2024 11:22:14 -0500 Subject: [PATCH 1/2] Improve the documentation of the Polaris CLI --- polaris/cli.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/polaris/cli.py b/polaris/cli.py index 04dc0a22..9f9dc7c5 100644 --- a/polaris/cli.py +++ b/polaris/cli.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Annotated, Optional import typer @@ -10,13 +10,22 @@ ) -@app.command("login", help="Log in to the Polaris Hub") +@app.command("login") def login( - client_env_file: Optional[str] = None, - auto_open_browser: bool = True, - overwrite: bool = False, + client_env_file: Annotated[ + Optional[str], typer.Option(help="Environment file to overwrite the default environment variables") + ] = None, + auto_open_browser: Annotated[ + bool, typer.Option(help="Whether to automatically open the link in a browser to retrieve the token") + ] = True, + overwrite: Annotated[ + bool, typer.Option(help="Whether to overwrite the access token if you are already logged in") + ] = False, ): - """Uses the OAuth2 protocol to gain token-based access to the Polaris Hub API""" + """Authenticate to the Polaris Hub. + + This CLI will use the OAuth2 protocol to gain token-based access to the Polaris Hub API. + """ with PolarisHubClient(env_file=client_env_file) as client: client.login(auto_open_browser=auto_open_browser, overwrite=overwrite) From 344ad69af440bbffd88b36effc07958b04a10fdd Mon Sep 17 00:00:00 2001 From: cwognum Date: Fri, 26 Jan 2024 11:27:04 -0500 Subject: [PATCH 2/2] Updated black and formatted --- polaris/curation/_data_curator.py | 14 ++++++++------ polaris/utils/types.py | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/polaris/curation/_data_curator.py b/polaris/curation/_data_curator.py index ebee809a..14de7643 100644 --- a/polaris/curation/_data_curator.py +++ b/polaris/curation/_data_curator.py @@ -230,12 +230,14 @@ def run_data_curation( # detect stereo activity cliff, keep or remove data = _process_stereoisomer_with_activity_cliff( data=data, - data_cols=[ - f"{CLASS_PREFIX}{data_col}" if f"{CLASS_PREFIX}{data_col}" in data.columns else data_col - for data_col in data_cols - ] - if class_thresholds - else data_cols, + data_cols=( + [ + f"{CLASS_PREFIX}{data_col}" if f"{CLASS_PREFIX}{data_col}" in data.columns else data_col + for data_col in data_cols + ] + if class_thresholds + else data_cols + ), mask_stereo_undefined_mols=mask_stereo_undefined_mols, **activity_cliff_params if activity_cliff_params is not None else {}, ) diff --git a/polaris/utils/types.py b/polaris/utils/types.py index 0f850dc8..91c586db 100644 --- a/polaris/utils/types.py +++ b/polaris/utils/types.py @@ -115,9 +115,9 @@ class License(BaseModel): Else it is required to manually specify this. """ - SPDX_LICENSE_DATA_PATH: ClassVar[ - str - ] = "https://raw.githubusercontent.com/spdx/license-list-data/main/json/licenses.json" + SPDX_LICENSE_DATA_PATH: ClassVar[str] = ( + "https://raw.githubusercontent.com/spdx/license-list-data/main/json/licenses.json" + ) id: str reference: Optional[HttpUrlString] = None