From df79b5b4cc3a29e933eb7e1198bafd74eecc7639 Mon Sep 17 00:00:00 2001 From: karenzshea Date: Thu, 12 Oct 2017 16:35:12 +0200 Subject: [PATCH] deprecation notices --- include/contractor/contractor_config.hpp | 2 +- include/nodejs/node_osrm_support.hpp | 2 +- scripts/gdb_printers.py | 1 - src/contractor/contractor.cpp | 3 ++- src/tools/contract.cpp | 2 +- src/tools/routed.cpp | 4 +--- test/nodejs/index.js | 6 +++--- unit_tests/library/tile.cpp | 18 ------------------ 8 files changed, 9 insertions(+), 29 deletions(-) diff --git a/include/contractor/contractor_config.hpp b/include/contractor/contractor_config.hpp index ceb067f49..7e420e7ca 100644 --- a/include/contractor/contractor_config.hpp +++ b/include/contractor/contractor_config.hpp @@ -65,7 +65,7 @@ struct ContractorConfig final : storage::IOConfig unsigned requested_num_threads; - // Deprecated + // DEPRECATED to be removed in v6.0 // A percentage of vertices that will be contracted for the hierarchy. // Offers a trade-off between preprocessing and query time. // The remaining vertices form the core of the hierarchy diff --git a/include/nodejs/node_osrm_support.hpp b/include/nodejs/node_osrm_support.hpp index e1b002570..0383e604a 100644 --- a/include/nodejs/node_osrm_support.hpp +++ b/include/nodejs/node_osrm_support.hpp @@ -158,7 +158,7 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo } else if (*v8::String::Utf8Value(algorithm_str) == std::string("CoreCH")) { - engine_config->algorithm = osrm::EngineConfig::Algorithm::CoreCH; + engine_config->algorithm = osrm::EngineConfig::Algorithm::CH; } else if (*v8::String::Utf8Value(algorithm_str) == std::string("MLD")) { diff --git a/scripts/gdb_printers.py b/scripts/gdb_printers.py index 76743c980..bae671903 100644 --- a/scripts/gdb_printers.py +++ b/scripts/gdb_printers.py @@ -144,7 +144,6 @@ class SVGPrinter (gdb.Command): self.re_bbox = None self.to_svg = { 'const osrm::engine::datafacade::ContiguousInternalMemoryDataFacade &': self.Facade, - 'const osrm::engine::datafacade::ContiguousInternalMemoryDataFacade &': self.Facade, 'const osrm::engine::datafacade::ContiguousInternalMemoryDataFacade &': self.Facade, 'osrm::engine::routing_algorithms::Facade': self.Facade, 'osrm::engine::DataFacade': self.Facade} diff --git a/src/contractor/contractor.cpp b/src/contractor/contractor.cpp index a9d0b1014..5366f1e6d 100644 --- a/src/contractor/contractor.cpp +++ b/src/contractor/contractor.cpp @@ -44,7 +44,8 @@ int Contractor::Run() { if (config.core_factor) { - util::Log(logWARNING) << "Using core factor is deprecated and will be ignored. Falling back to CH."; + util::Log(logWARNING) + << "Using core factor is deprecated and will be ignored. Falling back to CH."; config.core_factor = 1.0; } diff --git a/src/tools/contract.cpp b/src/tools/contract.cpp index 8cc1a999c..9d2f0644f 100644 --- a/src/tools/contract.cpp +++ b/src/tools/contract.cpp @@ -49,7 +49,7 @@ return_code parseArguments(int argc, "Number of threads to use")( "core,k", boost::program_options::value(&contractor_config.core_factor)->default_value(1.0), - "Percentage of the graph (in vertices) to contract [0..1]. Will always be 1.0")( + "DEPRECATED: Will always be 1.0. Percentage of the graph (in vertices) to contract [0..1].")( "segment-speed-file", boost::program_options::value>( &contractor_config.updater_config.segment_speed_lookup_paths) diff --git a/src/tools/routed.cpp b/src/tools/routed.cpp index 11aebd347..fb06167e9 100644 --- a/src/tools/routed.cpp +++ b/src/tools/routed.cpp @@ -62,10 +62,8 @@ std::istream &operator>>(std::istream &in, EngineConfig::Algorithm &algorithm) in >> token; boost::to_lower(token); - if (token == "ch") + if (token == "ch" || token == "corech") algorithm = EngineConfig::Algorithm::CH; - else if (token == "corech") - algorithm = EngineConfig::Algorithm::CoreCH; else if (token == "mld") algorithm = EngineConfig::Algorithm::MLD; else diff --git a/test/nodejs/index.js b/test/nodejs/index.js index d42de37ff..6d779115d 100644 --- a/test/nodejs/index.js +++ b/test/nodejs/index.js @@ -93,9 +93,9 @@ test('constructor: autoswitches to CoreCH for a CH dataset if capable', function test('constructor: throws if data doesn\'t match algorithm', function(assert) { assert.plan(3); - assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }); - assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_path}); }); - assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }); + assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, 'CoreCH with MLD data'); + assert.ok(function() { new OSRM({algorithm: 'CoreCH', path: monaco_path}); }, 'CoreCH with CH data'); + assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, 'MLD with CH data'); }); test('constructor: parses custom limits', function(assert) { diff --git a/unit_tests/library/tile.cpp b/unit_tests/library/tile.cpp index d160eb53d..90404844d 100644 --- a/unit_tests/library/tile.cpp +++ b/unit_tests/library/tile.cpp @@ -724,15 +724,6 @@ BOOST_AUTO_TEST_CASE(test_tile_speeds_ch) test_tile_speeds(osrm); } -BOOST_AUTO_TEST_CASE(test_tile_speeds_corech) -{ - using namespace osrm; - - auto osrm = - getOSRM(OSRM_TEST_DATA_DIR "/corech/monaco.osrm", osrm::EngineConfig::Algorithm::CoreCH); - test_tile_speeds(osrm); -} - BOOST_AUTO_TEST_CASE(test_tile_speeds_mld) { using namespace osrm; @@ -829,15 +820,6 @@ BOOST_AUTO_TEST_CASE(test_tile_nodes_ch) test_tile_nodes(osrm); } -BOOST_AUTO_TEST_CASE(test_tile_nodes_corech) -{ - using namespace osrm; - - auto osrm = - getOSRM(OSRM_TEST_DATA_DIR "/corech/monaco.osrm", osrm::EngineConfig::Algorithm::CoreCH); - test_tile_nodes(osrm); -} - BOOST_AUTO_TEST_CASE(test_tile_nodes_mld) { using namespace osrm;