Skip to content

Commit

Permalink
remove deprecated np.NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
2320sharon committed Oct 25, 2024
1 parent ab418af commit e5d8486
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/coastseg/extracted_shoreline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,9 +1261,9 @@ def simplified_find_contours(
# make a copy of the im_labels array as a float (this allows find contours to work))
im_labels_masked = im_labels.copy().astype(float)
# Apply the cloud mask by setting masked pixels to NaN
im_labels_masked[cloud_mask] = np.NaN
im_labels_masked[cloud_mask] = np.nan
# only keep the pixels inside the reference shoreline buffer
im_labels_masked[~reference_shoreline_buffer] = np.NaN
im_labels_masked[~reference_shoreline_buffer] = np.nan

# 0 or 1 labels means 0.5 is the threshold
contours = measure.find_contours(im_labels_masked, 0.5)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_merge_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def merged_config_no_nulls_no_index_right():
def merged_config_nulls():
data = {
"type": ["bbox", "bbox", "roi", "roi", "shoreline", "shoreline"],
"id": [None, np.NaN, "B", "B", "D", "C"],
"id": [None, np.nan, "B", "B", "D", "C"],
"geometry": [
Point(0, 0),
Point(0, 0),
Expand All @@ -725,7 +725,7 @@ def merged_config_nulls():
def merged_config_nulls_all_unique():
data = {
"type": ["bbox", "bbox", "roi", "roi", "shoreline", "shoreline"],
"id": [None, np.NaN, "Z", "B", "D", "C"],
"id": [None, np.nan, "Z", "B", "D", "C"],
"geometry": [
Point(0, 0),
Point(1, 1),
Expand Down

0 comments on commit e5d8486

Please sign in to comment.