Skip to content

Commit

Permalink
Add metrics to docs, fix docstring and test bug (r-earthengine#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
aazuspan committed Jan 18, 2022
1 parent 6502def commit 7c0dc6e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
23 changes: 22 additions & 1 deletion docs/modules/QA.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,25 @@ Extra.QA
.. autosummary::
:toctree: stubs

preprocess
preprocess

Metrics
-------

.. currentmodule:: ee_extra.QA.metrics

.. autosummary::
:toctree: stubs

listMetrics
getMetrics
MSE
RMSE
RASE
ERGAS
DIV
bias
CC
CML
CMC
UIQI
2 changes: 1 addition & 1 deletion ee_extra/QA/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class ERGAS(Metric):
>>> bands = ["B4", "B3", "B2"]
>>> img1 = ee.Image("COPERNICUS/S2_SR/20210703T170849_20210703T171938_T14SPG").select(bands)
>>> img2 = ee.Image("COPERNICUS/S2_SR/20210708T170851_20210708T171925_T14SPG").select(bands)
>>> metrics.ERGAS(img1, img2, bestEffort=True).getInfo()
>>> metrics.ERGAS(img1, img2, h=10, l=10, bestEffort=True).getInfo()
3774.9270912567363
"""

Expand Down
2 changes: 1 addition & 1 deletion tests/test_QA.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def test_all_metrics(self):
value = metric(img, modified, h=30, l=30)
else:
value = metric(img, modified)
self.assertIsInstance(value, (ee.Number, ee.Dictionary))
self.assertIsInstance(value, (ee.Number, ee.Dictionary))

0 comments on commit 7c0dc6e

Please sign in to comment.