Bug report #15713

processing: grass7 algorithms broken, (falsely) claims grass7 not installed

Added by Mathieu Pellerin - nIRV over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:23636

Description

For ~1 week now, I can't execute any grass7 algorithm within processing. When I try to do so, I can an error message telling me Grass7 is not installed, which is incorrect,

Looking into the code a bit, I realized the "grass7 not installed" message is triggered whenever a test runalg() fails (in Grass7Utils.py). The test is as follow:

runalg(
                'grass7:v.voronoi',
                points(),
                False,
                False,
                '270778.60198,270855.745301,4458921.97814,4458983.8488',
                -1,
                0.0001,
                0,
                None,
            )

Running this test manually, the failure here is not due to missing Grass7, but to the number of arguments provided != (alg.getVisibleParametersCount() + alg.getVisibleOutputsCount())

This is what I get if I the runalg() test in python console:

Error: Wrong number of parameters
ALGORITHM: v.voronoi - Creates a Voronoi diagram from an input vector layer containing points.
    input <ParameterVector>
    -l <ParameterBoolean>
    -t <ParameterBoolean>
    GRASS_REGION_PARAMETER <ParameterExtent>
    GRASS_SNAP_TOLERANCE_PARAMETER <ParameterNumber>
    GRASS_MIN_AREA_PARAMETER <ParameterNumber>

Looking into value for variables at play here, I get:
- len(args) = 8
- alg.getVisibleParametersCount() = 6
- alg.getVisibleOutputsCount() = 0

So indeed, 8 != 6, which throws an error that ends up being (mis-)interpreted as me not having Grass7 installed.

Victor, hopefully this time it's not a bigger-than-processing issue ;)

History

#1 Updated by Victor Olaya over 7 years ago

25d0351 should fix it

Please confirm and close the ticket

Thanks for the report!

#2 Updated by Alexander Bruy over 7 years ago

  • Status changed from Open to Feedback

#3 Updated by Mathieu Pellerin - nIRV over 7 years ago

  • Resolution set to fixed/implemented
  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

All good now. Thanks again Victor.

Also available in: Atom PDF