Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 15 additions & 6 deletions polaris/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Annotated, Optional

import typer

Expand All @@ -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)

Expand Down
14 changes: 8 additions & 6 deletions polaris/curation/_data_curator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {},
)
Expand Down
6 changes: 3 additions & 3 deletions polaris/utils/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down