Skip to content

Commit

Permalink
remove typing_extension dependency (#378)
Browse files Browse the repository at this point in the history
* remove typing_extension dependency

* formatting changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
kierandidi and pre-commit-ci[bot] authored Mar 25, 2024
1 parent c382758 commit 2d4d4d6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
1 change: 0 additions & 1 deletion .requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pyyaml!=6.0.0,!=5.4.0,!=5.4.1
scikit-learn
scipy>=1.8
tqdm
typing_extensions==4.5.0
wget
xarray
jaxtyping
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Bugfixes

* Fix bug where the `deprotonate` argument is not wired up to `graphein.protein.graphs.construct_graphs`. [#375](https://github.com/a-r-j/graphein/pull/375)
* Remove `typing_extension` as dependency since we now only support Python >=3.8 and `Literal` is included in `typing` there.

### 1.7.6

Expand Down
7 changes: 6 additions & 1 deletion graphein/molecule/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from deepdiff import DeepDiff
from pydantic import BaseModel
from typing_extensions import Literal

from graphein.molecule.edges.atomic import add_atom_bonds
from graphein.molecule.edges.distance import (
Expand All @@ -24,6 +23,12 @@
from graphein.molecule.features.nodes.atom_type import atom_type_one_hot
from graphein.utils.config import PartialMatchOperator, PathMatchOperator

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal


GraphAtoms = Literal[
"C",
"H",
Expand Down
6 changes: 5 additions & 1 deletion graphein/protein/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@

from deepdiff import DeepDiff
from pydantic import BaseModel, validator
from typing_extensions import Literal

from graphein.protein.edges.distance import add_peptide_bonds
from graphein.protein.features.nodes.amino_acid import meiler_embedding
from graphein.utils.config import PartialMatchOperator, PathMatchOperator

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal


class DSSPConfig(BaseModel):
executable: str = "mkdssp"
Expand Down
6 changes: 5 additions & 1 deletion graphein/protein/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from loguru import logger as log
from rich.progress import Progress
from tqdm.contrib.concurrent import process_map
from typing_extensions import Literal

from graphein.protein.config import GetContactsConfig, ProteinGraphConfig
from graphein.protein.edges.distance import (
Expand All @@ -47,6 +46,11 @@
compute_edges,
)

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal


def subset_structure_to_rna(
df: pd.DataFrame,
Expand Down
7 changes: 6 additions & 1 deletion graphein/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
import pandas as pd
import xarray as xr
from Bio.Data.IUPACData import protein_letters_3to1
from typing_extensions import Literal

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal


AggregationType: List["sum", "mean", "max", "min", "median"]
"""Types of aggregations for features."""
Expand Down

0 comments on commit 2d4d4d6

Please sign in to comment.