#2269: r.univar silent instead of NaN
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Raster | Version: svn-releasebranch64
Keywords: r.univar | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
r.univar should not remain silent when the computational
region is only containing NULL cells. Instead "NaN" should be
printed as result for the individual min, max, etc values.
#2269: r.univar silent instead of NaN
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Raster | Version: svn-releasebranch64
Keywords: r.univar | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Comment(by wenzeslaus):
Do we have a standard how to represent NaN (''not a number'') in GRASS (as
a text)?
For example in Python:
{{{
#!python
>>> a = float('nan')
>>> a
nan
>>> a = float('NaN')
>>> a
nan
>>> a = float('NAN')
>>> a
nan
>>> a = float('nAn')
>>> a
nan
}}}
(And the same for `inf`.)
Is it even appropriate that `r.univar` would give NaNs? Wouldn't be non-
zero return code and a error message more appropriate? (Perhaps not, but
we should consider the options.)
#2269: r.univar silent instead of NaN
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Raster | Version: svn-releasebranch64
Keywords: r.univar | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Comment(by wenzeslaus):
The same applies for `r3.univar`.
It is especially bad for `-g` flag where module is used as a part of
something bigger and the caller expects valid output when module ended
with non-zero return code. Now it can end in the best case report and
empty output when expecting something but no better error message can be
provided.