Skip to content

Commit

Permalink
Merge branch 'main' into jax-sbas
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Jan 10, 2024
2 parents 796582c + 3f33799 commit 3f042da
Show file tree
Hide file tree
Showing 16 changed files with 779 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
threadpoolctl>=3.0
dask
rasterio
pyaps3>=0.3
opera-utils>=0.1.5
exclude: # TODO: Remove this once pymp is gone
- os: macos-latest
deps:
Expand Down
14 changes: 3 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,17 @@ repos:


- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.8
rev: v0.1.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.7.1"
rev: "v1.8.0"
hooks:
- id: mypy
additional_dependencies:
- types-pkg_resources
- types-requests
- "pydantic>=2.4"

- repo: https://github.com/PyCQA/pydocstyle
rev: "6.3.0"
hooks:
- id: pydocstyle
# https://github.com/PyCQA/pydocstyle/pull/608#issuecomment-1381168417
additional_dependencies: ['.[toml]']
exclude: tests
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# [Unreleased](https://github.com/isce-framework/dolphin/compare/v0.7.0...main)
# [Unreleased](https://github.com/isce-framework/dolphin/compare/v0.8.0...main)

# [v0.8.0](https://github.com/isce-framework/dolphin/compare/v0.7.0...v0.8.0)

**Added**
- Ability to unwrap interferorgams with the [`snaphu-py`](https://github.com/isce-framework/snaphu-py) (not a required dependency)
- Ability to unwrap interferograms with the [`snaphu-py`](https://github.com/isce-framework/snaphu-py) (not a required dependency)
- Added ability to make annual ifgs in `Network`
- Start of tropospheric corection support in `dolphin.atmosphere` using PyAPS and Raider packages
- Expose the unwrap skipping with `dolphin config --no-unwrap`

**Changed**
- The output directory for interferograms is now just "interferograms/" instead of "interferograms/stiched"
Expand All @@ -11,7 +15,7 @@
- Switched output filename from `tcorr` to `temporal_coherence` for the temporal coherence of phase linking.
- Also added the date span to the `temporal_coherence` output name
- The default extension for conncomps is now `.tif`. Use geotiffs instead of ENVI format for connected components.

- Using ruff instead of pydocstyle due to archived repo

# [v0.7.0](https://github.com/isce-framework/dolphin/compare/v0.6.1...v0.7.0)

Expand Down
2 changes: 1 addition & 1 deletion conda-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- hdf5!=1.12.2 # https://github.com/SciTools/iris/issues/5187 and https://github.com/pydata/xarray/issues/7549
- numba>=0.54
- numpy>=1.20
- opera-utils>=0.1.1
- opera-utils>=0.1.5
- pydantic>=2.1
- pymp-pypi>=0.4.5
- pyproj>=3.3
Expand Down
13 changes: 11 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ version_scheme = "no-guess-dev" # Will not guess the next version

[tool.ruff]
src = ["src"]
ignore = [
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line
"PLR", # Pylint Refactor
]

[tool.ruff.lint]
# Enable the isort rules.
Expand All @@ -65,9 +73,10 @@ python_version = "3.10"
ignore_missing_imports = true
plugins = ["pydantic.mypy"]

[tool.ruff.per-file-ignores]
"**/__init__.py" = ["F401"]
"test/**" = ["D"]

[tool.pydocstyle]
ignore = "D100,D102,D104,D105,D106,D107,D203,D204,D213,D413"

[tool.pytest.ini_options]
doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
h5py>=3.6
numba>=0.54
numpy>=1.20
opera-utils>=0.1.5
pydantic>=2.1
pymp-pypi>=0.4.5
pyproj>=3.3
Expand Down
56 changes: 53 additions & 3 deletions src/dolphin/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import datetime
import sys
from enum import Enum
from os import PathLike
from typing import TYPE_CHECKING, Tuple, TypeVar, Union
from typing import TYPE_CHECKING, NamedTuple, TypeVar, Union

if sys.version_info >= (3, 10):
from typing import ParamSpec
Expand All @@ -24,11 +25,60 @@
# TypeVar added for generic functions which should return the same type as the input
PathLikeT = TypeVar("PathLikeT", str, PathLikeStr)

# left, bottom, right, top
Bbox = Tuple[float, float, float, float]

class Bbox(NamedTuple):
"""Bounding box named tuple, defining extent in cartesian coordinates.
Usage:
Bbox(left, bottom, right, top)
Attributes
----------
left : float
Left coordinate (xmin)
bottom : float
Bottom coordinate (ymin)
right : float
Right coordinate (xmax)
top : float
Top coordinate (ymax)
"""

left: float
bottom: float
right: float
top: float


# Used for callable types
T = TypeVar("T")
P = ParamSpec("P")

DateOrDatetime = Union[datetime.datetime, datetime.date]


class TropoModel(Enum):
"""Enumeration representing different tropospheric models."""

ERA5 = "ERA5"
HRES = "HRES"
ERAINT = "ERAINT"
ERAI = "ERAI"
MERRA = "MERRA"
NARR = "NARR"
HRRR = "HRRR"
GMAO = "GMAO"


class TropoType(Enum):
"""Type of tropospheric delay."""

WET = "wet"
"""Wet tropospheric delay."""
DRY = "dry"
"""Dry delay (same as hydrostatic, named "dry" in PyAPS)"""
HYDROSTATIC = "hydrostatic"
"""Hydrostatic (same as dry, named differently in raider)"""
COMB = "comb"
"""Combined wet + dry delay."""
3 changes: 3 additions & 0 deletions src/dolphin/atmosphere/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Atmospheric corrections."""

from .troposphere import * # noqa
Loading

0 comments on commit 3f042da

Please sign in to comment.