skinkie / reference

Personal repository where I collect working examples to understand inner workings while building PyNeTExConv
GNU Affero General Public License v3.0
1 stars 1 forks source link

problem epip_db_to_xml with the Swiss locales (also doesn't work for GTFS imports) #140

Closed ue71603 closed 1 month ago

ue71603 commented 1 month ago

from terminal:

python tool_script_runner.py ./scripts/scripts_regression.txt run.log swissmikro


C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\.venv\Scripts\python.exe epip_db_to_xml.py --log=swissmikro/run.log d:/aux_testing_processing/swissmikro/netex-import.duckdb d:/aux_testing_processing/swissmikro/netex-database.duckdb d:/aux_testing_processing/swissmikro/swissmikro-netex.xml
Traceback (most recent call last):
  File "C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\epip_db_to_xml.py", line 251, in <module>
    export_epip_network_offer(args.original, args.target, args.output)
  File "C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\epip_db_to_xml.py", line 120, in export_epip_network_offer
    all_locales = {org.locale for org in organisation_or_transport_organisation if org.locale is not None}
                   ^^^^^^^^^^
TypeError: unhashable type: 'Locale'

That's why I wanted to do the change.

skinkie commented 1 month ago

as mentioned; import netex_monkeypatching

ue71603 commented 1 month ago

added it to epip_db_to_db.py. New error while running python tool_script_runner.py ./scripts/scripts_regression.txt run.log swissmikro in the logging branch

2024-10-14 22:28:53,587 - testrunner - INFO - test_runner: epip_db_to_db.py with --log=swissmikro/run.log d:/aux_testing_processing/swissmikro/netex-import.duckdb d:/aux_testing_processing/swissmikro/netex-database.duckdb
C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\.venv\Scripts\python.exe epip_db_to_db.py --log=swissmikro/run.log d:/aux_testing_processing/swissmikro/netex-import.duckdb d:/aux_testing_processing/swissmikro/netex-database.duckdb
epip_line_memory
Traceback (most recent call last):
  File "C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\epip_db_to_db.py", line 57, in <module>
    main(args.source, args.target)
  File "C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\epip_db_to_db.py", line 41, in main
    epip_line_memory(source_database_file, target_database_file, generator_defaults)
  File "C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\transformers\epip.py", line 58, in epip_line_memory
    with sqlite3.connect(write_database) as write_con:
  File "C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\transformers\epip.py", line 64, in epip_line_memory
    lines: List[Line] = load_local(read_con, Line)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test\netexio\dbaccess.py", line 110, in load_local
    objs += list(load_embedded_transparent_generator(con, clazz, limit, filter, True))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: load_embedded_transparent_generator() takes from 2 to 4 positional arguments but 5 were given

2024-10-14 22:29:01,781 - testrunner - INFO - test_runner_timing: Execution time: 8 seconds

2024-10-14 22:29:01,781 - testrunner - ERROR - test_runner: Script epip_db_to_db.py returned an error. Terminating the block of scripts: swissmikro
(.venv) PS C:\Users\ue71603\MG_Daten\github\reference1\gtfs-netex-test> 
ue71603 commented 1 month ago

swiss_mikro.zip


{
    "block": "swissmikro",
    "scripts": [
        {"script": "clean_tmp", "args": "%%dir%%"},
        {"script": "gtfs_import_to_db.py", "args": "./aux_test_input/swiss_mikro.zip %%dir%%/gtfs-import.duckdb --log=%%log%% "},
        {"script": "gtfs_convert_to_db.py", "args": "--log=%%log%% %%dir%%/gtfs-import.duckdb %%dir%%/netex-import.duckdb"},
        {"script": "epip_db_to_db.py", "args": "--log=%%log%% %%dir%%/netex-import.duckdb %%dir%%/netex-database.duckdb"},
        {"script": "epip_db_to_xml.py", "args": "--log=%%log%% %%dir%%/netex-import.duckdb %%dir%%/netex-database.duckdb %%dir%%/%%block%%-netex.xml"},
        {"script": "./tools/tool_netex_stats.py", "args": "--log=%%log%% %%dir%%/%%block%%-netex.xml"},
        {"script": "netex_to_db.py", "args": "--log=%%log%% %%dir%%/%%block%%-netex.xml %%dir%%/netex2-database.duckdb"},
        {"script": "related_explorer.py", "args": "%%dir%%/netex2-database.duckdb ServiceJourney random %%dir%%/sj.xml"},
        {"script": "related_explorer.py", "args": "%%dir%%/netex2-database.duckdb Line random %%dir%%/line.xml"},
        {"script": "related_explorer.py", "args": "%%dir%%/netex2-database.duckdb ServiceJourney random %%dir%%/sj1.xml"},
        {"script": "related_explorer.py", "args": "%%dir%%/netex2-database.duckdb ServiceJourney random %%dir%%/sj2.xml"}
        ]
  }
skinkie commented 1 month ago

@ue71603 change pushed, but now working on related explorer that also had some collatoral damage.

ue71603 commented 1 month ago

damage done by me?

skinkie commented 1 month ago

No, yours truly.

skinkie commented 1 month ago

@ue71603 this was resolved during our "pair programming" session.