SMByC / AcATaMa

AcATaMa is a powerful and complete Qgis plugin for accuracy assessment that provides comprehensive support for sampling, response design and estimation.
https://smbyc.github.io/AcATaMa/
GNU General Public License v3.0
15 stars 5 forks source link

"Error in AcATaMa QGIS Plugin: 'sip.enumtype' Object Not Iterable" #22

Closed vclaudio-hub closed 1 week ago

vclaudio-hub commented 1 week ago

I've just updated AcATaMa to the latest version, and I keep getting the following error both when I try to generate samples and when I compute the accuracy assessment (I didn't have this problem with older versions):

The error is: 'sip.enumtype' object is not iterable

Traceback (most recent call last):

php
Copia codice
File "C:\Users\CV21026\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\AcATaMa\utils\system_utils.py", line 36, in wrapper
    return func(*args, **kwargs)

File "C:\Users\CV21026\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\AcATaMa\core\sampling_design.py", line 335, in stratified_random_sampling_finished
    sampling_report = SamplingReport(sampling_layer_generated, sampling, sampling_conf)

File "C:\Users\CV21026\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\AcATaMa\gui\sampling_report.py", line 88, in __init__
    for area_unit in sorted(QgsUnitTypes.AreaUnit, key=lambda x: x.value):
TypeError: 'sip.enumtype' object is not iterable

Nevertheless, the points are created, so I can use the response design window, and I can correctly save the GeoPackage containing the information I need to calculate the accuracies.

However, if I try to perform the analysis directly from the plugin, I obtain the same error:

2024-10-17T14:10:48 WARNING Traceback (most recent call last):
    File "C:\Users\CV21026\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\AcATaMa\gui\acatama_dockwidget.py", line 533, in open_accuracy_assessment_results
        self.accuracy_assessment_window = AccuracyAssessmentWindow()
    File "C:\Users\CV21026\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\AcATaMa\core\analysis.py", line 172, in __init__
        for area_unit in sorted(QgsUnitTypes.AreaUnit, key=lambda x: x.value):
TypeError: 'sip.enumtype' object is not iterable

What could be the reason for that?

Thank you

XavierCLL commented 1 week ago

Hi @vclaudio-hub

That error comes from the Qgis Area Unit types, in the latest version of the plugin I changed an old code to use a better way to manage the area unit using that Qgis function, and it was introduced in Qgis 3.30. So it seems that you are using a Qgis version < 3.30, try to update the Qgis version (and recommended) to the LTR and test it again and let me know please.

Regards, Xavier

vclaudio-hub commented 1 week ago

Hello, I've updated QGIS to the latest long-term version, and the plugin works fine.

I truly appreciate your help,

Claudio

XavierCLL commented 1 week ago

Glad to hear that and good to confirm that this plugin required Qgis =>3.30, thanks for letting me know!