Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.5.3 #678

Merged
merged 9 commits into from
Jul 30, 2024
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.3]
### Fixed
* Updates dem-stitcher to 2.5.8 to ensure new (ARIA-managed) url for reading the Geoid EGM 2008. See this [issue](https://github.com/ACCESS-Cloud-Based-InSAR/dem-stitcher/issues/96).

## [0.5.2]
### Changed
* [627](https://github.com/dbekaert/RAiDER/pull/627) - Made Python datetimes timezone-aware and added unit tests and bug fixes.
Expand All @@ -16,6 +20,7 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* [658](https://github.com/dbekaert/RAiDER/pull/658) - Fixed opaque error message if a GUNW file is not produced while HyP3 independently against a previous INSAR_ISCE.
* [661](https://github.com/dbekaert/RAiDER/pull/661) - Fixed bug in raiderDownloadGNSS, removed call to scipy.sum, and added unit tests.
* [662](https://github.com/dbekaert/RAiDER/pull/662) - Bumped dem-stitcher to >= v2.5.6, which updates the URL for reading the Geoid EGM 2008.
* [669](https://github.com/dbekaert/RAiDER/pull/669) - Fixed test name collision (test_writeArrayToRaster).

## [0.5.1]
### Changed
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- cdsapi
- cfgrib
- dask
- dem_stitcher>=2.5.6
- dem_stitcher>=2.5.8
- ecmwf-api-client
- h5netcdf
- h5py
Expand Down
71 changes: 35 additions & 36 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,45 @@ def test_writeArrayToRaster(tmp_path):
band = src.read(1)
noval = src.nodatavals[0]


assert noval == 0
assert np.allclose(band, array)


def test_writeArrayToRaster_2():
test = np.random.randn(10,10,10)
with pytest.raises(RuntimeError):
writeArrayToRaster(test, 'dummy_file')


def test_writeArrayToRaster_3(tmp_path):
test = np.random.randn(10,10)
test = test + test * 1j
with pushd(tmp_path):
fname = os.path.join(tmp_path, 'tmp_file.tif')
writeArrayToRaster(test, fname)
tmp = rio_profile(fname)
assert tmp['dtype'] == 'complex64'


def test_writeArrayToRaster_4(tmp_path):
SCENARIO0_DIR = os.path.join(TEST_DIR, "scenario_0")
geotif = os.path.join(SCENARIO0_DIR, 'small_dem.tif')
profile = rio_profile(geotif)
data = rio_open(geotif)
with pushd(tmp_path):
fname = os.path.join(tmp_path, 'tmp_file.nc')
writeArrayToRaster(
data,
fname,
proj=profile['crs'],
gt=profile['transform'],
fmt='nc',
)
new_fname = os.path.join(tmp_path, 'tmp_file.tif')
prof = rio_profile(new_fname)
assert prof['driver'] == 'GTiff'


def test_makePoints0D_cython(make_points_0d_data):
from RAiDER.makePoints import makePoints0D

Expand Down Expand Up @@ -516,41 +550,6 @@ def test_rio_4():
assert len(hd.shape) == 2


def test_writeArrayToRaster_2():
test = np.random.randn(10,10,10)
with pytest.raises(RuntimeError):
writeArrayToRaster(test, 'dummy_file')


def test_writeArrayToRaster_3(tmp_path):
test = np.random.randn(10,10)
test = test + test * 1j
with pushd(tmp_path):
fname = os.path.join(tmp_path, 'tmp_file.tif')
writeArrayToRaster(test, fname)
tmp = rio_profile(fname)
assert tmp['dtype'] == np.complex64


def test_writeArrayToRaster_3(tmp_path):
SCENARIO0_DIR = os.path.join(TEST_DIR, "scenario_0")
geotif = os.path.join(SCENARIO0_DIR, 'small_dem.tif')
profile = rio_profile(geotif)
data = rio_open(geotif)
with pushd(tmp_path):
fname = os.path.join(tmp_path, 'tmp_file.nc')
writeArrayToRaster(
data,
fname,
proj=profile['crs'],
gt=profile['transform'],
fmt='nc',
)
new_fname = os.path.join(tmp_path, 'tmp_file.tif')
prof = rio_profile(new_fname)
assert prof['driver'] == 'GTiff'


def test_robs():
assert robmin([1, 2, 3, np.nan])==1
assert robmin([1,2,3])==1
Expand Down
Loading