AequilibraE / qaequilibrae

Free QGIS add-on for transportation modeling
https://www.aequilibrae.com/qgis/latest/
Other
75 stars 24 forks source link

CSV use as default for assignment outputs (flows & skims) #178

Closed Art-Ev closed 3 years ago

Art-Ev commented 3 years ago

Is your feature request related to a problem?

During some project, we had issues with the reading of .omx for export to .csv (for skims results). Export button of data viewer lead to :

Traceback (most recent call last):
File "%appdata%/Roaming/QGIS/QGIS3\profiles\%profile%/python/plugins\AequilibraE\
matrix_procedures\display_aequilibrae_formats_dialog.py", line 202, in export
self.data_to_show.export(new_name)
File "%appdata%\Roaming\QGIS\QGIS3\profiles\%profile%\python\plugins\AequilibraE\aequilibrae
\aequilibrae\matrix\aequilibrae_matrix.py", line 676, in export
df = functools.reduce(lambda a,b: a.join(b,how='outer',rsuffix='_right'), dfs)
TypeError: reduce() of empty sequence with no initial value"

As AequilibraE is a more accessible version of AequilibraE python library, can we save all outputs in csv (in addition to .aem or .omx) ? CSV take more time to import/export but it's also a lot easier for some people to work with csv files.

Describe the solution you'd like

I know it's simple but Github Desktop is failing to clone AequilibraE GUI due to an issue with submodule "aequilibrae" (aequilibrae python library). Message "Failed to clone 'aequilibrae'. Retry scheduled"

Implementation in AequilibraE\paths_procedures\traffic_assignment_dialog.py : 
    add to line 420 : 
    fn_csv = os.path.join(self.output_path, "skims.csv")

   insert between line 425 and 426 : 
   cls.results.skims.export(fn_csv)

   insert between line 472 and 473 : 
   skims.export(fn_csv)

Describe alternatives you've considered

Fix export and work only with omx, but currently reading of omx is not as easy as csv files.

pedrocamargo commented 3 years ago

The default will be switched to saving to the results_database.sqlite that now accompanies the project database.

Art-Ev commented 3 years ago

Great ! Quick fix solution is here if people need to do this before next update.