Skip to content

Commit

Permalink
Fixes bug from #72, exception included.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancaraballo committed Apr 4, 2024
1 parent 20917d3 commit b0e6467
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ an example of manually testing the package components.

.. code:: python
singularity exec --env PYTHONPATH="$NOBACKUP/development/tensorflow-caney:$NOBACKUP/development/vhr-cloudmask" --nv -B $NOBACKUP,/explore/nobackup/people,/explore/nobackup/projects /explore/nobackup/projects/ilab/containers/vhr-cloudmask.sif pytest $NOBACKUP/development/vhr-cloudmask/tests
singularity exec --env PYTHONPATH="$NOBACKUP/development/tensorflow-caney:$NOBACKUP/development/vhr-cloudmask" --nv -B $NOBACKUP,/explore/nobackup/people,/explore/nobackup/projects /explore/nobackup/projects/ilab/containers/vhr-cloudmask.sif pytest $NOBACKUP/development/vhr-cloudmask/tests
Authors
====================
Expand Down
4 changes: 2 additions & 2 deletions vhr_cloudmask/model/pipelines/cloudmask_cnn_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ def calc_cloud_percentage(self, prediction: np.ndarray) -> float:
# get cloudy pixels
try:
non_cloud_pixels = unique_dict[0]
except IndexError:
except (IndexError, KeyError):
non_cloud_pixels = 0

# get cloudy pixels
try:
cloud_pixels = unique_dict[1]
except IndexError:
except (IndexError, KeyError):
cloud_pixels = 0

# percent cloud cover
Expand Down

0 comments on commit b0e6467

Please sign in to comment.