From e57c8c943b60c3333a5f7ba067a859cb464e2ca7 Mon Sep 17 00:00:00 2001 From: "Carolyn.Maynard" Date: Thu, 18 Sep 2025 11:24:34 -0700 Subject: [PATCH 1/2] Add WARNING and INFO mgs to clarify routing module selection --- src/routing/Routing_Py_Adapter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/routing/Routing_Py_Adapter.cpp b/src/routing/Routing_Py_Adapter.cpp index 4dbb87520d..6569a37e1a 100644 --- a/src/routing/Routing_Py_Adapter.cpp +++ b/src/routing/Routing_Py_Adapter.cpp @@ -19,17 +19,20 @@ Routing_Py_Adapter::Routing_Py_Adapter(std::string t_route_config_file_with_path //Import ngen_main. Will throw error if module isn't available //in the embedded interpreters PYTHON_PATH try { + LOG("Trying t-route module ngen_routing.ngen_main.", LogLevel::INFO); this->t_route_module = utils::ngenPy::InterpreterUtil::getPyModule("ngen_routing.ngen_main"); - LOG("Legacy t-route module detected; use of this version is deprecated!", LogLevel::WARNING); + LOG("Routing module ngen_routing.ngen_main detected and used. Use of this version is deprecated!", LogLevel::WARNING); } catch (const pybind11::error_already_set& e){ try { + LOG("Module ngen_routing.ngen_main not found; Trying different t-route module", LogLevel::WARNING); + LOG("Trying t-route module nwm_routing.__main__.", LogLevel::INFO); // The legacy module has a `nwm_routing.__main__`, so we have to try this one second! this->t_route_module = utils::ngenPy::InterpreterUtil::getPyModule("nwm_routing.__main__"); - LOG("Legacy t-route module nwm_routing.__main__ detected and used.", LogLevel::DEBUG); + LOG("Routing module nwm_routing.__main__ detected and used.", LogLevel::INFO); } catch (const pybind11::error_already_set& e){ - LOG("Unable to import a supported routing module.", LogLevel::FATAL); + LOG("Unable to import a supported routing module.", LogLevel::SEVERE); throw e; } } From 32a353026e12256359a53d3344b1daf67708708c Mon Sep 17 00:00:00 2001 From: "Carolyn.Maynard" Date: Thu, 18 Sep 2025 14:26:19 -0700 Subject: [PATCH 2/2] Removed deprecated code per OWP --- src/routing/Routing_Py_Adapter.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/routing/Routing_Py_Adapter.cpp b/src/routing/Routing_Py_Adapter.cpp index 6569a37e1a..f003aa4893 100644 --- a/src/routing/Routing_Py_Adapter.cpp +++ b/src/routing/Routing_Py_Adapter.cpp @@ -16,25 +16,15 @@ Routing_Py_Adapter::Routing_Py_Adapter(std::string t_route_config_file_with_path t_route_config_path(t_route_config_file_with_path){ //hold a reference to the interpreter, ensures an interpreter exists as long as the reference is held interpreter = utils::ngenPy::InterpreterUtil::getInstance(); - //Import ngen_main. Will throw error if module isn't available - //in the embedded interpreters PYTHON_PATH + // Import the routing module. An error will be thrown if module isn't available + // in the embedded interpreters PYTHON_PATH try { - LOG("Trying t-route module ngen_routing.ngen_main.", LogLevel::INFO); - this->t_route_module = utils::ngenPy::InterpreterUtil::getPyModule("ngen_routing.ngen_main"); - LOG("Routing module ngen_routing.ngen_main detected and used. Use of this version is deprecated!", LogLevel::WARNING); + this->t_route_module = utils::ngenPy::InterpreterUtil::getPyModule("nwm_routing.__main__"); + LOG("Routing module nwm_routing.__main__ detected and used.", LogLevel::INFO); } - catch (const pybind11::error_already_set& e){ - try { - LOG("Module ngen_routing.ngen_main not found; Trying different t-route module", LogLevel::WARNING); - LOG("Trying t-route module nwm_routing.__main__.", LogLevel::INFO); - // The legacy module has a `nwm_routing.__main__`, so we have to try this one second! - this->t_route_module = utils::ngenPy::InterpreterUtil::getPyModule("nwm_routing.__main__"); - LOG("Routing module nwm_routing.__main__ detected and used.", LogLevel::INFO); - } - catch (const pybind11::error_already_set& e){ - LOG("Unable to import a supported routing module.", LogLevel::SEVERE); - throw e; - } + catch (const pybind11::error_already_set& e) { + LOG("Unable to import a supported routing module.", LogLevel::FATAL); + throw e; } }