Skip to content

Commit

Permalink
update nigiri
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed May 20, 2023
1 parent 438a96e commit 92855f7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
[nigiri]
[email protected]:motis-project/nigiri.git
branch=master
commit=0e97273c4954294fa10d03c6917fc41fc46d5473
commit=bb0b0669b1ba52ef364f1962928a8d9a77e4478f
[osmium]
[email protected]:motis-project/libosmium.git
branch=master
Expand Down
4 changes: 2 additions & 2 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
7584788766491314502
15472054091053223076
cista fce53787252d749727eddf2bfbb40c679b4306ba
zlib fe8e13ffca867612951bc6baf114e5ac8b00f305
boost be5235eb2258d2ec19e32546ab767a62311d9b46
Expand Down Expand Up @@ -27,7 +27,7 @@ libressl 390253a44ceef00eb620c38606588414326e9f23
net 44674d2f3917e20b7019a0f7254d332522c36fb7
unordered_dense 77e91016354e6d8cba24a86c5abb807de2534c02
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
nigiri 0e97273c4954294fa10d03c6917fc41fc46d5473
nigiri bb0b0669b1ba52ef364f1962928a8d9a77e4478f
lua 7bb93325b26f84c7e8b51fcbd857361ce7605a1d
luabind 9223568bbcf818ecfb1001d49f567627ee10852a
tbb 2067af88257710d07253761655a802732a32496e
Expand Down
40 changes: 22 additions & 18 deletions tools/routing_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from enum import Enum
import subprocess


routers = ["/routing", "/nigiri"]
generate = False
run_routers = ["/nigiri"]
cmp_routers = ["/routing", "/nigiri"]

num_queries = 500

Expand All @@ -27,7 +28,7 @@ def cmd(self):
]

cmd.extend(["--routers"])
cmd.extend(routers)
cmd.extend(cmp_routers)

cmd.extend(["--query_count", str(num_queries)])

Expand Down Expand Up @@ -63,11 +64,13 @@ def cmd(self):
file_name = file_name + "_sdest"
cmd.extend(["--dest_type", "station"])

query_files = [f"queries/q_{file_name}-{r[1:]}.txt" for r in routers]
response_files = [f"responses/r_{file_name}-{r[1:]}.txt" for r in routers]
run_query_files = [f"queries/q_{file_name}-{r[1:]}.txt" for r in run_routers]
run_response_files = [f"responses/r_{file_name}-{r[1:]}.txt" for r in run_routers]
cmp_query_files = [f"queries/q_{file_name}-{r[1:]}.txt" for r in cmp_routers]
cmp_response_files = [f"responses/r_{file_name}-{r[1:]}.txt" for r in cmp_routers]
cmd.extend(["--out", f"queries/q_{file_name}-TARGET.txt"])

return cmd, query_files, response_files
return cmd, run_query_files, run_response_files, cmp_query_files, cmp_response_files


subprocess.check_call(["mkdir", "-p", "queries", "responses"])
Expand All @@ -79,16 +82,17 @@ def cmd(self):
q.interalmodal_dest = intermodal_dest
q.forward = forward

cmd, query_files, response_files = q.cmd()
print(" ".join(cmd))
try:
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except subprocess.CalledProcessError as e:
print(" ".join(e.cmd))
print(e.output)
raise e
generate_cmd, run_query_files, run_response_files, cmp_query_files, cmp_response_files = q.cmd()
if generate:
try:
print(" ".join(generate_cmd))
subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except subprocess.CalledProcessError as e:
print(" ".join(e.cmd))
print(e.output)
raise e

for query_file, response_file in zip(query_files, response_files):
for query_file, response_file in zip(run_query_files, run_response_files):
motis_cmd = [
"./motis",
"-c", "input/config.ini",
Expand All @@ -105,13 +109,13 @@ def cmd(self):

compare_cmd = ["./motis", "compare"]
compare_cmd.append("--queries")
compare_cmd.extend(query_files)
compare_cmd.extend(cmp_query_files)
compare_cmd.append("--responses")
compare_cmd.extend(response_files)
compare_cmd.extend(cmp_response_files)
print(" ", " ".join(compare_cmd))

try:
subprocess.check_call(compare_cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except subprocess.CalledProcessError as e:
subprocess.run(e.cmd)
raise e
raise e

0 comments on commit 92855f7

Please sign in to comment.