Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions pixi.lock

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

23 changes: 21 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,20 @@ compass = { git = "https://github.com/scottstanie/COMPASS.git", branch = "develo
# that the sweets tropo step builds on, plus the OPERA CSLC download
# helpers used by the OperaCslcSearch source and the NISAR GSLC helpers
# used by NisarGslcSearch.
# opera-utils extras are pinned explicitly rather than `[all]` because
# `[all]` folds in the `geopandas` extra, which declares `pyogrio` and
# `geopandas` as PyPI requirements. uv will then install those as wheels
# on top of the conda-forge versions pixi has already provided, and the
# pyogrio wheel crashes on `import pyogrio` with "Could not correctly
# detect PROJ data files installed by pyogrio wheel" because it picks
# up conda's PROJ_DATA dir, which doesn't match the wheel's bundled
# PROJ layout. Listing only the extras sweets actually needs keeps
# geopandas/pyogrio on the conda-forge side.
opera-utils = { git = "https://github.com/scottstanie/opera-utils.git", branch = "develop-scott", extras = [
"all",
"asf",
"disp",
"nisar",
"tropo",
] }
# scottstanie/dolphin@develop-scott carries the YamlModel commented-yaml
# fix for Union-of-submodels JSON schema, which unblocks the
Expand Down Expand Up @@ -165,6 +177,14 @@ pysolid = "*"
yamale = "*"
lxml = "*"
scipy = "*"
# geopandas + pyogrio are hoisted here (rather than under the plotting
# feature) so pixi's pypi-to-conda mapping marks them as satisfied for
# *every* environment. Without this, any PyPI dep that declares a
# `pyogrio` requirement (e.g. `opera-utils[geopandas]` pulled via an
# `[all]` extra) causes uv to install a pyogrio wheel on top of conda's,
# and the wheel crashes with a PROJ-data-dir mismatch on import.
geopandas = "*"
pyogrio = "*"

[tool.pixi.tasks]
test = "pytest"
Expand All @@ -186,7 +206,6 @@ mypy = "*"
[tool.pixi.feature.plotting.dependencies]
cartopy = "*"
matplotlib = "*"
geopandas = "*"
ipywidgets = "*"

# CPU (default) isce3 build - works on every platform sweets supports.
Expand Down
8 changes: 5 additions & 3 deletions src/sweets/_tropo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
radians of phase via ``4 * pi / wavelength``, and subtract from the
unwrapped phase. Write the corrected raster alongside the originals.

The OPERA CSLC reader is registered eagerly when this module is imported,
so any sweets code path that triggers tropo gets the backend automatically.
The OPERA CSLC reader is registered lazily the first time
:func:`create_tropo_corrections` runs, so importing this module stays cheap
and does not require the ``opera_utils.tropo`` subpackage to be present.
"""

from __future__ import annotations
Expand Down Expand Up @@ -157,7 +158,6 @@ def _force_threaded_dns_resolver() -> None:
aiohttp.resolver.DefaultResolver = aiohttp.resolver.ThreadedResolver


_register_opera_cslc_reader()
_force_threaded_dns_resolver()


Expand Down Expand Up @@ -197,6 +197,8 @@ def create_tropo_corrections(
"""
from opera_utils.tropo import create_tropo_corrections_for_stack

_register_opera_cslc_reader()

options = options or TropoOptions()
output_dir = Path(output_dir).resolve()
output_dir.mkdir(parents=True, exist_ok=True)
Expand Down
Loading
Loading