DOI-USGS / gems-tools-pro

GeMS Tools for ArcGIS Pro
Creative Commons Zero v1.0 Universal
45 stars 15 forks source link

GeMS definition has not attribute standard fields? #65

Closed BenjiDa closed 1 year ago

BenjiDa commented 1 year ago

Just upgraded to the new tools and am having an issue with the validate database tool. See error below...

Traceback (most recent call last): File "C:\Users\bmelosh\Documents\ArcGIS\Tools\gems-tools-pro-2.11\Scripts\GeMS_ValidateDatabase.py", line 92, in  AttributeError: module 'GeMS_Definition' has no attribute 'standard_fields' Failed script Validate Database...

ethoms-usgs commented 1 year ago

I just downloaded the latest toolbox and the tool ran fine for me.

Two weird things with your error: The line of the reported error (92) in the latest script is blank. standard_fields is called on line 103

And GeMS_Definition.py in 2.11 has that list (line 517).

Could you close Pro, download, and try again? (ignore for now the 'obsolete version' warning that 2.11 will give you)

BenjiDa commented 1 year ago

Thanks! That seemed to have helped but the tool is snagging again on another issue saying list index out of range, but I notice some of these errors are being thrown on blank lines or commented out lines. I tried closing arcPro and downloaded the toolbox again but get the same results. If it is working fine for your system I am guessing it is something on my end but I am at a loss of what to try. Thanks.

Traceback (most recent call last):
  File "C:\Users\bmelosh\Documents\ArcGIS\Tools\gems-tools-pro-2.11\Scripts\GeMS_ValidateDatabase.py", line 1543, in <module>
    # rule 2.2
  File "C:\Users\bmelosh\Documents\ArcGIS\Tools\gems-tools-pro-2.11\Scripts\GeMS_ValidateDatabase.py", line 1434, in main
    
  File "C:\Users\bmelosh\Documents\ArcGIS\Tools\gems-tools-pro-2.11\Scripts\GeMS_ValidateDatabase.py", line 509, in glossary_check
    and not f.name.lower().endswith("_id")
  File "C:\Users\bmelosh\Documents\ArcGIS\Tools\gems-tools-pro-2.11\Scripts\GeMS_ValidateDatabase.py", line 160, in which_id
    }
IndexError: list index out of range
alwunder commented 1 year ago

I am having the same issue, with the same error on line 1543 and then another error on 1471. It seems to be upset with the fact that the HierarchyKey value is not yet populated:

3.10 HierarchyKey values in DescriptionOfMapUnits are unique and well formed
Traceback (most recent call last):
  File "C:\GIS\TOOLS\GeMS\gems-tools-pro-2.11\Scripts\GeMS_ValidateDatabase.py", line 1543, in <module>
    # rule 2.2
  File "C:\GIS\TOOLS\GeMS\gems-tools-pro-2.11\Scripts\GeMS_ValidateDatabase.py", line 1471, in main
    
ValueError: too many values to unpack (expected 2)

The database I am testing this on has some blank standalone tables, as it is still under construction. Previously, I always used the validation script to give me the list of missing Glossary and DescriptionOfMapUnits items to help me fill the tables in. It would be a significant disruption to my workflow if that were no longer the case.

ethoms-usgs commented 1 year ago

Yeah, that's all very odd. Still seems like the caching problem I have read about when a program that accessing a python file is left open while the source file changes. The program may be trying to run the previously compiled and cached file from memory and but then goes to the new file to track down the line when it hits an error - or vice versa, I don't really know.

If your practice is to always download new versions of the toolbox into the same folder, try running the tools from a new folder from within a new Pro map. Which is not say that this should be a workaround for all projects going forward, but it may help troubleshoot the problem.

BenjiDa commented 1 year ago

Hey all,

I've tried various things including restarting arc, restarting the computer, downloading the tool again, refreshing, deleting the cache, and deleting the pycache folder. Still no luck. This is the error I get now:

Traceback (most recent call last):
  File "C:\Users\bmelosh\Documents\ArcGIS\TEST\gems-tools-pro-2.11.1\Scripts\GeMS_ValidateDatabase.py", line 1555, in <module>
    val["rule2_1"] = rule2_1_results[0]
  File "C:\Users\bmelosh\Documents\ArcGIS\TEST\gems-tools-pro-2.11.1\Scripts\GeMS_ValidateDatabase.py", line 1430, in main
    else "a metadata summary from mp"
  File "C:\Users\bmelosh\Documents\ArcGIS\TEST\gems-tools-pro-2.11.1\Scripts\GeMS_ValidateDatabase.py", line 256, in check_fields
    
KeyError: 'GeologicMap'

At this point I will revert to the old version of the tool, and hopefully continue trouble shooting at some point. If anyone finds a work around please let me know.

Thanks.

ethoms-usgs commented 1 year ago

Apologies! I found that error today and posted a new fix, v2.11.2