Skip to content

Commit

Permalink
Add missing annotations to make Python 3.9 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Nov 8, 2024
1 parent 8d7b43b commit 7f76a0c
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conda-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: dolphin-env
channels:
- conda-forge
dependencies:
- python>=3.8
- python==3.9
- pip>=21.3 # https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#editable-installation
- git # for pip install, due to setuptools_scm
- gdal>=3.3
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "dolphin"
description = "Workflows for generating surface displacement maps using InSAR"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.8"
requires-python = ">=3.9"

classifiers = [
"Development Status :: 2 - Pre-Alpha",
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/_cli_unwrap.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import argparse
from pathlib import Path
from typing import TYPE_CHECKING, Any
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/_log.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import json
import logging
import logging.config
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/_overviews.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import argparse
import logging
from enum import Enum
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/filtering.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import multiprocessing as mp
from concurrent.futures import ProcessPoolExecutor
from itertools import repeat
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/goldstein.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import numpy as np
from numpy.typing import NDArray

Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/interpolation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import logging

import numba
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/io/_process.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from concurrent.futures import FIRST_EXCEPTION, Future, ThreadPoolExecutor, wait
from typing import Protocol, Sequence

Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/phase_link/_compress.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import warnings

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/phase_link/metrics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Module for computing quality metrics of estimated solutions."""

from __future__ import annotations

import jax.numpy as jnp
from jax import Array, jit, vmap
from jax.typing import ArrayLike
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/phase_link/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
full CPU/GPU stack implementations.
"""

from __future__ import annotations

import numpy as np
import numpy.linalg as la
import scipy.ndimage as ndi
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Uses metric from [@Wang2022AccuratePersistentScatterer] for similarity.
"""

from __future__ import annotations

import logging
from pathlib import Path
from typing import Callable, Literal, Sequence
Expand Down
6 changes: 3 additions & 3 deletions src/dolphin/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ class CompressedSlcInfo(BaseModel):
..., description="Datetime of the last real SLC used in the compression."
)

real_slc_file_list: list[Filename] | None = Field(
real_slc_file_list: Optional[list[Filename]] = Field(
None,
description="List of real SLC filenames in the ministack.",
)
real_slc_dates: list[datetime] | None = Field(
real_slc_dates: Optional[list[datetime]] = Field(
None,
description=(
"List of date sequences, one for each SLC in the ministack. "
"Each item is a list/tuple of datetime.date or datetime.datetime objects."
),
)
compressed_slc_file_list: list[Filename] | None = Field(
compressed_slc_file_list: Optional[list[Filename]] = Field(
None,
description="List of compressed SLC filenames in the ministack.",
)
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/unwrap/_post_process.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import logging

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/unwrap/_unwrap_3d.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import logging
import shutil
import subprocess
Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/workflows/_cli_run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import argparse
from typing import TYPE_CHECKING, Any, Optional, Sequence

Expand Down
2 changes: 2 additions & 0 deletions src/dolphin/workflows/config/_yaml_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import json
import sys
import textwrap
Expand Down

0 comments on commit 7f76a0c

Please sign in to comment.