Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.stats.quantile: minimalistic testsuite added #2325

Merged
merged 5 commits into from
Apr 27, 2022

Conversation

neteler
Copy link
Member

@neteler neteler commented Apr 26, 2022

This minimalistic testsuite triggers #2259 (segfault in r.stats.quantile).

The bugfix of r.stats.quantile in #2323 should make let this test pass.

@neteler neteler added this to the 8.0.2 milestone Apr 26, 2022
@neteler neteler self-assigned this Apr 26, 2022
@metzm
Copy link
Contributor

metzm commented Apr 26, 2022

Verification of the results would be nice (the TODO in the test):

27511:0:33.333333:134.717331
27511:1:66.666667:143.985499
27513:0:33.333333:140.669418
27513:1:66.666667:146.279022
27518:0:33.333333:115.140050
27518:1:66.666667:129.893631
27529:0:33.333333:96.325943
27529:1:66.666667:103.571231
27539:0:33.333333:123.216911
27539:1:66.666667:133.431442
27601:0:33.333333:89.850876
27601:1:66.666667:98.379255
27603:0:33.333333:91.602473
27603:1:66.666667:103.511017
27604:0:33.333333:75.695976
27604:1:66.666667:87.048233
27605:0:33.333333:102.274857
27605:1:66.666667:112.512177
27606:0:33.333333:108.092461
27606:1:66.666667:124.441594
27607:0:33.333333:124.740369
27607:1:66.666667:135.907516
27608:0:33.333333:91.426587
27608:1:66.666667:104.532201
27610:0:33.333333:81.664024
27610:1:66.666667:92.704079

@neteler
Copy link
Member Author

neteler commented Apr 26, 2022

Verification of the results would be nice (the TODO in the test):

I have no clue how that would be done...

@metzm
Copy link
Contributor

metzm commented Apr 26, 2022

Verification of the results would be nice (the TODO in the test):

I have no clue how that would be done...

See e.g. https://github.com/OSGeo/grass/blob/main/raster/r.info/testsuite/test_r_info.py for inspiration. Essentially, you simply need to provide a reference result against which to compare the test results.

@neteler
Copy link
Member Author

neteler commented Apr 26, 2022

It seems that it is only working for r.info. I adapted it (810bbd7) but get

GRASS nc_spm_08_grass7/user1:testsuite > python test_r_stats_quantile.py 
E27511:0:33.333333:134.717331
27511:1:66.666667:143.985499
27513:0:33.333333:140.669418
...
27610:1:66.666667:92.704079

Computing histograms
 100%
 100%
Computing bins
Binning data
 100%
Sorting bins
 100%
Computing quantiles
Printing quantiles

.
======================================================================
ERROR: test_flagp (__main__.TestStatsQuantile)
Testing flag p with map zipcodes and elevation
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mneteler/software/grass_main/raster/r.stats.quantile/testsuite/test_r_stats_quantile.py", line 63, in test_flagp
    self.assertModuleKeyValue(
TypeError: TestCase.assertModuleKeyValue() missing 2 required positional arguments: 'sep' and 'precision'

----------------------------------------------------------------------
Ran 2 tests in 1.123s
FAILED (errors=1)

See respective gunittest function:

def assertModuleKeyValue(

Or am I missing something?

@neteler
Copy link
Member Author

neteler commented Apr 27, 2022

Thanks @petrasovaa for updating this test!

@neteler neteler merged commit 012da41 into OSGeo:main Apr 27, 2022
@neteler neteler deleted the testsuite_r_stats_quantile branch April 27, 2022 16:30
neteler added a commit that referenced this pull request Apr 27, 2022
* r.stats.quantile: minimalistic testsuite added, triggers #2259

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
* r.stats.quantile: minimalistic testsuite added, triggers OSGeo#2259

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
* r.stats.quantile: minimalistic testsuite added, triggers OSGeo#2259

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
neteler added a commit to nilason/grass that referenced this pull request Nov 7, 2023
* r.stats.quantile: minimalistic testsuite added, triggers OSGeo#2259

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants