fiftysevendegreesofrad / sdna_plus

Fully open release with all advanced sDNA+ features
Other
10 stars 1 forks source link

Invalid alias in ArcGIS Python Toolbox #95

Open lpinner opened 1 month ago

lpinner commented 1 month ago

The sDNA ArcGIS python toolbox alias is invalid:

self.alias = "Spatial Design Network Analysis"

From the ArcGIS documentation:

toolbox alias must begin with a letter (a-z, A-Z) and can only consist of letters and numbers (0-9). Spaces and special characters are not allowed (for example, _, !, @, #, $, %, -).

So when users try to use the toolbox from within a script with arcpy.ImportToolbox, python will raise a SyntaxError if they try to use the invalid alias).

Suggest you change the alias to:

self.alias = "sDNA"

For users coming across this issue, a workaround is to use the module_name parameter to set a valid temporary alias when calling arcpy.ImportToolbox.

JamesParrott commented 3 weeks ago

@lpinner Thanks Luke. We'll discuss this at the next opportunity. Are you happy to use the work around for the time being?