diff --git a/dacapo/apply.py b/dacapo/apply.py index dd5bac17d..0bbb66ea6 100644 --- a/dacapo/apply.py +++ b/dacapo/apply.py @@ -18,7 +18,7 @@ create_weights_store, ) -from pathlib import Path +from upath import UPath as Path logger = logging.getLogger(__name__) diff --git a/dacapo/blockwise/argmax_worker.py b/dacapo/blockwise/argmax_worker.py index d3302289e..346938155 100644 --- a/dacapo/blockwise/argmax_worker.py +++ b/dacapo/blockwise/argmax_worker.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path import sys from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray from dacapo.store.array_store import LocalArrayIdentifier diff --git a/dacapo/blockwise/blockwise_task.py b/dacapo/blockwise/blockwise_task.py index 0f0b7d596..0e40bbc41 100644 --- a/dacapo/blockwise/blockwise_task.py +++ b/dacapo/blockwise/blockwise_task.py @@ -1,6 +1,6 @@ from datetime import datetime from importlib.machinery import SourceFileLoader -from pathlib import Path +from upath import UPath as Path from daisy import Task, Roi diff --git a/dacapo/blockwise/predict_worker.py b/dacapo/blockwise/predict_worker.py index cc8929887..ca861a238 100644 --- a/dacapo/blockwise/predict_worker.py +++ b/dacapo/blockwise/predict_worker.py @@ -1,5 +1,5 @@ import sys -from pathlib import Path +from upath import UPath as Path from typing import Optional import torch diff --git a/dacapo/blockwise/scheduler.py b/dacapo/blockwise/scheduler.py index 1d321a8a7..704d55010 100644 --- a/dacapo/blockwise/scheduler.py +++ b/dacapo/blockwise/scheduler.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path import shutil import tempfile import time diff --git a/dacapo/blockwise/segment_worker.py b/dacapo/blockwise/segment_worker.py index a3ebd3f0c..878eaf013 100644 --- a/dacapo/blockwise/segment_worker.py +++ b/dacapo/blockwise/segment_worker.py @@ -1,7 +1,7 @@ from importlib.machinery import SourceFileLoader import logging import os -from pathlib import Path +from upath import UPath as Path import sys import click import daisy diff --git a/dacapo/blockwise/threshold_worker.py b/dacapo/blockwise/threshold_worker.py index e36084277..8437cb388 100644 --- a/dacapo/blockwise/threshold_worker.py +++ b/dacapo/blockwise/threshold_worker.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path import sys from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray from dacapo.store.array_store import LocalArrayIdentifier diff --git a/dacapo/cli.py b/dacapo/cli.py index ff82c68a9..ce34a763f 100644 --- a/dacapo/cli.py +++ b/dacapo/cli.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path from typing import Optional import numpy as np diff --git a/dacapo/compute_context/bsub.py b/dacapo/compute_context/bsub.py index f065d6c1f..243600172 100644 --- a/dacapo/compute_context/bsub.py +++ b/dacapo/compute_context/bsub.py @@ -1,5 +1,5 @@ import os -from pathlib import Path +from upath import UPath as Path from .compute_context import ComputeContext import daisy diff --git a/dacapo/experiments/datasplits/datasets/arrays/tiff_array.py b/dacapo/experiments/datasplits/datasets/arrays/tiff_array.py index ed1921cff..34e582b4e 100644 --- a/dacapo/experiments/datasplits/datasets/arrays/tiff_array.py +++ b/dacapo/experiments/datasplits/datasets/arrays/tiff_array.py @@ -6,7 +6,7 @@ import tifffile import logging -from pathlib import Path +from upath import UPath as Path from typing import List, Optional logger = logging.getLogger(__name__) diff --git a/dacapo/experiments/datasplits/datasets/arrays/tiff_array_config.py b/dacapo/experiments/datasplits/datasets/arrays/tiff_array_config.py index f2ab1d200..27b4e623a 100644 --- a/dacapo/experiments/datasplits/datasets/arrays/tiff_array_config.py +++ b/dacapo/experiments/datasplits/datasets/arrays/tiff_array_config.py @@ -5,7 +5,7 @@ from funlib.geometry import Coordinate -from pathlib import Path +from upath import UPath as Path from typing import List diff --git a/dacapo/experiments/datasplits/datasets/arrays/zarr_array.py b/dacapo/experiments/datasplits/datasets/arrays/zarr_array.py index 4fcdc2d27..2399b5b17 100644 --- a/dacapo/experiments/datasplits/datasets/arrays/zarr_array.py +++ b/dacapo/experiments/datasplits/datasets/arrays/zarr_array.py @@ -12,7 +12,7 @@ from collections import OrderedDict import logging -from pathlib import Path +from upath import UPath as Path import json from typing import Dict, Tuple, Any, Optional, List diff --git a/dacapo/experiments/datasplits/datasets/arrays/zarr_array_config.py b/dacapo/experiments/datasplits/datasets/arrays/zarr_array_config.py index d2fc46491..af6f9dd20 100644 --- a/dacapo/experiments/datasplits/datasets/arrays/zarr_array_config.py +++ b/dacapo/experiments/datasplits/datasets/arrays/zarr_array_config.py @@ -5,7 +5,7 @@ from funlib.geometry import Coordinate -from pathlib import Path +from upath import UPath as Path from typing import Optional, List, Tuple diff --git a/dacapo/experiments/tasks/post_processors/argmax_post_processor.py b/dacapo/experiments/tasks/post_processors/argmax_post_processor.py index ff3f30ea9..5bdfa767f 100644 --- a/dacapo/experiments/tasks/post_processors/argmax_post_processor.py +++ b/dacapo/experiments/tasks/post_processors/argmax_post_processor.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path from dacapo.blockwise import run_blockwise import dacapo.blockwise from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray diff --git a/dacapo/experiments/tasks/post_processors/threshold_post_processor.py b/dacapo/experiments/tasks/post_processors/threshold_post_processor.py index a71d409e8..c0e10418c 100644 --- a/dacapo/experiments/tasks/post_processors/threshold_post_processor.py +++ b/dacapo/experiments/tasks/post_processors/threshold_post_processor.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path from dacapo.blockwise.scheduler import run_blockwise from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray from .threshold_post_processor_parameters import ThresholdPostProcessorParameters diff --git a/dacapo/experiments/tasks/post_processors/watershed_post_processor.py b/dacapo/experiments/tasks/post_processors/watershed_post_processor.py index 559532b9b..fd22b426a 100644 --- a/dacapo/experiments/tasks/post_processors/watershed_post_processor.py +++ b/dacapo/experiments/tasks/post_processors/watershed_post_processor.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path import dacapo.blockwise from dacapo.blockwise.scheduler import segment_blockwise from dacapo.experiments.datasplits.datasets.arrays import ZarrArray diff --git a/dacapo/experiments/tasks/pretrained_task_config.py b/dacapo/experiments/tasks/pretrained_task_config.py index 5fd4947cc..195ccd742 100644 --- a/dacapo/experiments/tasks/pretrained_task_config.py +++ b/dacapo/experiments/tasks/pretrained_task_config.py @@ -3,7 +3,7 @@ from .pretrained_task import PretrainedTask from .task_config import TaskConfig -from pathlib import Path +from upath import UPath as Path @attr.s diff --git a/dacapo/options.py b/dacapo/options.py index c29fd18c6..589d3d7cd 100644 --- a/dacapo/options.py +++ b/dacapo/options.py @@ -2,7 +2,7 @@ import yaml import logging from os.path import expanduser -from pathlib import Path +from upath import UPath as Path import attr from cattr import Converter diff --git a/dacapo/predict.py b/dacapo/predict.py index 25feaf4bd..0c09a9f7a 100644 --- a/dacapo/predict.py +++ b/dacapo/predict.py @@ -1,4 +1,4 @@ -from pathlib import Path +from upath import UPath as Path from dacapo.blockwise import run_blockwise import dacapo.blockwise diff --git a/dacapo/store/array_store.py b/dacapo/store/array_store.py index 2dc6346b4..0e48a0882 100644 --- a/dacapo/store/array_store.py +++ b/dacapo/store/array_store.py @@ -7,7 +7,7 @@ from abc import ABC, abstractmethod import itertools import json -from pathlib import Path +from upath import UPath as Path from typing import Optional, Tuple diff --git a/dacapo/store/conversion_hooks.py b/dacapo/store/conversion_hooks.py index 85ffc9a01..f90dd5f79 100644 --- a/dacapo/store/conversion_hooks.py +++ b/dacapo/store/conversion_hooks.py @@ -14,7 +14,7 @@ from funlib.geometry import Coordinate, Roi -from pathlib import Path +from upath import UPath as Path def register_hierarchy_hooks(converter): diff --git a/dacapo/store/create_store.py b/dacapo/store/create_store.py index 5c4c940ce..57eed6d9b 100644 --- a/dacapo/store/create_store.py +++ b/dacapo/store/create_store.py @@ -6,7 +6,7 @@ from .file_stats_store import FileStatsStore from dacapo import Options -from pathlib import Path +from upath import UPath as Path def create_config_store(): diff --git a/dacapo/store/file_config_store.py b/dacapo/store/file_config_store.py index 05c55c21b..55543b462 100644 --- a/dacapo/store/file_config_store.py +++ b/dacapo/store/file_config_store.py @@ -9,7 +9,7 @@ import logging import yaml -from pathlib import Path +from upath import UPath as Path logger = logging.getLogger(__name__) diff --git a/dacapo/store/file_stats_store.py b/dacapo/store/file_stats_store.py index 5e1085772..72cf9df58 100644 --- a/dacapo/store/file_stats_store.py +++ b/dacapo/store/file_stats_store.py @@ -6,7 +6,7 @@ import logging import pickle -from pathlib import Path +from upath import UPath as Path logger = logging.getLogger(__name__) diff --git a/dacapo/store/local_array_store.py b/dacapo/store/local_array_store.py index eed3976d7..f47119831 100644 --- a/dacapo/store/local_array_store.py +++ b/dacapo/store/local_array_store.py @@ -1,6 +1,6 @@ from .array_store import ArrayStore, LocalArrayIdentifier, LocalContainerIdentifier -from pathlib import Path +from upath import UPath as Path import logging import shutil from typing import Optional, Tuple diff --git a/dacapo/store/local_weights_store.py b/dacapo/store/local_weights_store.py index ec444e2ec..fb375602b 100644 --- a/dacapo/store/local_weights_store.py +++ b/dacapo/store/local_weights_store.py @@ -5,7 +5,7 @@ import torch import json -from pathlib import Path +from upath import UPath as Path import logging from typing import Optional, Union diff --git a/dacapo/validate.py b/dacapo/validate.py index 83a2e5a8e..b49ffe4c1 100644 --- a/dacapo/validate.py +++ b/dacapo/validate.py @@ -8,7 +8,7 @@ create_weights_store, ) -from pathlib import Path +from upath import UPath as Path import logging from warnings import warn diff --git a/pyproject.toml b/pyproject.toml index fd5f31638..0ef3a39c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ classifiers = [ ] dynamic = ["version"] dependencies = [ + "universal-pathlib>=0.2.2,<1.0.0", "numpy>=1.22.4", "pyyaml", "zarr",