Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:bioinf-jku/FCD into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
renzph committed Apr 1, 2024
2 parents 16fc6c3 + bccfa01 commit c4cac20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fcd/fcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_predictions(
smiles_list: List[str],
batch_size: int = 128,
n_jobs: int = 1,
device: str | None = None,
device: Optional[str] = None,
) -> np.ndarray:
"""Calculate Chemnet activations
Expand Down Expand Up @@ -81,7 +81,7 @@ def get_predictions(
return np.row_stack(chemnet_activations)


def get_fcd(smiles1: List[str], smiles2: List[str], model: nn.Module | None = None, device=None) -> float:
def get_fcd(smiles1: List[str], smiles2: List[str], model: Optional[nn.Module] = None, device=None) -> float:
"""Calculate FCD between two sets of Smiles
Args:
Expand Down
4 changes: 2 additions & 2 deletions fcd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import warnings
from contextlib import contextmanager
from multiprocessing import Pool
from typing import List
from typing import List, Optional

import numpy as np
import torch
Expand Down Expand Up @@ -43,7 +43,7 @@ def tokenize(smiles: str) -> List[str]:
return tok_smile


def get_one_hot(smiles: str, pad_len: int | None = None) -> np.ndarray:
def get_one_hot(smiles: str, pad_len: Optional[int] = None) -> np.ndarray:
"""Generate one-hot representation of a Smiles string.
Args:
Expand Down

0 comments on commit c4cac20

Please sign in to comment.