Skip to content

Commit

Permalink
Version bump, MP fix, and housekeeping (#576)
Browse files Browse the repository at this point in the history
Co-authored-by: Owen Jones <[email protected]>
  • Loading branch information
owencjones and Owen Jones authored Apr 26, 2023
1 parent 51cb3f1 commit 92bc4dd
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 117 deletions.
2 changes: 1 addition & 1 deletion darwin/cli_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def dataset_import(
delete_for_empty: bool = False,
import_annotators: bool = False,
import_reviewers: bool = False,
use_multi_cpu: bool = True,
use_multi_cpu: bool = False,
cpu_limit: Optional[int] = None,
) -> None:
"""
Expand Down
10 changes: 8 additions & 2 deletions darwin/importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

Unknown = Any # type: ignore

from mpire import WorkerPool
from tqdm import tqdm

if TYPE_CHECKING:
Expand All @@ -40,6 +39,13 @@
from darwin.utils import flatten_list, secure_continue_request
from darwin.version import __version__

try:
from mpire import WorkerPool

MPIRE_AVAILABLE = True
except ImportError:
MPIRE_AVAILABLE = False

# Classes missing import support on backend side
UNSUPPORTED_CLASSES = ["string", "graph"]

Expand Down Expand Up @@ -121,7 +127,7 @@ def maybe_console(*args: Union[str, int, float]) -> None:

maybe_console(f"Found {len(files)} files")

if use_multi_cpu:
if use_multi_cpu and MPIRE_AVAILABLE and cpu_limit > 1:
maybe_console(f"Using multiprocessing with {cpu_limit} workers")
try:
with WorkerPool(cpu_limit) as pool:
Expand Down
2 changes: 1 addition & 1 deletion darwin/version/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.8.20"
__version__ = "0.8.21"
106 changes: 9 additions & 97 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "darwin-py"
version = "0.8.20" # update this when you change the version - See: https://peps.python.org/pep-0440/
version = "0.8.21" # update this when you change the version - See: https://peps.python.org/pep-0440/
description = "Library and command line interface for darwin.v7labs.com"
homepage = "https://docs.v7labs.com/reference/getting-started-2"
documentation = "https://darwin-py-sdk.v7labs.com/index.html"
Expand Down Expand Up @@ -32,21 +32,21 @@ pydantic = "^1.10.4"
orjson = "^3.8.5"
numpy = "*"
toml = "^0.10.2"
nibabel = {version = "^5.0.0", extras = ["medical"], python = ">=3.8.1"}
connected-components-3d = {version = "^3.10.3", extras = ["medical"]}
scikit-learn = {version = "^1.2.0", extras = ["ml", "test"], python = ">=3.8.1,<3.11"}
torch = {version = "^1.13.1", extras = ["ml"]}
torchvision = {version = "^0.14.1", extras = ["ml"]}
black = {version = "^22.12.0", extras = ["dev"]}
isort = {version = "^5.11.4", extras = ["dev"]}
flake8 = {version = "^6.0.0", extras = ["dev"], python = ">=3.8.1,<3.11"}
mypy = {version = "^0.991", extras = ["dev"]}
responses = {version = "^0.22.0", extras = ["test", "dev"]}
pytest = {version = "^7.2.1", extras = ["test", "dev"]}
pytest-describe = {version = "^2.0.1", extras = ["test", "dev"]}
flake8-pyproject = {version = "^1.2.2", extras = ["test", "dev"], python = ">=3.8.1,<3.11"}
debugpy = {version = "^1.6.5", extras = ["dev"]}
types-requests = {version = "^2.28.11.8", extras = ["dev"]}
nibabel = {version = "^5.0.0", python = ">=3.8.1"}
connected-components-3d = {version = "^3.10.3"}
scikit-learn = {version = "^1.2.0", python = ">=3.8.1,<3.11"}
torch = {version = "^1.13.1"}
torchvision = {version = "^0.14.1"}
black = {version = "^22.12.0"}
isort = {version = "^5.11.4"}
flake8 = {version = "^6.0.0", python = ">=3.8.1,<3.11"}
mypy = {version = "^0.991"}
responses = {version = "^0.22.0"}
pytest = {version = "^7.2.1"}
pytest-describe = {version = "^2.0.1"}
flake8-pyproject = {version = "^1.2.2", python = ">=3.8.1,<3.11"}
debugpy = {version = "^1.6.5"}
types-requests = {version = "^2.28.11.8"}
mpire = {version = "^2.7.0"}
tqdm = "^4.64.1"

Expand Down

0 comments on commit 92bc4dd

Please sign in to comment.