Skip to content

Commit d0bdccd

Browse files
authored
DAS-2456 Improves edge detection during grid perimeter determination. (#57)
* DAS-2456 Add tolerance level when comparing floats * DAS-2456 update changelog with release links * DAS-2456 Remove trailing whitespaces * DAS-2456 Remove unused imports * DAS-2456 Add comments to clrify the updates to the function * DAS-2456 Remove trailing spaces * DAS-2456 Simplify function and add asserts * DAS-2456 Add rtol in the isClose checks * DAS-2456 update and format for a test array * DAS-2456 Update CHANGELOG comments
1 parent 8869510 commit d0bdccd

11 files changed

Lines changed: 73 additions & 46 deletions

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [v1.1.16] - 2025-10-17
2+
3+
### Fixed
4+
5+
- Add tolerance when comparing grid extent float values in the function
6+
`remove_points_outside_grid_extents` to prevent inaccurate spatial subset
7+
results. Some issues caused by DAS-2424 updates are being resolved in this
8+
release as part of DAS-2456.
9+
110
## [v1.1.15] - 2025-10-24
211

312
### Changed
@@ -198,7 +207,9 @@ Repository structure changes include:
198207

199208
For more information on internal releases prior to NASA open-source approval,
200209
see legacy-CHANGELOG.md.
201-
210+
[v1.1.16]: https://github.com/nasa/harmony-opendap-subsetter/releases/tag/1.1.16
211+
[v1.1.15]: https://github.com/nasa/harmony-opendap-subsetter/releases/tag/1.1.15
212+
[v1.1.14]: https://github.com/nasa/harmony-opendap-subsetter/releases/tag/1.1.14
202213
[v1.1.13]: https://github.com/nasa/harmony-opendap-subsetter/releases/tag/1.1.13
203214
[v1.1.12]: https://github.com/nasa/harmony-opendap-subsetter/releases/tag/1.1.12
204215
[v1.1.11]: https://github.com/nasa/harmony-opendap-subsetter/releases/tag/1.1.11

docker/service_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.15
1+
1.1.16

hoss/adapter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,16 @@ def process_item(self, item: Item, source: Source):
132132
url, title=staged_filename, media_type=mime, roles=['data']
133133
)
134134

135-
# Return the STAC record
136-
return result
137135
except Exception as exception:
138136
self.logger.exception(exception)
139137
raise_from_hoss_exception(exception)
140138
finally:
141139
# Clean up any intermediate resources
142140
shutil.rmtree(workdir)
143141

142+
# Return the STAC record
143+
return result
144+
144145
def validate_message(self):
145146
"""Check the service was triggered by a valid message containing
146147
the expected number of granules.

hoss/bbox_utilities.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import json
1818
from collections import namedtuple
19-
from logging import Logger
2019
from typing import Dict, List, Optional, Tuple, Union
2120

2221
import numpy as np

hoss/dimension_utilities.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
1111
"""
1212

13-
from logging import Logger
1413
from pathlib import PurePosixPath
1514
from typing import Dict, Set, Tuple
1615

hoss/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,5 +312,6 @@ class InvalidVariableRequest(CustomNoRetryError):
312312
def __init__(self, variable_names):
313313
super().__init__(
314314
'InvalidVariableRequest',
315-
f'Some variables requested are not supported and could not be processed: "{variable_names}".',
315+
f'Some variables requested are not supported and could not be processed: '
316+
f'"{variable_names}".',
316317
)

hoss/projection_utilities.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,16 @@ def remove_points_outside_grid_extents(
554554
exception if the resulting grid is empty.
555555
556556
"""
557+
tolerance = 1e-9
558+
# This gets the mask of points within the granule extent.
559+
# The points are checked to make sure they are within
560+
# all 4 extents
557561

558562
mask = (
559-
(finite_x >= granule_extent["x_min"])
560-
& (finite_x <= granule_extent["x_max"])
561-
& (finite_y >= granule_extent["y_min"])
562-
& (finite_y <= granule_extent["y_max"])
563+
(finite_x >= granule_extent['x_min'] - tolerance)
564+
& (finite_x <= granule_extent['x_max'] + tolerance)
565+
& (finite_y >= granule_extent['y_min'] - tolerance)
566+
& (finite_y <= granule_extent['y_max'] + tolerance)
563567
)
564568

565569
finite_x = finite_x[mask]

hoss/subset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
"""
77

8-
from logging import Logger
98
from typing import List, Set
109

1110
from harmony_service_lib.message import Message, Source

hoss/utilities.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""
66

77
import mimetypes
8-
from logging import Logger
98
from os import sep
109
from os.path import splitext
1110
from shutil import move

hoss/variable_utilities.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def check_invalid_variable_request(
3434
# varinfo exclusions will automatically be applied.
3535
if not requested_variables:
3636
get_logger().info(
37-
f'All variables are requested. The following variables will be excluded: {unprocessable_variables}'
37+
f'All variables are requested. The following variables will be excluded:'
38+
f'{unprocessable_variables}'
3839
)
3940
return
4041

0 commit comments

Comments
 (0)