From 18a6337b7f073483e2525a6991d6af659624e98e Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Thu, 16 Jan 2025 19:54:45 -0500 Subject: [PATCH] Remove import for `goldstein` and `filtering` from top level `__init__.py` the interpolate one gets numba, unwrap, leads to much longer import times for CLIs Also fix the `get_dates` within time series for cases with longer filenames --- src/dolphin/__init__.py | 2 -- src/dolphin/timeseries.py | 2 +- src/dolphin/unwrap/_unwrap.py | 4 +++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dolphin/__init__.py b/src/dolphin/__init__.py index 3ba98cbb..109022ce 100644 --- a/src/dolphin/__init__.py +++ b/src/dolphin/__init__.py @@ -5,5 +5,3 @@ from ._log import * from ._show_versions import * from ._types import * -from .goldstein import goldstein -from .interpolation import interpolate diff --git a/src/dolphin/timeseries.py b/src/dolphin/timeseries.py index f7b11c4e..d9bf08cb 100644 --- a/src/dolphin/timeseries.py +++ b/src/dolphin/timeseries.py @@ -953,7 +953,7 @@ def invert_unw_network( """ if ifg_date_pairs is None: - ifg_date_pairs = [get_dates(f) for f in unw_file_list] + ifg_date_pairs = [get_dates(f)[:2] for f in unw_file_list] try: # Ensure it's a list of pairs diff --git a/src/dolphin/unwrap/_unwrap.py b/src/dolphin/unwrap/_unwrap.py index 7603fad7..aeed0ce3 100644 --- a/src/dolphin/unwrap/_unwrap.py +++ b/src/dolphin/unwrap/_unwrap.py @@ -10,8 +10,10 @@ import numpy as np from tqdm.auto import tqdm -from dolphin import goldstein, interpolate, io +from dolphin import io from dolphin._types import Filename +from dolphin.goldstein import goldstein +from dolphin.interpolation import interpolate from dolphin.utils import DummyProcessPoolExecutor, full_suffix from dolphin.workflows import UnwrapMethod, UnwrapOptions