create_from_gmns Resolved_groups Error

12 views
Skip to first unread message

Connor Williams

unread,
Jan 28, 2025, 11:55:16 AMJan 28
to AequilibraE
Hi,

I've been trying to run the current python version of Aequilibrae using a Linux Docker, but I've been having problems creating a new project with my link and node files using create_from_gmns. The current error is UnboundLocalError: cannot access local variable 'resolved_groups' where it is not associated with a value 
Which happens when AequilibraE tries to save_modes_to_aeq. It also refuses to recognize my is_centroid column.

Anyone have any idea why this is the case?

Here's list of the errors I've been encountering, along with the code that I am using. The bottom one is the most recent, though the other ones are included for context.
I've also included screen shots of how the link and node files are formatted. 

Thanks
Screenshot 2025-01-28 at 9.23.03 AM.png
Aequilibrae Errors.pdf
Screenshot 2025-01-28 at 9.27.11 AM.png

Jamie Cook

unread,
Jan 28, 2025, 9:49:30 PMJan 28
to AequilibraE
That would appear to be a bug in the GMNS importer which is fixed in this PR: https://github.com/AequilibraE/aequilibrae/pull/608

However, this was happening because "uses_df" was == None, which seems to happen if you don't pass a "uses_path" file to the constructor of the GMNSBuilder class

Screenshot 2025-01-29 124649.png Screenshot 2025-01-29 124425.png

So, while this would be fixed in an upcoming release, you may be able to work around it by providing that path to a uses csv file.

Connor Williams

unread,
Jan 29, 2025, 7:05:06 PMJan 29
to AequilibraE
Thanks for advice, using a uses csv file got around the error. 

Unfortunately I've run in to another error. I thought that AequilibraE reads its default modes as c,t,b,w and if the link allows multiple modes it's written as "cw", etc. 
Formatting my allowed_used/modes like this, I'm getting the error below.

Traceback (most recent call last):
  File "//app/userdata/Worked_on_Code/Create_from_gmns.py", line 132, in <module>
   
    ^
  File "/usr/local/lib/python3.11/site-packages/aequilibrae/project/network/network.py", line 253, in create_from_gmns
    gmns_builder.doWork()
  File "/usr/local/lib/python3.11/site-packages/aequilibrae/project/network/gmns_builder.py", line 175, in doWork
    mode_ids_list = self.save_modes_to_aeq()
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aequilibrae/project/network/gmns_builder.py", line 449, in save_modes_to_aeq
    ids.add(modes[mode])
            ~~~~~^^^^^^
KeyError: 'cwbt'

I believe this might be related to the use_group file I'm using. I've never used a use_group file before so it may be formatted wrong. I'm using the one provided in the create_from_gmns example.

Any help would be greatly appreciated. I've included the code that I'm using, along with a screenshot of the link's file and use_group file.

Thanks.
Screenshot 2025-01-29 at 5.03.44 PM.png
Screenshot 2025-01-28 at 9.27.11 AM.png
Create_from_gmns.py
Reply all
Reply to author
Forward
0 new messages