Skip to content

Commit

Permalink
Type-checking requires torch
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos authored and martaiborra committed Sep 27, 2024
1 parent 5c2746a commit 21dc538
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.10"
# Follow guidlines from https://scientific-python.org/specs/spec-0000/
# Follow guidelines from https://scientific-python.org/specs/spec-0000/
dependencies = [
"numpy>=1.23.0",
"ndindex",
Expand All @@ -45,7 +45,8 @@ dynamic = ["version"]
test = [
"pytest",
"psutil",
]
"torch",
]
doc = [
"sphinx",
"pydata-sphinx-theme",
Expand Down
7 changes: 6 additions & 1 deletion src/blosc2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@
import pickle
import platform
import sys
from collections.abc import Callable
from dataclasses import asdict
from typing import TYPE_CHECKING

import cpuinfo
import numpy as np

import blosc2
from blosc2 import blosc2_ext

if TYPE_CHECKING:
from collections.abc import Callable

import torch


def _check_typesize(typesize):
if not 1 <= typesize <= blosc2_ext.MAX_TYPESIZE:
Expand Down

0 comments on commit 21dc538

Please sign in to comment.