diff --git a/.gitignore b/.gitignore index 76520d457a..19aebe0788 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ source/jormungandr/jormungandr/_version.py .cache *.gcov .mypy_cache +.pytest_cache diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000000..ae9f486661 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,31 @@ +pull_request_rules: + - name: automatic merge when CI passes and 2 reviews + conditions: + - "#approved-reviews-by>=2" + - "#review-requested=0" + - "#changes-requested-reviews-by=0" + - "#commented-reviews-by=0" + - status-success=continuous-integration/travis-ci/pr + - status-success=default + - status-success=codecov/project + - status-success=codecov/patch + - base=dev + - label!=dot_not_merge + - label!=wip + - label!=waiting + - label!=merge_after_release + - author=@coreteam + actions: + merge: + method: merge + strict: smart # To avoid multiple builds at once on the CI + strict_method: rebase # We want Dev rebased onto the PR + - name: delete head branch after merge + conditions: [] + actions: + delete_head_branch: {} + - name: remove outdated reviews + conditions: + - base=master + actions: + dismiss_reviews: {} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dfb5d58c48..916085544d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ repos: exclude: ^source/tests/chaos/chaos_loading.sql # Otherwise, Sql commands get corrupted - id: check-ast - id: check-merge-conflict + - id: check-yaml - id: flake8 language_version: python2.7 - repo: https://github.com/CanalTP/navitia-pre-commit diff --git a/.travis.yml b/.travis.yml index 356d6549af..9082cb3b26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ addons: packages: - clang-format-6.0 - rabbitmq-server + - jq + - curl services: - docker @@ -47,5 +49,7 @@ matrix: - bash source/scripts/build_protobuf.sh script: - pre-commit run --all --show-diff-on-failure + - ./source/scripts/checkJenkinsJob.sh Artemis + - ./source/scripts/checkJenkinsJob.sh Artemis_idfm exclude: - python: "3.6" diff --git a/debian/changelog b/debian/changelog index 119e7946bb..1cec58d1f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,26 @@ +navitia2 (2.87.0) unstable; urgency=low + + * Jormun: Hide Tags=[] option for /line_reports and /trafic_reports + * Jormun: Add type annotation on traveler_profile + * Jormun: Remove excess tickets and ticket links inside response + * Ed: use fare_zone_id instead of zone_id in fusio_parser + * [Kraken] fix count in places_nearby + * [Kraken] Update metadatas for /status requests + * Jormun: log response from bragi that aren't json + * Handle disruption with multiple stop_points in same area / repeated stop_points + * [Jormun]: Adding max_nb_crowfly_by_mode in status + * [Eitri] Fix cities file type + * [Jormungandr] Update comfort criteria + * [Jormungandr] use best PT journey for too_many_connections_filter + * Artemis and Artemis_idfm as requirements + * [Jormun] Adding max_mode_direct_path_duration in /status and /instances + * Minor edit - .gitignore update + * [Tyr] New endpoints in API v1 + * utils: replace in() function by contains() to standardize + * jormun: add direction_type parameter for departures/arrivals/stop_schedules/route_schedules Api + + -- krishna Fri, 11 Oct 2019 11:10:25 +0100 + navitia2 (2.86.0) unstable; urgency=low * Osm2ed: do not put transport object from OSM in autocompletion diff --git a/documentation/rfc/ptref_grammar.md b/documentation/rfc/ptref_grammar.md index 4aaab9504c..481316196e 100644 --- a/documentation/rfc/ptref_grammar.md +++ b/documentation/rfc/ptref_grammar.md @@ -82,7 +82,7 @@ In the following table, if the invocation starts with `collection`, any collecti |`poi.within(distance, coord)`|all the POIs within `distance` meters from `coord`|`distance` in a positive integer, `coord` is a navitia coord (`lon;lat`)| |`stop_area.within(distance, coord)`|as above for the stop areas|as above| |`stop_point.within(distance, coord)`|as above for the stop points|as above| -|`route.has_direction_type(type1, type2, ...)`|all the `route` containing a given `direction_type` into list|at least one direction type must be given| +|`route.has_direction_type(type1, type2, ...)`|all the routes whose `direction_type` is any of those provided|at least one direction type must be given| #### Interpretation diff --git a/documentation/slate/source/includes/apis.md b/documentation/slate/source/includes/apis.md index 4b47131ff3..0289c37ccb 100644 --- a/documentation/slate/source/includes/apis.md +++ b/documentation/slate/source/includes/apis.md @@ -1438,15 +1438,16 @@ access it via that kind of url:
  • realtime
  • base_schedule
| base_schedule -nop | disable_geojson | boolean | remove geojson fields from the response | False +Required | Name | Type | Description | Default Value +---------|--------------------|-----------|----------------------------------------------------------------------------------------------------------------------------|-------------- +nop | from_datetime | [iso-date-time](#iso-date-time) | The date_time from which you want the schedules | the current datetime +nop | duration | int | Maximum duration in seconds between from_datetime and the retrieved datetimes. | 86400 +nop | depth | int | Json response [depth](#depth) | 1 +nop | items_per_schedule | int | Maximum number of columns per schedule. | +nop | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. | +nop | data_freshness | enum | Define the freshness of data to use
  • realtime
  • base_schedule
| base_schedule +nop | disable_geojson | boolean | remove geojson fields from the response | False +nop | direction_type | enum | Allow to filter the response with the route direction type property
  • all
  • forward
  • backward
Note: forward is equivalent to clockwise and inbound. When you select forward, you filter with: [forward, clockwise, inbound].
backward is equivalent to anticlockwise and outbound. when you select backward, you filter with: [backward, anticlockwise, outbound] | all ### Objects @@ -1571,15 +1572,16 @@ See how disruptions affect stop schedules in the [real time](#realtime) section. ### Parameters -Required | Name | Type | Description | Default Value ----------|--------------------|---------------------------------|--------------------|-------------- -nop | from_datetime | [iso-date-time](#iso-date-time) | The date_time from which you want the schedules | the current datetime -nop | duration | int | Maximum duration in seconds between from_datetime and the retrieved datetimes. | 86400 -nop | depth | int | Json response [depth](#depth) | 1 -nop | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. | -nop | items_per_schedule | int | Maximum number of datetimes per schedule. | -nop | data_freshness | enum | Define the freshness of data to use to compute journeys
  • realtime
  • base_schedule
| realtime -nop | disable_geojson | boolean | remove geojson fields from the response | False +Required | Name | Type | Description | Default Value +---------|--------------------|---------------------------------|----------------------------------------------------------------------------------------------------------------------------|-------------- +nop | from_datetime | [iso-date-time](#iso-date-time) | The date_time from which you want the schedules | the current datetime +nop | duration | int | Maximum duration in seconds between from_datetime and the retrieved datetimes. | 86400 +nop | depth | int | Json response [depth](#depth) | 1 +nop | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. | +nop | items_per_schedule | int | Maximum number of datetimes per schedule. | +nop | data_freshness | enum | Define the freshness of data to use to compute journeys
  • realtime
  • base_schedule
| realtime +nop | disable_geojson | boolean | remove geojson fields from the response | False +nop | direction_type | enum | Allow to filter the response with the route direction type property
  • all
  • forward
  • backward
Note: forward is equivalent to clockwise and inbound. When you select forward, you filter with: [forward, clockwise, inbound].
backward is equivalent to anticlockwise and outbound. When you select backward, you filter with: [backward, anticlockwise, outbound] | all ### Stop_schedule object @@ -1672,15 +1674,16 @@ See how disruptions affect the next departures in the [real time](#realtime) sec ### Parameters -Required | Name | Type | Description | Default Value ----------|------------------|---------------------------------|----------------------------------------------------------------------------------------------------------|-------------- -nop | from_datetime | [iso-date-time](#iso-date-time) | The date_time from which you want the schedules | the current datetime -nop | duration | int | Maximum duration in seconds between from_datetime and the retrieved datetimes. | 86400 -nop | count | int | Maximum number of results. | 10 -nop | depth | int | Json response [depth](#depth) | 1 -nop | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. | -nop | data_freshness | enum | Define the freshness of data to use to compute journeys
  • realtime
  • base_schedule
| realtime -nop | disable_geojson | boolean | remove geojson fields from the response | false +Required | Name | Type | Description | Default Value +---------|------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|-------------- +nop | from_datetime | [iso-date-time](#iso-date-time) | The date_time from which you want the schedules | the current datetime +nop | duration | int | Maximum duration in seconds between from_datetime and the retrieved datetimes. | 86400 +nop | count | int | Maximum number of results. | 10 +nop | depth | int | Json response [depth](#depth) | 1 +nop | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. | +nop | data_freshness | enum | Define the freshness of data to use to compute journeys
  • realtime
  • base_schedule
| realtime +nop | disable_geojson | boolean | remove geojson fields from the response | false +nop | direction_type | enum | Allow to filter the response with the route direction type property
  • all
  • forward
  • backward
Note: forward is equivalent to clockwise and inbound. When you select forward, you filter with: [forward, clockwise, inbound].
backward is equivalent to anticlockwise and outbound. When you select backward, you filter with: [backward, anticlockwise, outbound] | all ### Departure objects @@ -1808,7 +1811,6 @@ no | count | int | Maximum number o no | depth | int | Json response [depth](#depth) | 1 no | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. | no | disable_geojson | boolean | remove geojson fields from the response | false -no | tags[] | array of string | Filter disruptions with the given tags | The response is made of an array of [line_reports](#line-reports), and another one of [disruptions](#disruption). @@ -1964,12 +1966,8 @@ For example: - overall public transport traffic report on Ile de France coverage - -- overall public transport traffic report on Ile de France coverage with disruptions having tags passed in parameter values - - - Is there any perturbations on the RER network ? - -- Is there any perturbations on the RER network with disruptions having tags passed in parameter values ? - - - Is there any perturbations on the "RER A" line ? - @@ -1981,7 +1979,6 @@ no | count | int | Maximum number o no | depth | int | Json response [depth](#depth) | 1 no | forbidden_uris[] | id | If you want to avoid lines, modes, networks, etc. | no | disable_geojson | boolean | remove geojson fields from the response | false -no | tags[] | array of string | Filter disruptions with the given tags | The response is made of an array of [traffic_reports](#traffic-reports), and another one of [disruptions](#disruption). diff --git a/fixtures/ed/ntfs/stops.txt b/fixtures/ed/ntfs/stops.txt index b017962ef2..93ab70f982 100644 --- a/fixtures/ed/ntfs/stops.txt +++ b/fixtures/ed/ntfs/stops.txt @@ -1,4 +1,4 @@ -stop_id,visible,stop_name,stop_lat,stop_lon,zone_id,location_type,parent_station,stop_timezone,property_id,contributor_id,geometry_id +stop_id,visible,stop_name,stop_lat,stop_lon,fare_zone_id,location_type,parent_station,stop_timezone,property_id,contributor_id,geometry_id SA:A,1,"Arrêt A",45.0296,0.5881,,1,,,,, SA:B,1,"Arrêt B",45.0245,0.5725,,1,,,,, SA:C,1,"Arrêt C",45.0211,0.5469,,1,,,,, diff --git a/fixtures/ed/ntfs_v5/stops.txt b/fixtures/ed/ntfs_v5/stops.txt index 40f8598bef..50f46d1703 100644 --- a/fixtures/ed/ntfs_v5/stops.txt +++ b/fixtures/ed/ntfs_v5/stops.txt @@ -3,7 +3,7 @@ SA:A,1,"Arrêt A",45.0296,0.5881,,1,,,,, SA:B,1,"Arrêt B",45.0245,0.5725,,1,,,,, SA:C,1,"Arrêt C",45.0211,0.5469,,1,,,,, SA:D,1,"Arrêt D",44.9518,0.4572,,1,,,,, -SP:A,1,"Arrêt A",45.0296,0.5881,,0,SA:A,,EQ1,, +SP:A,1,"Arrêt A",45.0296,0.5881,4,0,SA:A,,EQ1,, SP:B,1,"Arrêt B",45.0245,0.5725,,0,SA:B,,,, SP:C,1,"Arrêt C",45.0211,0.5469,,0,SA:C,,,, 24034,1,"Beleymas",44.993469,0.504929,,2,,,,,ADMIN:24034 diff --git a/readme.rst b/readme.rst index 8484128e22..45d5d489be 100644 --- a/readme.rst +++ b/readme.rst @@ -70,7 +70,7 @@ More information * technical documentation https://github.com/CanalTP/navitia/tree/dev/documentation/rfc * twitter @navitia https://twitter.com/navitia * google groups navitia https://groups.google.com/d/forum/navitia -* channel `#navitia` on irc.freenode.net +* channel `#navitia` on matrix/riot https://riot.im/app/#/room/%23navitia:matrix.org Getting started diff --git a/release/script_release.py b/release/script_release.py index 1f498f1cc0..8571c74c59 100644 --- a/release/script_release.py +++ b/release/script_release.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division @@ -77,7 +77,7 @@ def __init__(self, release_type, remote_name="canalTP"): print("checking that release was merged into dev...") unmerged = self.git.branch("--no-merged", "dev", '--no-color') - is_release_unmerged = re.search(" release(\n|$)", unmerged) + is_release_unmerged = re.search(" release(\n|$)", unmerged) if is_release_unmerged: print(is_release_unmerged.group(0)) print("ABORTING: {rem}/release branch was not merged in {rem}/dev".format(rem=remote_name)) diff --git a/requirements_pre-commit.txt b/requirements_pre-commit.txt index ead71e36c7..f08048e59d 100644 --- a/requirements_pre-commit.txt +++ b/requirements_pre-commit.txt @@ -2,3 +2,4 @@ black==18.9b0; python_version > '3.6' mypy==0.670; python_version > '3.0' mypy-extensions==0.4.1; python_version > '3.0' flake8==3.5.0 +pre-commit==1.18.3 diff --git a/source/autocomplete/autocomplete.cpp b/source/autocomplete/autocomplete.cpp index be083bfeae..1840c505e3 100644 --- a/source/autocomplete/autocomplete.cpp +++ b/source/autocomplete/autocomplete.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/autocomplete/autocomplete.h b/source/autocomplete/autocomplete.h index 51e597a9ad..84701c9b77 100644 --- a/source/autocomplete/autocomplete.h +++ b/source/autocomplete/autocomplete.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/autocomplete/autocomplete_api.cpp b/source/autocomplete/autocomplete_api.cpp index 66990ebd78..eeee357db9 100644 --- a/source/autocomplete/autocomplete_api.cpp +++ b/source/autocomplete/autocomplete_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/autocomplete/autocomplete_api.h b/source/autocomplete/autocomplete_api.h index 9348ae1a98..2465267b3e 100644 --- a/source/autocomplete/autocomplete_api.h +++ b/source/autocomplete/autocomplete_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/autocomplete/tests/test.cpp b/source/autocomplete/tests/test.cpp index 194eee49e2..a2cf466aa0 100644 --- a/source/autocomplete/tests/test.cpp +++ b/source/autocomplete/tests/test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -392,8 +392,8 @@ BOOST_AUTO_TEST_CASE(Faute_de_frappe_One) { auto res1 = ac.find_partial_with_pattern("gare patea", word_weight, nbmax, [](int) { return true; }, ghostwords); BOOST_REQUIRE_EQUAL(res1.size(), 3); std::initializer_list best_res = {1, 4}; // they are equivalent - BOOST_CHECK(in(res1.at(0).idx, best_res)); - BOOST_CHECK(in(res1.at(1).idx, best_res)); + BOOST_CHECK(navitia::contains(best_res, res1.at(0).idx)); + BOOST_CHECK(navitia::contains(best_res, res1.at(1).idx)); BOOST_CHECK_NE(res1.at(0).idx, res1.at(1).idx); BOOST_CHECK_EQUAL(res1.at(2).idx, 0); BOOST_CHECK_EQUAL(res1.at(0).quality, 94); diff --git a/source/autocomplete/tests/test_utils.cpp b/source/autocomplete/tests/test_utils.cpp index ce5b300fb7..198de41e87 100644 --- a/source/autocomplete/tests/test_utils.cpp +++ b/source/autocomplete/tests/test_utils.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/autocomplete/utils.h b/source/autocomplete/utils.h index 63c8609b1e..082d6b5820 100644 --- a/source/autocomplete/utils.h +++ b/source/autocomplete/utils.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/calendar/calendar.cpp b/source/calendar/calendar.cpp index 9f08a22b17..74497804e3 100644 --- a/source/calendar/calendar.cpp +++ b/source/calendar/calendar.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/calendar/calendar.h b/source/calendar/calendar.h index 8b69817e37..4917dd7120 100644 --- a/source/calendar/calendar.h +++ b/source/calendar/calendar.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/calendar/calendar_api.cpp b/source/calendar/calendar_api.cpp index b72bd5bfb9..6a59c18f2d 100644 --- a/source/calendar/calendar_api.cpp +++ b/source/calendar/calendar_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/calendar/calendar_api.h b/source/calendar/calendar_api.h index 51fc1e4766..177671827b 100644 --- a/source/calendar/calendar_api.h +++ b/source/calendar/calendar_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/calendar/tests/calendar_api_test.cpp b/source/calendar/tests/calendar_api_test.cpp index 24943a5fbd..98d3d678cf 100644 --- a/source/calendar/tests/calendar_api_test.cpp +++ b/source/calendar/tests/calendar_api_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/cities/cities.cpp b/source/cities/cities.cpp index 50bd844d19..378072f4b5 100644 --- a/source/cities/cities.cpp +++ b/source/cities/cities.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -257,7 +257,7 @@ void OSMRelation::build_polygon(OSMCache& cache, OSMId osm_id) { std::set explored_ids; auto is_outer_way = [](const CanalTP::Reference& r) { return r.member_type == OSMPBF::Relation_MemberType::Relation_MemberType_WAY - && in(r.role, {"outer", "enclave", ""}); + && contains({"outer", "enclave", ""}, r.role); }; auto pickable_way = [&](const CanalTP::Reference& r) { return is_outer_way(r) && explored_ids.count(r.member_id) == 0; @@ -381,7 +381,7 @@ void OSMRelation::build_geometry(OSMCache& cache, OSMId osm_id) { if (!node_it->second.is_defined()) { continue; } - if (in(ref.role, {"admin_centre", "admin_center"})) { + if (contains({"admin_centre", "admin_center"}, ref.role)) { set_centre(node_it->second.lon(), node_it->second.lat()); this->add_postal_code(node_it->second.postal_code); break; diff --git a/source/cities/cities.h b/source/cities/cities.h index 4d853df13b..ac5d23baad 100644 --- a/source/cities/cities.h +++ b/source/cities/cities.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/disruption/line_reports_api.cpp b/source/disruption/line_reports_api.cpp index 0c0e223ee9..1e185b7abe 100644 --- a/source/disruption/line_reports_api.cpp +++ b/source/disruption/line_reports_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/disruption/line_reports_api.h b/source/disruption/line_reports_api.h index 5be9a3ae99..dc0616ef9e 100644 --- a/source/disruption/line_reports_api.h +++ b/source/disruption/line_reports_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/disruption/tests/disruption_test.cpp b/source/disruption/tests/disruption_test.cpp index c073a51339..60ec73ccca 100644 --- a/source/disruption/tests/disruption_test.cpp +++ b/source/disruption/tests/disruption_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/disruption/traffic_reports_api.cpp b/source/disruption/traffic_reports_api.cpp index 35b7fc07d1..63e38336fd 100644 --- a/source/disruption/traffic_reports_api.cpp +++ b/source/disruption/traffic_reports_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/disruption/traffic_reports_api.h b/source/disruption/traffic_reports_api.h index 3f458819df..8b6ce495f2 100644 --- a/source/disruption/traffic_reports_api.h +++ b/source/disruption/traffic_reports_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/build_helper.cpp b/source/ed/build_helper.cpp index 23f76e05c4..4e2f14e135 100644 --- a/source/ed/build_helper.cpp +++ b/source/ed/build_helper.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -602,6 +602,27 @@ void builder::connection(const std::string& name1, const std::string& name2, flo connexion->destination->stop_point_connection_list.push_back(connexion); } +void builder::add_ticket(const std::string& ticket_id, + const std::string& line, + const int cost, + const std::string& comment, + const std::string& currency) { + boost::gregorian::date start_date(boost::gregorian::neg_infin); + boost::gregorian::date end_date(boost::gregorian::pos_infin); + + auto ticket = navitia::fare::Ticket(ticket_id, ticket_id + " name", cost, comment); + ticket.currency = currency; + data->fare->fare_map[ticket_id].add(start_date, end_date, ticket); + + navitia::fare::Transition ticket_transition; + navitia::fare::State ticket_state; + ticket_state.line = boost::algorithm::to_lower_copy(line); + ticket_transition.ticket_key = ticket_id; + + auto ticket_state_v = boost::add_vertex(ticket_state, data->fare->g); + boost::add_edge(data->fare->begin_v, ticket_state_v, ticket_transition, data->fare->g); +} + static double get_co2_emission(const std::string& uri) { if (uri == "0x0") { return 4.; diff --git a/source/ed/build_helper.h b/source/ed/build_helper.h index 31d08895c6..5e5ae56fde 100644 --- a/source/ed/build_helper.h +++ b/source/ed/build_helper.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -348,6 +348,12 @@ struct builder { return obj; } + void add_ticket(const std::string& ticket_id, + const std::string& line, + const int cost = 100, + const std::string& comment = "", + const std::string& currency = "euro"); + template T* get(const std::string& uri) const { const auto& collection = data->get_assoc_data(); diff --git a/source/ed/connectors/conv_coord.cpp b/source/ed/connectors/conv_coord.cpp index 6c007c8c9c..aaa0bef3c3 100644 --- a/source/ed/connectors/conv_coord.cpp +++ b/source/ed/connectors/conv_coord.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/conv_coord.h b/source/ed/connectors/conv_coord.h index 8b26528d4b..2aaf171ed8 100644 --- a/source/ed/connectors/conv_coord.h +++ b/source/ed/connectors/conv_coord.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/data_cleaner.cpp b/source/ed/connectors/data_cleaner.cpp index c332953b94..327d742af6 100644 --- a/source/ed/connectors/data_cleaner.cpp +++ b/source/ed/connectors/data_cleaner.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/data_cleaner.h b/source/ed/connectors/data_cleaner.h index 8f693f8119..8625f4d361 100644 --- a/source/ed/connectors/data_cleaner.h +++ b/source/ed/connectors/data_cleaner.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/fare_parser.cpp b/source/ed/connectors/fare_parser.cpp index 707c4f2e78..3ffb4cc8b9 100644 --- a/source/ed/connectors/fare_parser.cpp +++ b/source/ed/connectors/fare_parser.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/fare_parser.h b/source/ed/connectors/fare_parser.h index a902fd8581..8b8ae7303b 100644 --- a/source/ed/connectors/fare_parser.h +++ b/source/ed/connectors/fare_parser.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/fare_utils.cpp b/source/ed/connectors/fare_utils.cpp index 0fc598bcae..409cbd20a9 100644 --- a/source/ed/connectors/fare_utils.cpp +++ b/source/ed/connectors/fare_utils.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/fare_utils.h b/source/ed/connectors/fare_utils.h index ab99ea822f..f27423226e 100644 --- a/source/ed/connectors/fare_utils.h +++ b/source/ed/connectors/fare_utils.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/fusio_parser.cpp b/source/ed/connectors/fusio_parser.cpp index f7768c6ce0..8949eeaaa0 100644 --- a/source/ed/connectors/fusio_parser.cpp +++ b/source/ed/connectors/fusio_parser.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -208,6 +208,11 @@ void StopsFusioHandler::init(Data& data) { comment_id_c = csv.get_pos_col("comment_id"); visible_c = csv.get_pos_col("visible"); geometry_id_c = csv.get_pos_col("geometry_id"); + // Since NTFS v0.9, using fare_zone_id (if absent, fallback to zone_id) + zone_c = csv.get_pos_col("fare_zone_id"); + if (zone_c == UNKNOWN_COLUMN) { + zone_c = csv.get_pos_col("zone_id"); + } } // in fusio we want to delete all stop points without stop area diff --git a/source/ed/connectors/fusio_parser.h b/source/ed/connectors/fusio_parser.h index 0476dff7f9..ae5ab59ad0 100644 --- a/source/ed/connectors/fusio_parser.h +++ b/source/ed/connectors/fusio_parser.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/geopal_parser.cpp b/source/ed/connectors/geopal_parser.cpp index 5ca2a7e1cc..aefcad11f3 100644 --- a/source/ed/connectors/geopal_parser.cpp +++ b/source/ed/connectors/geopal_parser.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/geopal_parser.h b/source/ed/connectors/geopal_parser.h index 5864a91f49..4ef36f82a8 100644 --- a/source/ed/connectors/geopal_parser.h +++ b/source/ed/connectors/geopal_parser.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/gtfs_parser.cpp b/source/ed/connectors/gtfs_parser.cpp index c25a52ae2b..f1ba4a0bad 100644 --- a/source/ed/connectors/gtfs_parser.cpp +++ b/source/ed/connectors/gtfs_parser.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/gtfs_parser.h b/source/ed/connectors/gtfs_parser.h index 4783d229d0..ef87eff59b 100644 --- a/source/ed/connectors/gtfs_parser.h +++ b/source/ed/connectors/gtfs_parser.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/osm_tags_reader.cpp b/source/ed/connectors/osm_tags_reader.cpp index 427df9400d..e5c79996dc 100644 --- a/source/ed/connectors/osm_tags_reader.cpp +++ b/source/ed/connectors/osm_tags_reader.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -81,7 +81,7 @@ std::bitset<8> parse_way_tags(const std::map& tags) { std::transform(val.begin(), val.end(), val.begin(), ::tolower); if (key == "highway") { - if (in(val, {"footway", "pedestrian"})) { + if (navitia::contains({"footway", "pedestrian"}, val)) { update_if_unknown(foot, foot_allowed); } else if (val == "cycleway") { update_if_unknown(bike_direct, bike_track); @@ -93,37 +93,39 @@ std::bitset<8> parse_way_tags(const std::map& tags) { update_if_unknown(foot, foot_allowed); } else if (val == "steps") { update_if_unknown(foot, foot_allowed); - } else if (in(val, {"primary", "primary_link"})) { + } else if (navitia::contains({"primary", "primary_link"}, val)) { update_if_unknown(car_direct, car_primary); update_if_unknown(foot, foot_allowed); update_if_unknown(bike_direct, bike_allowed); - } else if (in(val, {"secondary", "secondary_link"})) { + } else if (navitia::contains({"secondary", "secondary_link"}, val)) { update_if_unknown(car_direct, car_secondary); update_if_unknown(foot, foot_allowed); update_if_unknown(bike_direct, bike_allowed); - } else if (in(val, {"tertiary", "tertiary_link"})) { + } else if (navitia::contains({"tertiary", "tertiary_link"}, val)) { update_if_unknown(car_direct, car_tertiary); update_if_unknown(foot, foot_allowed); update_if_unknown(bike_direct, bike_allowed); - } else if (in(val, {"unclassified", "residential", "living_street", "road", "service", "track"})) { + } else if (navitia::contains({"unclassified", "residential", "living_street", "road", "service", "track"}, + val)) { update_if_unknown(car_direct, car_residential); update_if_unknown(foot, foot_allowed); update_if_unknown(bike_direct, bike_allowed); - } else if (in(val, {"motorway", "motorway_link"})) { + } else if (navitia::contains({"motorway", "motorway_link"}, val)) { update_if_unknown(car_direct, car_motorway); update_if_unknown(foot, foot_forbiden); update_if_unknown(bike_direct, bike_forbiden); - } else if (in(val, {"trunk", "trunk_link"})) { + } else if (navitia::contains({"trunk", "trunk_link"}, val)) { update_if_unknown(car_direct, car_trunk); update_if_unknown(foot, foot_forbiden); update_if_unknown(bike_direct, bike_forbiden); } } - else if (in(key, {"pedestrian", "foot"})) { - if (in(val, {"yes", "designated", "permissive", "lane", "official", "allowed", "destination"})) { + else if (navitia::contains({"pedestrian", "foot"}, key)) { + if (navitia::contains({"yes", "designated", "permissive", "lane", "official", "allowed", "destination"}, + val)) { foot = foot_allowed; - } else if (in(val, {"no", "private"})) { + } else if (navitia::contains({"no", "private"}, val)) { foot = foot_forbiden; } else { std::cerr << "I don't know what to do with: " << key << "=" << val << std::endl; @@ -164,9 +166,9 @@ std::bitset<8> parse_way_tags(const std::map& tags) { } else if (key == "busway") { - if (in(val, {"yes", "track", "lane"})) { + if (navitia::contains({"yes", "track", "lane"}, val)) { update_if_unknown(bike_direct, bike_busway); - } else if (in(val, {"opposite_lane", "opposite_track"})) { + } else if (navitia::contains({"opposite_lane", "opposite_track"}, val)) { update_if_unknown(bike_reverse, bike_busway); } else { update_if_unknown(bike_direct, bike_busway); diff --git a/source/ed/connectors/osm_tags_reader.h b/source/ed/connectors/osm_tags_reader.h index f29a0de542..780ec127a1 100644 --- a/source/ed/connectors/osm_tags_reader.h +++ b/source/ed/connectors/osm_tags_reader.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/poi_parser.cpp b/source/ed/connectors/poi_parser.cpp index 76d114d0b0..f91abc3f6f 100644 --- a/source/ed/connectors/poi_parser.cpp +++ b/source/ed/connectors/poi_parser.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/poi_parser.h b/source/ed/connectors/poi_parser.h index 312bc74905..dfd1b4ff2f 100644 --- a/source/ed/connectors/poi_parser.h +++ b/source/ed/connectors/poi_parser.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/projection_system_reader.cpp b/source/ed/connectors/projection_system_reader.cpp index 607f747de8..b5f0f927f4 100644 --- a/source/ed/connectors/projection_system_reader.cpp +++ b/source/ed/connectors/projection_system_reader.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/projection_system_reader.h b/source/ed/connectors/projection_system_reader.h index b75e082b08..8e839adf62 100644 --- a/source/ed/connectors/projection_system_reader.h +++ b/source/ed/connectors/projection_system_reader.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/synonym_parser.cpp b/source/ed/connectors/synonym_parser.cpp index 52ae52fc6e..7e0fc67b40 100644 --- a/source/ed/connectors/synonym_parser.cpp +++ b/source/ed/connectors/synonym_parser.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/connectors/synonym_parser.h b/source/ed/connectors/synonym_parser.h index 58f1e522ed..80e7087e95 100644 --- a/source/ed/connectors/synonym_parser.h +++ b/source/ed/connectors/synonym_parser.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/data.cpp b/source/ed/data.cpp index 740d327692..783d30e69b 100644 --- a/source/ed/data.cpp +++ b/source/ed/data.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -282,8 +282,8 @@ void Data::complete() { // set StopPoint from old zonal ODT to is_zonal for (const auto* vj : vehicle_journeys) { using nt::VehicleJourneyType; - if (in(vj->vehicle_journey_type, - {VehicleJourneyType::adress_to_stop_point, VehicleJourneyType::odt_point_to_point})) { + if (navitia::contains({VehicleJourneyType::adress_to_stop_point, VehicleJourneyType::odt_point_to_point}, + vj->vehicle_journey_type)) { for (const auto* st : vj->stop_time_list) { st->stop_point->is_zonal = true; } diff --git a/source/ed/data.h b/source/ed/data.h index d300c71621..016aee61da 100644 --- a/source/ed/data.h +++ b/source/ed/data.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/default_poi_types.h b/source/ed/default_poi_types.h index 586d46b38b..e84d9da5ec 100644 --- a/source/ed/default_poi_types.h +++ b/source/ed/default_poi_types.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/docker_tests/ed_integration_tests.cpp b/source/ed/docker_tests/ed_integration_tests.cpp index da041047de..58ae079882 100644 --- a/source/ed/docker_tests/ed_integration_tests.cpp +++ b/source/ed/docker_tests/ed_integration_tests.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/ed2nav.cpp b/source/ed/ed2nav.cpp index a2f6d38665..e6eb717407 100644 --- a/source/ed/ed2nav.cpp +++ b/source/ed/ed2nav.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/ed2nav.h b/source/ed/ed2nav.h index dd19ccac20..3f08668c9f 100644 --- a/source/ed/ed2nav.h +++ b/source/ed/ed2nav.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/ed2nav_main.cpp b/source/ed/ed2nav_main.cpp index bb08578293..aa01c4035e 100644 --- a/source/ed/ed2nav_main.cpp +++ b/source/ed/ed2nav_main.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/ed_persistor.cpp b/source/ed/ed_persistor.cpp index 01358b7784..734571fa5f 100644 --- a/source/ed/ed_persistor.cpp +++ b/source/ed/ed_persistor.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/ed_persistor.h b/source/ed/ed_persistor.h index f46f6d1d00..9eb3366404 100644 --- a/source/ed/ed_persistor.h +++ b/source/ed/ed_persistor.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/ed_reader.cpp b/source/ed/ed_reader.cpp index 96f86b7cb9..58cb9dd581 100644 --- a/source/ed/ed_reader.cpp +++ b/source/ed/ed_reader.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/ed_reader.h b/source/ed/ed_reader.h index 2373975bef..2c93230e44 100644 --- a/source/ed/ed_reader.h +++ b/source/ed/ed_reader.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/fare2ed.cpp b/source/ed/fare2ed.cpp index 73a74c00d4..9c62785ae0 100644 --- a/source/ed/fare2ed.cpp +++ b/source/ed/fare2ed.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/fare2ed.h b/source/ed/fare2ed.h index e89130e430..60cdb500b5 100644 --- a/source/ed/fare2ed.h +++ b/source/ed/fare2ed.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/fusio2ed.cpp b/source/ed/fusio2ed.cpp index 3524a3bf4f..0e5a6f1204 100644 --- a/source/ed/fusio2ed.cpp +++ b/source/ed/fusio2ed.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/geopal2ed.cpp b/source/ed/geopal2ed.cpp index 4a7846124c..33c2abccaa 100644 --- a/source/ed/geopal2ed.cpp +++ b/source/ed/geopal2ed.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/gtfs2ed.cpp b/source/ed/gtfs2ed.cpp index c24160ce9f..25eeec1a4e 100644 --- a/source/ed/gtfs2ed.cpp +++ b/source/ed/gtfs2ed.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/osm2ed.cpp b/source/ed/osm2ed.cpp index c83c87dbe2..da204674ef 100644 --- a/source/ed/osm2ed.cpp +++ b/source/ed/osm2ed.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -670,7 +670,7 @@ void OSMAdminRelation::build_polygon(OSMCache& cache) { std::set explored_ids; auto is_outer_way = [](const CanalTP::Reference& r) { return r.member_type == OSMPBF::Relation_MemberType::Relation_MemberType_WAY - && in(r.role, {"outer", "enclave", ""}); + && navitia::contains({"outer", "enclave", ""}, r.role); }; auto pickable_way = [&](const CanalTP::Reference& r) { return is_outer_way(r) && explored_ids.count(r.member_id) == 0; diff --git a/source/ed/osm2ed.h b/source/ed/osm2ed.h index 664793d27e..536df6a710 100644 --- a/source/ed/osm2ed.h +++ b/source/ed/osm2ed.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/osm2ed_main.cpp b/source/ed/osm2ed_main.cpp index 7c24d0e08e..993b9cc72f 100644 --- a/source/ed/osm2ed_main.cpp +++ b/source/ed/osm2ed_main.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/poi2ed.cpp b/source/ed/poi2ed.cpp index b752ee8a5b..05c60e8e27 100644 --- a/source/ed/poi2ed.cpp +++ b/source/ed/poi2ed.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/synonym2ed.cpp b/source/ed/synonym2ed.cpp index 6063943f73..00bd5366c9 100644 --- a/source/ed/synonym2ed.cpp +++ b/source/ed/synonym2ed.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/associated_calendar_test.cpp b/source/ed/tests/associated_calendar_test.cpp index d6719ca24f..9c9f6995ba 100644 --- a/source/ed/tests/associated_calendar_test.cpp +++ b/source/ed/tests/associated_calendar_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/conv_coord_test.cpp b/source/ed/tests/conv_coord_test.cpp index 168df7b0be..04eda5ad99 100644 --- a/source/ed/tests/conv_coord_test.cpp +++ b/source/ed/tests/conv_coord_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/ed2nav_test.cpp b/source/ed/tests/ed2nav_test.cpp index d29240b264..0c55ea3404 100644 --- a/source/ed/tests/ed2nav_test.cpp +++ b/source/ed/tests/ed2nav_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/fare2ed_test.cpp b/source/ed/tests/fare2ed_test.cpp index f8616785c5..421680dd82 100644 --- a/source/ed/tests/fare2ed_test.cpp +++ b/source/ed/tests/fare2ed_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/fare_parser_test.cpp b/source/ed/tests/fare_parser_test.cpp index 371b101808..688a69e579 100644 --- a/source/ed/tests/fare_parser_test.cpp +++ b/source/ed/tests/fare_parser_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/fusioparser_test.cpp b/source/ed/tests/fusioparser_test.cpp index 1f7e029b53..0d6df8eb6b 100644 --- a/source/ed/tests/fusioparser_test.cpp +++ b/source/ed/tests/fusioparser_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -420,6 +420,8 @@ BOOST_AUTO_TEST_CASE(sync_ntfs) { has_properties.set_property(navitia::type::hasProperties::BIKE_ACCEPTED); BOOST_CHECK_EQUAL(data.stop_point_connections[0]->accessible(has_properties.properties()), true); BOOST_CHECK_EQUAL(data.stop_points[0]->accessible(has_properties.properties()), true); + // ntfs_v5 retrocompatibility test on zone_id as fare_zone_id is absent in stops.txt + BOOST_CHECK_EQUAL(data.stop_points[0]->fare_zone, "4"); for (int i = 1; i < 8; i++) { BOOST_CHECK_EQUAL(data.stop_points[i]->accessible(has_properties.properties()), false); diff --git a/source/ed/tests/gtfsparser_test.cpp b/source/ed/tests/gtfsparser_test.cpp index c6550dd299..f36c581451 100644 --- a/source/ed/tests/gtfsparser_test.cpp +++ b/source/ed/tests/gtfsparser_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/jpp_shape_test.cpp b/source/ed/tests/jpp_shape_test.cpp index dfc39e53cc..d69ad06db9 100644 --- a/source/ed/tests/jpp_shape_test.cpp +++ b/source/ed/tests/jpp_shape_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/osm2ed_test.cpp b/source/ed/tests/osm2ed_test.cpp index 003b427528..ea37f0b38e 100644 --- a/source/ed/tests/osm2ed_test.cpp +++ b/source/ed/tests/osm2ed_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/osm_tags_reader_test.cpp b/source/ed/tests/osm_tags_reader_test.cpp index 2396b2fe9d..bd076a1084 100644 --- a/source/ed/tests/osm_tags_reader_test.cpp +++ b/source/ed/tests/osm_tags_reader_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/poi2ed_test.cpp b/source/ed/tests/poi2ed_test.cpp index 0df31fe429..0d1c19a7ff 100644 --- a/source/ed/tests/poi2ed_test.cpp +++ b/source/ed/tests/poi2ed_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/route_main_destination_test.cpp b/source/ed/tests/route_main_destination_test.cpp index 8037d0eb9f..0b0f07fcc0 100644 --- a/source/ed/tests/route_main_destination_test.cpp +++ b/source/ed/tests/route_main_destination_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/tests/shift_stop_times.cpp b/source/ed/tests/shift_stop_times.cpp index 1c8447b872..ac6028bd06 100644 --- a/source/ed/tests/shift_stop_times.cpp +++ b/source/ed/tests/shift_stop_times.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/types.cpp b/source/ed/types.cpp index 456bb199f3..2c60d0ee70 100644 --- a/source/ed/types.cpp +++ b/source/ed/types.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ed/types.h b/source/ed/types.h index c4967726fc..fb57c6223c 100644 --- a/source/ed/types.h +++ b/source/ed/types.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/eitri/ed_handler.py b/source/eitri/ed_handler.py index 4a13bc1361..46c09325bc 100644 --- a/source/eitri/ed_handler.py +++ b/source/eitri/ed_handler.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/eitri/eitri.py b/source/eitri/eitri.py index c7c1463da4..5c636afaf1 100755 --- a/source/eitri/eitri.py +++ b/source/eitri/eitri.py @@ -26,7 +26,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -124,10 +124,7 @@ def get_params(): help="the output file path (default: './data.nav.lz4')", ) parser.add_argument( - '-i', - '--cities-file', - type=argparse.FileType, - help='the path to the "cities" file to load (usually a *.osm.pbf)', + '-i', '--cities-file', type=str, help='the path to the "cities" file to load (usually a *.osm.pbf)' ) parser.add_argument( '-f', '--cities-dir', type=is_directory, help='the path to the directory containing the "cities" binary' diff --git a/source/equipment/equipment_api.cpp b/source/equipment/equipment_api.cpp index f09c7fd513..3717a8a7c9 100644 --- a/source/equipment/equipment_api.cpp +++ b/source/equipment/equipment_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/equipment/equipment_api.h b/source/equipment/equipment_api.h index 3dd0b2ac11..3639a32edb 100644 --- a/source/equipment/equipment_api.h +++ b/source/equipment/equipment_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/equipment/tests/equipment_api_tests.cpp b/source/equipment/tests/equipment_api_tests.cpp index 68982fd06c..0209b9522d 100644 --- a/source/equipment/tests/equipment_api_tests.cpp +++ b/source/equipment/tests/equipment_api_tests.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/fare/fare.cpp b/source/fare/fare.cpp index 2bf1d156f7..3bda06e55d 100644 --- a/source/fare/fare.cpp +++ b/source/fare/fare.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/fare/fare.h b/source/fare/fare.h index 1ceb9dde55..baad23c597 100644 --- a/source/fare/fare.h +++ b/source/fare/fare.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/fare/tests/fare_integration_test.cpp b/source/fare/tests/fare_integration_test.cpp index 1bfc5a3af3..4b5aa79be2 100644 --- a/source/fare/tests/fare_integration_test.cpp +++ b/source/fare/tests/fare_integration_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/fare/tests/fare_test.cpp b/source/fare/tests/fare_test.cpp index 5ea1552756..185e5de354 100644 --- a/source/fare/tests/fare_test.cpp +++ b/source/fare/tests/fare_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/adminref.cpp b/source/georef/adminref.cpp index 057ed1971b..03357aaeec 100644 --- a/source/georef/adminref.cpp +++ b/source/georef/adminref.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/adminref.h b/source/georef/adminref.h index ff5955e6ee..95b25ed4c9 100644 --- a/source/georef/adminref.h +++ b/source/georef/adminref.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/astar_path_finder.cpp b/source/georef/astar_path_finder.cpp index d6616c68c0..10e9275a56 100644 --- a/source/georef/astar_path_finder.cpp +++ b/source/georef/astar_path_finder.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/astar_path_finder.h b/source/georef/astar_path_finder.h index 26384eeb92..696c983e58 100644 --- a/source/georef/astar_path_finder.h +++ b/source/georef/astar_path_finder.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/dijkstra_path_finder.cpp b/source/georef/dijkstra_path_finder.cpp index 6b74523da3..879959734e 100644 --- a/source/georef/dijkstra_path_finder.cpp +++ b/source/georef/dijkstra_path_finder.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/dijkstra_path_finder.h b/source/georef/dijkstra_path_finder.h index ac1750cfeb..6baeb8d763 100644 --- a/source/georef/dijkstra_path_finder.h +++ b/source/georef/dijkstra_path_finder.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/georef.cpp b/source/georef/georef.cpp index 7d03c2845c..64f672eb8d 100644 --- a/source/georef/georef.cpp +++ b/source/georef/georef.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/georef.h b/source/georef/georef.h index da568b3714..5c9b22d955 100644 --- a/source/georef/georef.h +++ b/source/georef/georef.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/path_finder.cpp b/source/georef/path_finder.cpp index 264d134f13..1a19b598e0 100644 --- a/source/georef/path_finder.cpp +++ b/source/georef/path_finder.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/path_finder.h b/source/georef/path_finder.h index b34df2668b..7db7886e7c 100644 --- a/source/georef/path_finder.h +++ b/source/georef/path_finder.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/street_network.cpp b/source/georef/street_network.cpp index 4b4e140580..75ac925731 100644 --- a/source/georef/street_network.cpp +++ b/source/georef/street_network.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/street_network.h b/source/georef/street_network.h index 35b1c121a2..ead25bb09a 100644 --- a/source/georef/street_network.h +++ b/source/georef/street_network.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/tests/builder.cpp b/source/georef/tests/builder.cpp index 0697c6e667..3bc5a9a1b8 100644 --- a/source/georef/tests/builder.cpp +++ b/source/georef/tests/builder.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/tests/builder.h b/source/georef/tests/builder.h index e52a87ef4a..74a9c2ad86 100644 --- a/source/georef/tests/builder.h +++ b/source/georef/tests/builder.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/tests/georef_test.cpp b/source/georef/tests/georef_test.cpp index d448d7e1ae..55a3a68cb1 100644 --- a/source/georef/tests/georef_test.cpp +++ b/source/georef/tests/georef_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/tests/path_finder_test.cpp b/source/georef/tests/path_finder_test.cpp index 258ece32f2..7f37373c7f 100644 --- a/source/georef/tests/path_finder_test.cpp +++ b/source/georef/tests/path_finder_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/tests/street_network_test.cpp b/source/georef/tests/street_network_test.cpp index 7cf7690378..82c31ff20e 100644 --- a/source/georef/tests/street_network_test.cpp +++ b/source/georef/tests/street_network_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/georef/visitor.h b/source/georef/visitor.h index fdb4baebdd..9557c7a066 100644 --- a/source/georef/visitor.h +++ b/source/georef/visitor.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/jormungandr/jormungandr/__init__.py b/source/jormungandr/jormungandr/__init__.py index ecd0f9550a..2669192b4a 100644 --- a/source/jormungandr/jormungandr/__init__.py +++ b/source/jormungandr/jormungandr/__init__.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/api.py b/source/jormungandr/jormungandr/api.py index 28713c5af1..3554a3a5a6 100644 --- a/source/jormungandr/jormungandr/api.py +++ b/source/jormungandr/jormungandr/api.py @@ -26,7 +26,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/authentication.py b/source/jormungandr/jormungandr/authentication.py index dd0ddcf988..fa66812e89 100644 --- a/source/jormungandr/jormungandr/authentication.py +++ b/source/jormungandr/jormungandr/authentication.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/autocomplete/__init__.py b/source/jormungandr/jormungandr/autocomplete/__init__.py index 04cbd6545d..d1fc48534e 100644 --- a/source/jormungandr/jormungandr/autocomplete/__init__.py +++ b/source/jormungandr/jormungandr/autocomplete/__init__.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/autocomplete/abstract_autocomplete.py b/source/jormungandr/jormungandr/autocomplete/abstract_autocomplete.py index ce7dc2015b..f1e4399ce0 100644 --- a/source/jormungandr/jormungandr/autocomplete/abstract_autocomplete.py +++ b/source/jormungandr/jormungandr/autocomplete/abstract_autocomplete.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/autocomplete/geocodejson.py b/source/jormungandr/jormungandr/autocomplete/geocodejson.py index 27f9dba385..acb7cc951b 100644 --- a/source/jormungandr/jormungandr/autocomplete/geocodejson.py +++ b/source/jormungandr/jormungandr/autocomplete/geocodejson.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -256,7 +256,15 @@ def _manage_depth(_key, _value, _depth): @classmethod def response_marshaler(cls, response_bragi, uri=None, depth=1): cls._check_response(response_bragi, uri) - json_response = response_bragi.json() + try: + json_response = response_bragi.json() + except ValueError: + logging.getLogger(__name__).error( + "impossible to get json for response %s with body: %s", + response_bragi.status_code, + response_bragi.text, + ) + raise # Clean dict objects depending on depth passed in request parameter. json_response = cls._clean_response(json_response, depth) from jormungandr.interfaces.v1.serializer.geocode_json import GeocodePlacesSerializer diff --git a/source/jormungandr/jormungandr/autocomplete/kraken.py b/source/jormungandr/jormungandr/autocomplete/kraken.py index 671662b2b8..7dc6b9a1ad 100644 --- a/source/jormungandr/jormungandr/autocomplete/kraken.py +++ b/source/jormungandr/jormungandr/autocomplete/kraken.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/compat.py b/source/jormungandr/jormungandr/compat.py index 2d6d9428b1..30f31266be 100644 --- a/source/jormungandr/jormungandr/compat.py +++ b/source/jormungandr/jormungandr/compat.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/equipments/__init__.py b/source/jormungandr/jormungandr/equipments/__init__.py index 8bfa55ec93..98a6aa8fdb 100644 --- a/source/jormungandr/jormungandr/equipments/__init__.py +++ b/source/jormungandr/jormungandr/equipments/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/equipments/equipment_provider_manager.py b/source/jormungandr/jormungandr/equipments/equipment_provider_manager.py index 083c4e83d5..156bccf8f4 100644 --- a/source/jormungandr/jormungandr/equipments/equipment_provider_manager.py +++ b/source/jormungandr/jormungandr/equipments/equipment_provider_manager.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/equipments/sytral.py b/source/jormungandr/jormungandr/equipments/sytral.py index 4a2dbf5eaa..3d9a4bbb88 100644 --- a/source/jormungandr/jormungandr/equipments/sytral.py +++ b/source/jormungandr/jormungandr/equipments/sytral.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/equipments/tests/__init__.py b/source/jormungandr/jormungandr/equipments/tests/__init__.py index f18752c6bf..e73db9e04e 100644 --- a/source/jormungandr/jormungandr/equipments/tests/__init__.py +++ b/source/jormungandr/jormungandr/equipments/tests/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/equipments/tests/equipment_provider_manager_test.py b/source/jormungandr/jormungandr/equipments/tests/equipment_provider_manager_test.py index 15c22cc73f..231dba9e64 100644 --- a/source/jormungandr/jormungandr/equipments/tests/equipment_provider_manager_test.py +++ b/source/jormungandr/jormungandr/equipments/tests/equipment_provider_manager_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/equipments/tests/equipment_provider_mock.py b/source/jormungandr/jormungandr/equipments/tests/equipment_provider_mock.py index 34e7d54be4..bc8ee0eeb6 100644 --- a/source/jormungandr/jormungandr/equipments/tests/equipment_provider_mock.py +++ b/source/jormungandr/jormungandr/equipments/tests/equipment_provider_mock.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/equipments/tests/sytral_equipment_test.py b/source/jormungandr/jormungandr/equipments/tests/sytral_equipment_test.py index e70f611ed8..2559cc9063 100644 --- a/source/jormungandr/jormungandr/equipments/tests/sytral_equipment_test.py +++ b/source/jormungandr/jormungandr/equipments/tests/sytral_equipment_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/error.py b/source/jormungandr/jormungandr/error.py index 45deae3d15..1848b89657 100644 --- a/source/jormungandr/jormungandr/error.py +++ b/source/jormungandr/jormungandr/error.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/exceptions.py b/source/jormungandr/jormungandr/exceptions.py index 00c2dd576d..5a6e8a1fe3 100644 --- a/source/jormungandr/jormungandr/exceptions.py +++ b/source/jormungandr/jormungandr/exceptions.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/fallback_modes.py b/source/jormungandr/jormungandr/fallback_modes.py index 6d06bcf4c3..0dea94ce72 100644 --- a/source/jormungandr/jormungandr/fallback_modes.py +++ b/source/jormungandr/jormungandr/fallback_modes.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/georef.py b/source/jormungandr/jormungandr/georef.py index 6e2153be0e..cc3edf04f9 100644 --- a/source/jormungandr/jormungandr/georef.py +++ b/source/jormungandr/jormungandr/georef.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/helper.py b/source/jormungandr/jormungandr/helper.py index c7c841898b..ae768a0d4e 100644 --- a/source/jormungandr/jormungandr/helper.py +++ b/source/jormungandr/jormungandr/helper.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/index.py b/source/jormungandr/jormungandr/index.py index 55cb501a5d..57d4c7946b 100644 --- a/source/jormungandr/jormungandr/index.py +++ b/source/jormungandr/jormungandr/index.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/init.py b/source/jormungandr/jormungandr/init.py index aa47908161..42cb53fd18 100644 --- a/source/jormungandr/jormungandr/init.py +++ b/source/jormungandr/jormungandr/init.py @@ -26,7 +26,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/instance.py b/source/jormungandr/jormungandr/instance.py index 75bf681f0b..8d05eaf723 100644 --- a/source/jormungandr/jormungandr/instance.py +++ b/source/jormungandr/jormungandr/instance.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/instance_manager.py b/source/jormungandr/jormungandr/instance_manager.py index 0099796014..7cbb46245a 100644 --- a/source/jormungandr/jormungandr/instance_manager.py +++ b/source/jormungandr/jormungandr/instance_manager.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/__init__.py b/source/jormungandr/jormungandr/interfaces/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/jormungandr/jormungandr/interfaces/__init__.py +++ b/source/jormungandr/jormungandr/interfaces/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/argument.py b/source/jormungandr/jormungandr/interfaces/argument.py index 56729b2fd8..928d2435ef 100644 --- a/source/jormungandr/jormungandr/interfaces/argument.py +++ b/source/jormungandr/jormungandr/interfaces/argument.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/common.py b/source/jormungandr/jormungandr/interfaces/common.py index c31aa73385..f97939eae6 100644 --- a/source/jormungandr/jormungandr/interfaces/common.py +++ b/source/jormungandr/jormungandr/interfaces/common.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/parsers.py b/source/jormungandr/jormungandr/interfaces/parsers.py index 01f782d466..5cdc4318d7 100644 --- a/source/jormungandr/jormungandr/interfaces/parsers.py +++ b/source/jormungandr/jormungandr/interfaces/parsers.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/interfaces/uri.py b/source/jormungandr/jormungandr/interfaces/uri.py index adae212775..8808f7b64a 100644 --- a/source/jormungandr/jormungandr/interfaces/uri.py +++ b/source/jormungandr/jormungandr/interfaces/uri.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/Calendars.py b/source/jormungandr/jormungandr/interfaces/v1/Calendars.py index 11ceb8fe33..6fe09dbe89 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Calendars.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Calendars.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/Coord.py b/source/jormungandr/jormungandr/interfaces/v1/Coord.py index 4bb925251b..624430f068 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Coord.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Coord.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/Coverage.py b/source/jormungandr/jormungandr/interfaces/v1/Coverage.py index 6528431fdd..5d484653fa 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Coverage.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Coverage.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/Disruptions.py b/source/jormungandr/jormungandr/interfaces/v1/Disruptions.py index f4a81d3f0b..e817696966 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Disruptions.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Disruptions.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -95,6 +95,7 @@ def __init__(self): parser_get.add_argument( "tags[]", type=six.text_type, + hidden=True, action="append", help="If filled, will restrain the search within the given disruption tags", ) diff --git a/source/jormungandr/jormungandr/interfaces/v1/EquipmentReports.py b/source/jormungandr/jormungandr/interfaces/v1/EquipmentReports.py index 1b8153e5d2..d83c0c8f5d 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/EquipmentReports.py +++ b/source/jormungandr/jormungandr/interfaces/v1/EquipmentReports.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/GeoStatus.py b/source/jormungandr/jormungandr/interfaces/v1/GeoStatus.py index 583a36de83..0a75de12c1 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/GeoStatus.py +++ b/source/jormungandr/jormungandr/interfaces/v1/GeoStatus.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/GraphicalIsochrone.py b/source/jormungandr/jormungandr/interfaces/v1/GraphicalIsochrone.py index c72cdc4595..1a89bd53e0 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/GraphicalIsochrone.py +++ b/source/jormungandr/jormungandr/interfaces/v1/GraphicalIsochrone.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/interfaces/v1/HeatMap.py b/source/jormungandr/jormungandr/interfaces/v1/HeatMap.py index c50bedc9e2..2994dcc296 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/HeatMap.py +++ b/source/jormungandr/jormungandr/interfaces/v1/HeatMap.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/interfaces/v1/JSONSchema.py b/source/jormungandr/jormungandr/interfaces/v1/JSONSchema.py index 078e1d7aca..71530321e5 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/JSONSchema.py +++ b/source/jormungandr/jormungandr/interfaces/v1/JSONSchema.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/interfaces/v1/Journeys.py b/source/jormungandr/jormungandr/interfaces/v1/Journeys.py index 4321fd82d0..834611a1ad 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Journeys.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Journeys.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/LineReports.py b/source/jormungandr/jormungandr/interfaces/v1/LineReports.py index 2c75105031..928526b7e8 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/LineReports.py +++ b/source/jormungandr/jormungandr/interfaces/v1/LineReports.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -85,6 +85,7 @@ def __init__(self): parser_get.add_argument( "tags[]", type=six.text_type, + hidden=True, action="append", help="If filled, will restrain the search within the given disruption tags", ) diff --git a/source/jormungandr/jormungandr/interfaces/v1/Places.py b/source/jormungandr/jormungandr/interfaces/v1/Places.py index e50d938090..1aac0fee97 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Places.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Places.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/Ptobjects.py b/source/jormungandr/jormungandr/interfaces/v1/Ptobjects.py index 42e940ed8c..3ece099d65 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Ptobjects.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Ptobjects.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/ResourceUri.py b/source/jormungandr/jormungandr/interfaces/v1/ResourceUri.py index 26d1062e60..7d5ae785f0 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/ResourceUri.py +++ b/source/jormungandr/jormungandr/interfaces/v1/ResourceUri.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/Schedules.py b/source/jormungandr/jormungandr/interfaces/v1/Schedules.py index 1089fd4451..2f0c04acf8 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Schedules.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Schedules.py @@ -25,12 +25,12 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division -from flask_restful import reqparse +from flask_restful import reqparse, abort from flask import request, g from jormungandr import i_manager, utils from jormungandr import timezone @@ -57,6 +57,7 @@ ) from jormungandr.exceptions import InvalidArguments import six +import logging class Schedules(ResourceUri, ResourceUtc): @@ -154,6 +155,15 @@ def __init__(self, endpoint, *args, **kwargs): parser_get.add_argument( "disable_geojson", type=BooleanType(), default=False, help="remove geojson from the response" ) + parser_get.add_argument( + "direction_type", + help='Provide a route direction type to filter results. ' + 'Note: forward is equivalent to clockwise and inbound. ' + 'When you select forward, you filter with: [forward, clockwise, inbound]. ' + 'On the other hand, backward is equivalent to anticlockwise and outbound. ' + 'When you select backward, you filter with: [backward, anticlockwise, outbound].', + type=OptionValue(['all', 'forward', 'backward']), + ) self.get_decorators.insert(0, ManageError()) self.get_decorators.insert(1, get_obj_serializer(self)) @@ -162,6 +172,33 @@ def __init__(self, endpoint, *args, **kwargs): def options(self, **kwargs): return self.api_description(**kwargs) + def _add_direction_type_filter(self, direction_type, filter): + + # Don't need a direction type filter + if direction_type == 'all': + return filter + + # (forward, clockwise, inbound) are equivalent and + # (backward, anticlockwise, outbound) are equivalent too. + def create_direction_type_filter(direction_type): + if direction_type == 'forward': + values = 'forward,clockwise,inbound' + elif direction_type == 'backward': + values = 'backward,anticlockwise,outbound' + else: + abort( + 404, + message='wrong direction type parameter selected : {}, it should be [forward, backward, all]]'.format( + direction_type + ), + ) + return 'route.has_direction_type({})'.format(values) + + if filter: + return '({}) and ({})'.format(filter, create_direction_type_filter(direction_type)) + else: + return create_direction_type_filter(direction_type) + def _get_default_freshness(self): # The data freshness depends on the endpoint # for route_schedule, by default we want the base schedule @@ -203,6 +240,11 @@ def get(self, uri=None, region=None, lon=None, lat=None): self.region = i_manager.get_region(region, lon, lat) timezone.set_request_timezone(self.region) + # create direction type filter + if args['direction_type']: + args['filter'] = self._add_direction_type_filter(args['direction_type'], args['filter']) + logging.getLogger(__name__).debug("Schedule filter: %s", args["filter"]) + if not args["from_datetime"] and not args["until_datetime"]: # no datetime given, default is the current time, and we activate the realtime args['from_datetime'] = args['_current_datetime'] diff --git a/source/jormungandr/jormungandr/interfaces/v1/StatedResource.py b/source/jormungandr/jormungandr/interfaces/v1/StatedResource.py index f523ecd940..390ba96674 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/StatedResource.py +++ b/source/jormungandr/jormungandr/interfaces/v1/StatedResource.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/interfaces/v1/Status.py b/source/jormungandr/jormungandr/interfaces/v1/Status.py index cd1a5b10c8..1721311ef1 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Status.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Status.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/Uri.py b/source/jormungandr/jormungandr/interfaces/v1/Uri.py index 4ff483e791..e89fc985ec 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/Uri.py +++ b/source/jormungandr/jormungandr/interfaces/v1/Uri.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/__init__.py b/source/jormungandr/jormungandr/interfaces/v1/__init__.py index 2602e1f549..5925efaeaa 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/__init__.py +++ b/source/jormungandr/jormungandr/interfaces/v1/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/converters_collection_type.py b/source/jormungandr/jormungandr/interfaces/v1/converters_collection_type.py index d803107afd..3961d94868 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/converters_collection_type.py +++ b/source/jormungandr/jormungandr/interfaces/v1/converters_collection_type.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/decorators.py b/source/jormungandr/jormungandr/interfaces/v1/decorators.py index 32dc99e174..1a7545f0d2 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/decorators.py +++ b/source/jormungandr/jormungandr/interfaces/v1/decorators.py @@ -21,7 +21,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/errors.py b/source/jormungandr/jormungandr/interfaces/v1/errors.py index d6942a2d21..e5db2fc9ce 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/errors.py +++ b/source/jormungandr/jormungandr/interfaces/v1/errors.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/feed_publisher.py b/source/jormungandr/jormungandr/interfaces/v1/feed_publisher.py index d79efdfd3f..bedfa0ffcb 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/feed_publisher.py +++ b/source/jormungandr/jormungandr/interfaces/v1/feed_publisher.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/journey_common.py b/source/jormungandr/jormungandr/interfaces/v1/journey_common.py index 32a31400d5..fff4b1596b 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/journey_common.py +++ b/source/jormungandr/jormungandr/interfaces/v1/journey_common.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/make_links.py b/source/jormungandr/jormungandr/interfaces/v1/make_links.py index ad921ce5f0..ed615995da 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/make_links.py +++ b/source/jormungandr/jormungandr/interfaces/v1/make_links.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/__init__.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/__init__.py index 44333610a3..e13a106689 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/__init__.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/__init__.py @@ -21,7 +21,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/api.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/api.py index 25e3ca5a70..9a22042b69 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/api.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/api.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/base.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/base.py index 5bf85bf5a2..18ecb25fa2 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/base.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/base.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/fields.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/fields.py index 0644052a15..56a5646f19 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/fields.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/fields.py @@ -21,7 +21,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/geo_status.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/geo_status.py index d4d2df45bc..7a0188868b 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/geo_status.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/geo_status.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/geocode_json.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/geocode_json.py index c2b740a873..5d9d10cfd8 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/geocode_json.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/geocode_json.py @@ -21,7 +21,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/graphical_isochron.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/graphical_isochron.py index 48f94205b4..69d209cd31 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/graphical_isochron.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/graphical_isochron.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/heat_map.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/heat_map.py index 4e7188692e..5a49d0b78d 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/heat_map.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/heat_map.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/journey.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/journey.py index 96ec76cdfa..ac1cc95112 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/journey.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/journey.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/__init__.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/__init__.py index 15c64d4169..abf0de8a7d 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/__init__.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/__init__.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/fields.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/fields.py index 75dc636e9a..6dbd485bd4 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/fields.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/fields.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/serializer.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/serializer.py index 82399e1338..7ec1f768c8 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/serializer.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/serializer.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/__init__.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/__init__.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/serializer_tests.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/serializer_tests.py index 52e6f7c8a6..bc7bef891a 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/serializer_tests.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/jsonschema/test/serializer_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/pt.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/pt.py index 57fcae22ad..58ee27bb17 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/pt.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/pt.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/report.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/report.py index 4b2c876711..4c842cf4a5 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/report.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/report.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/schedule.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/schedule.py index 17eaef59f8..8c620e4825 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/schedule.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/schedule.py @@ -21,7 +21,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/status.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/status.py index 2931550107..4351e38e66 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/status.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/status.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -70,6 +70,13 @@ class ParametersSerializer(serpy.Serializer): max_extra_second_pass = Field(schema_type=int) additional_time_after_first_section_taxi = Field(schema_type=int) additional_time_before_last_section_taxi = Field(schema_type=int) + max_walking_direct_path_duration = Field(schema_type=int) + max_bike_direct_path_duration = Field(schema_type=int) + max_bss_direct_path_duration = Field(schema_type=int) + max_car_direct_path_duration = Field(schema_type=int) + max_taxi_direct_path_duration = Field(schema_type=int) + max_ridesharing_direct_path_duration = Field(schema_type=int) + max_nb_crowfly_by_mode = Field(schema_type=dict) class TravelerProfilesSerializer(serpy.Serializer): diff --git a/source/jormungandr/jormungandr/interfaces/v1/serializer/time.py b/source/jormungandr/jormungandr/interfaces/v1/serializer/time.py index 33e05f4e79..e40054565c 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/serializer/time.py +++ b/source/jormungandr/jormungandr/interfaces/v1/serializer/time.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py b/source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py index d49c053cf3..8a800e2669 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py +++ b/source/jormungandr/jormungandr/interfaces/v1/swagger_schema.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/interfaces/v1/test/__init__.py b/source/jormungandr/jormungandr/interfaces/v1/test/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/test/__init__.py +++ b/source/jormungandr/jormungandr/interfaces/v1/test/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/test/add_common_status_tests.py b/source/jormungandr/jormungandr/interfaces/v1/test/add_common_status_tests.py index a6c87bf9fb..67514e0ee9 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/test/add_common_status_tests.py +++ b/source/jormungandr/jormungandr/interfaces/v1/test/add_common_status_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/test/elastic_search_tests.py b/source/jormungandr/jormungandr/interfaces/v1/test/elastic_search_tests.py index cb6310c78b..b91f081310 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/test/elastic_search_tests.py +++ b/source/jormungandr/jormungandr/interfaces/v1/test/elastic_search_tests.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, unicode_literals diff --git a/source/jormungandr/jormungandr/interfaces/v1/test/journey_tests.py b/source/jormungandr/jormungandr/interfaces/v1/test/journey_tests.py index ffc23e830a..375bdd5816 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/test/journey_tests.py +++ b/source/jormungandr/jormungandr/interfaces/v1/test/journey_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/test/places_tests.py b/source/jormungandr/jormungandr/interfaces/v1/test/places_tests.py index 2ccd0242a8..8e24abdb34 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/test/places_tests.py +++ b/source/jormungandr/jormungandr/interfaces/v1/test/places_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/test/resource_uri_tests.py b/source/jormungandr/jormungandr/interfaces/v1/test/resource_uri_tests.py index a686b7afd5..506891c192 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/test/resource_uri_tests.py +++ b/source/jormungandr/jormungandr/interfaces/v1/test/resource_uri_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/interfaces/v1/transform_id.py b/source/jormungandr/jormungandr/interfaces/v1/transform_id.py index 1488a6e97c..eca0ff99d3 100644 --- a/source/jormungandr/jormungandr/interfaces/v1/transform_id.py +++ b/source/jormungandr/jormungandr/interfaces/v1/transform_id.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/logging_utils.py b/source/jormungandr/jormungandr/logging_utils.py index 20742d19c4..55de53affc 100644 --- a/source/jormungandr/jormungandr/logging_utils.py +++ b/source/jormungandr/jormungandr/logging_utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/module_resource.py b/source/jormungandr/jormungandr/module_resource.py index 1e636d152a..908959978d 100644 --- a/source/jormungandr/jormungandr/module_resource.py +++ b/source/jormungandr/jormungandr/module_resource.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/modules/__init__.py b/source/jormungandr/jormungandr/modules/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/jormungandr/jormungandr/modules/__init__.py +++ b/source/jormungandr/jormungandr/modules/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/modules/example_routing/ExampleRouting.py b/source/jormungandr/jormungandr/modules/example_routing/ExampleRouting.py index 7d27f481cf..f92d327c70 100644 --- a/source/jormungandr/jormungandr/modules/example_routing/ExampleRouting.py +++ b/source/jormungandr/jormungandr/modules/example_routing/ExampleRouting.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/modules/example_routing/__init__.py b/source/jormungandr/jormungandr/modules/example_routing/__init__.py index d0c77e64fa..4a3a5c9ae9 100644 --- a/source/jormungandr/jormungandr/modules/example_routing/__init__.py +++ b/source/jormungandr/jormungandr/modules/example_routing/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/modules/v1_routing/__init__.py b/source/jormungandr/jormungandr/modules/v1_routing/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/jormungandr/jormungandr/modules/v1_routing/__init__.py +++ b/source/jormungandr/jormungandr/modules/v1_routing/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/modules/v1_routing/resources/Index.py b/source/jormungandr/jormungandr/modules/v1_routing/resources/Index.py index 7886539199..521daaff6b 100644 --- a/source/jormungandr/jormungandr/modules/v1_routing/resources/Index.py +++ b/source/jormungandr/jormungandr/modules/v1_routing/resources/Index.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/modules/v1_routing/resources/__init__.py b/source/jormungandr/jormungandr/modules/v1_routing/resources/__init__.py index 55da73de83..49c58d6083 100644 --- a/source/jormungandr/jormungandr/modules/v1_routing/resources/__init__.py +++ b/source/jormungandr/jormungandr/modules/v1_routing/resources/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/modules/v1_routing/v1_routing.py b/source/jormungandr/jormungandr/modules/v1_routing/v1_routing.py index 61f32164d2..79fcff1651 100644 --- a/source/jormungandr/jormungandr/modules/v1_routing/v1_routing.py +++ b/source/jormungandr/jormungandr/modules/v1_routing/v1_routing.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/modules_loader.py b/source/jormungandr/jormungandr/modules_loader.py index 6b21a7b6a2..c7262d1a91 100644 --- a/source/jormungandr/jormungandr/modules_loader.py +++ b/source/jormungandr/jormungandr/modules_loader.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/new_relic.py b/source/jormungandr/jormungandr/new_relic.py index f09ab2e56d..59a754fcc2 100644 --- a/source/jormungandr/jormungandr/new_relic.py +++ b/source/jormungandr/jormungandr/new_relic.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/__init__.py b/source/jormungandr/jormungandr/parking_space_availability/__init__.py index 2a8618c08e..4dc60316ed 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/__init__.py +++ b/source/jormungandr/jormungandr/parking_space_availability/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/abstract_parking_places_provider.py b/source/jormungandr/jormungandr/parking_space_availability/abstract_parking_places_provider.py index 21cc357d17..59e8e7fb58 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/abstract_parking_places_provider.py +++ b/source/jormungandr/jormungandr/parking_space_availability/abstract_parking_places_provider.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/abstract_provider_manager.py b/source/jormungandr/jormungandr/parking_space_availability/abstract_provider_manager.py index e5a02269a0..06a5f5f5fc 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/abstract_provider_manager.py +++ b/source/jormungandr/jormungandr/parking_space_availability/abstract_provider_manager.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/__init__.py b/source/jormungandr/jormungandr/parking_space_availability/bss/__init__.py index fdfb2dc204..9209a382d5 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/__init__.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/atos.py b/source/jormungandr/jormungandr/parking_space_availability/bss/atos.py index 04b711e4b0..36f065c95c 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/atos.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/atos.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/bss_provider_manager.py b/source/jormungandr/jormungandr/parking_space_availability/bss/bss_provider_manager.py index bce7ec1224..ba65324f23 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/bss_provider_manager.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/bss_provider_manager.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/common_bss_provider.py b/source/jormungandr/jormungandr/parking_space_availability/bss/common_bss_provider.py index 3bb3711909..e9a8f5c21b 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/common_bss_provider.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/common_bss_provider.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from jormungandr import new_relic diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/cykleo.py b/source/jormungandr/jormungandr/parking_space_availability/bss/cykleo.py index e605e805fc..29ebbd2b7f 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/cykleo.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/cykleo.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/jcdecaux.py b/source/jormungandr/jormungandr/parking_space_availability/bss/jcdecaux.py index c933a8f477..5205b87a1f 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/jcdecaux.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/jcdecaux.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/stands.py b/source/jormungandr/jormungandr/parking_space_availability/bss/stands.py index 295256d3e4..7b75fa49fa 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/stands.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/stands.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/__init__.py b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/__init__.py index 6df93062cc..584421f7d1 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/__init__.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/atos_test.py b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/atos_test.py index 4385953d5a..a3cff2d2fc 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/atos_test.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/atos_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_mock.py b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_mock.py index 67335129b8..803efd59a5 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_mock.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_mock.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_provider_manager_test.py b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_provider_manager_test.py index 712fb87de2..b9c02f173b 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_provider_manager_test.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/bss_provider_manager_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/cykleo_test.py b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/cykleo_test.py index e77a70c3e1..2a02dcc553 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/cykleo_test.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/cykleo_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/jcdecaux_test.py b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/jcdecaux_test.py index 23e4d45080..c4e7959f78 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/bss/tests/jcdecaux_test.py +++ b/source/jormungandr/jormungandr/parking_space_availability/bss/tests/jcdecaux_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/__init__.py b/source/jormungandr/jormungandr/parking_space_availability/car/__init__.py index 51f0d8c78e..26fa9ba69a 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/__init__.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/car_park_provider_manager.py b/source/jormungandr/jormungandr/parking_space_availability/car/car_park_provider_manager.py index 9e215888c0..adfffe18f2 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/car_park_provider_manager.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/car_park_provider_manager.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/common_car_park_provider.py b/source/jormungandr/jormungandr/parking_space_availability/car/common_car_park_provider.py index 460dee2430..fd26dc01b2 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/common_car_park_provider.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/common_car_park_provider.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/divia.py b/source/jormungandr/jormungandr/parking_space_availability/car/divia.py index ee41f89340..abc10646e8 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/divia.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/divia.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/parking_places.py b/source/jormungandr/jormungandr/parking_space_availability/car/parking_places.py index 1cf3b940bf..db726f614a 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/parking_places.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/parking_places.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/star.py b/source/jormungandr/jormungandr/parking_space_availability/car/star.py index 10c7d886c3..a88e35a1aa 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/star.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/star.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/sytral.py b/source/jormungandr/jormungandr/parking_space_availability/car/sytral.py index 22abf14ebd..e3dbe356b9 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/sytral.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/sytral.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/tests/divia_test.py b/source/jormungandr/jormungandr/parking_space_availability/car/tests/divia_test.py index 6bb6254cb0..b2127b440a 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/tests/divia_test.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/tests/divia_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/tests/star_test.py b/source/jormungandr/jormungandr/parking_space_availability/car/tests/star_test.py index 49b06cff59..8c15c26488 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/tests/star_test.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/tests/star_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/parking_space_availability/car/tests/sytral_test.py b/source/jormungandr/jormungandr/parking_space_availability/car/tests/sytral_test.py index 33e9e95b19..cc9f476a7d 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/car/tests/sytral_test.py +++ b/source/jormungandr/jormungandr/parking_space_availability/car/tests/sytral_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/parking_space_availability/parking_places_manager.py b/source/jormungandr/jormungandr/parking_space_availability/parking_places_manager.py index b1576a4d94..56ff32ec1c 100644 --- a/source/jormungandr/jormungandr/parking_space_availability/parking_places_manager.py +++ b/source/jormungandr/jormungandr/parking_space_availability/parking_places_manager.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/planner.py b/source/jormungandr/jormungandr/planner.py index 5d0f2c7ee9..de0fb74eaa 100644 --- a/source/jormungandr/jormungandr/planner.py +++ b/source/jormungandr/jormungandr/planner.py @@ -13,7 +13,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/protobuf_to_dict.py b/source/jormungandr/jormungandr/protobuf_to_dict.py index b58a51b910..71980208b3 100644 --- a/source/jormungandr/jormungandr/protobuf_to_dict.py +++ b/source/jormungandr/jormungandr/protobuf_to_dict.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/ptref.py b/source/jormungandr/jormungandr/ptref.py index 3939ab2ab9..6256c701ed 100644 --- a/source/jormungandr/jormungandr/ptref.py +++ b/source/jormungandr/jormungandr/ptref.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/quota.py b/source/jormungandr/jormungandr/quota.py index e64de394db..b70c8a35a3 100644 --- a/source/jormungandr/jormungandr/quota.py +++ b/source/jormungandr/jormungandr/quota.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/realtime_schedule/__init__.py b/source/jormungandr/jormungandr/realtime_schedule/__init__.py index 046819a26e..cd704aa245 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/__init__.py +++ b/source/jormungandr/jormungandr/realtime_schedule/__init__.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/cleverage.py b/source/jormungandr/jormungandr/realtime_schedule/cleverage.py index e0ccc3172c..f9e24d5f04 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/cleverage.py +++ b/source/jormungandr/jormungandr/realtime_schedule/cleverage.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy.py b/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy.py index b624f19ca9..119f637666 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy.py +++ b/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy_manager.py b/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy_manager.py index d723b6eec1..9a9dfa93e2 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy_manager.py +++ b/source/jormungandr/jormungandr/realtime_schedule/realtime_proxy_manager.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/siri.py b/source/jormungandr/jormungandr/realtime_schedule/siri.py index 786b40a7fc..37ccbc19af 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/siri.py +++ b/source/jormungandr/jormungandr/realtime_schedule/siri.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/realtime_schedule/siri_lite.py b/source/jormungandr/jormungandr/realtime_schedule/siri_lite.py index c4ca27c683..b0293796a6 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/siri_lite.py +++ b/source/jormungandr/jormungandr/realtime_schedule/siri_lite.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/synthese.py b/source/jormungandr/jormungandr/realtime_schedule/synthese.py index 261cf1a1ec..0be22084d3 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/synthese.py +++ b/source/jormungandr/jormungandr/realtime_schedule/synthese.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/sytral.py b/source/jormungandr/jormungandr/realtime_schedule/sytral.py index b5c3773c9c..9bbc554bbe 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/sytral.py +++ b/source/jormungandr/jormungandr/realtime_schedule/sytral.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/__init__.py b/source/jormungandr/jormungandr/realtime_schedule/tests/__init__.py index f978c9208e..a3b03c7d39 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/__init__.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/cleverage_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/cleverage_test.py index 71545a04de..a9da8b7c68 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/cleverage_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/cleverage_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_manager_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_manager_test.py index 549d0c9b54..3c0ca92a04 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_manager_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_manager_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_test.py index 970d4e3032..8be39e0080 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/realtime_proxy_test.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/siri_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/siri_test.py index 29b48b38a2..6b3cbe056c 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/siri_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/siri_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_test.py index 77ec7d30db..79eae44363 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_xml_reader_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_xml_reader_test.py index 8870ddd33e..1fbd061c15 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_xml_reader_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/synthese_xml_reader_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/sytral_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/sytral_test.py index 86f75a0ee7..89123688fb 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/sytral_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/sytral_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/timeo_test.py b/source/jormungandr/jormungandr/realtime_schedule/tests/timeo_test.py index a42a6f2ec7..c95b3462f7 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/timeo_test.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/timeo_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/tests/utils.py b/source/jormungandr/jormungandr/realtime_schedule/tests/utils.py index fd54dcb58a..f9f7bd7e74 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/tests/utils.py +++ b/source/jormungandr/jormungandr/realtime_schedule/tests/utils.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/realtime_schedule/timeo.py b/source/jormungandr/jormungandr/realtime_schedule/timeo.py index 6f9ea4e809..899e9754c9 100644 --- a/source/jormungandr/jormungandr/realtime_schedule/timeo.py +++ b/source/jormungandr/jormungandr/realtime_schedule/timeo.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/resources_utils.py b/source/jormungandr/jormungandr/resources_utils.py index 15e71bb1b5..bd68a24fe7 100644 --- a/source/jormungandr/jormungandr/resources_utils.py +++ b/source/jormungandr/jormungandr/resources_utils.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/__init__.py b/source/jormungandr/jormungandr/scenarios/__init__.py index b835470ff7..a2897be447 100644 --- a/source/jormungandr/jormungandr/scenarios/__init__.py +++ b/source/jormungandr/jormungandr/scenarios/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/distributed.py b/source/jormungandr/jormungandr/scenarios/distributed.py index 2f151cbc14..a95d7e7e6f 100644 --- a/source/jormungandr/jormungandr/scenarios/distributed.py +++ b/source/jormungandr/jormungandr/scenarios/distributed.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/__init__.py b/source/jormungandr/jormungandr/scenarios/helper_classes/__init__.py index 4648edcfa3..d86d331c15 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/__init__.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/complete_pt_journey.py b/source/jormungandr/jormungandr/scenarios/helper_classes/complete_pt_journey.py index c94937deb7..9562f79f3f 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/complete_pt_journey.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/complete_pt_journey.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/fallback_durations.py b/source/jormungandr/jormungandr/scenarios/helper_classes/fallback_durations.py index 9738664170..54c5122fb7 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/fallback_durations.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/fallback_durations.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/helper_exceptions.py b/source/jormungandr/jormungandr/scenarios/helper_classes/helper_exceptions.py index dd75b19b3b..cf462548aa 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/helper_exceptions.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/helper_exceptions.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/helper_future.py b/source/jormungandr/jormungandr/scenarios/helper_classes/helper_future.py index ff9ce609a6..f2ba96ab3d 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/helper_future.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/helper_future.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py b/source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py index cb6f589666..44aeca9774 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/place_by_uri.py b/source/jormungandr/jormungandr/scenarios/helper_classes/place_by_uri.py index 4da50a470a..81b6f1ab28 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/place_by_uri.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/place_by_uri.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/places_free_access.py b/source/jormungandr/jormungandr/scenarios/helper_classes/places_free_access.py index 4d212c5bae..469b718c6d 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/places_free_access.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/places_free_access.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/proximities_by_crowfly.py b/source/jormungandr/jormungandr/scenarios/helper_classes/proximities_by_crowfly.py index 5a3325dca6..1d0458a936 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/proximities_by_crowfly.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/proximities_by_crowfly.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey.py b/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey.py index f12317b297..d8b3e603b1 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/pt_journey.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/streetnetwork_path.py b/source/jormungandr/jormungandr/scenarios/helper_classes/streetnetwork_path.py index 045e931a0f..34f8324c22 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/streetnetwork_path.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/streetnetwork_path.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/tests/__init__.py b/source/jormungandr/jormungandr/scenarios/helper_classes/tests/__init__.py index 60ef4dd041..d0fb5c06f9 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/tests/__init__.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/tests/__init__.py @@ -24,6 +24,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_classes_test.py b/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_classes_test.py index 3459300ed9..60ea767049 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_classes_test.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_classes_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_utils_test.py b/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_utils_test.py index 7dc8b7c854..75185e2d16 100644 --- a/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_utils_test.py +++ b/source/jormungandr/jormungandr/scenarios/helper_classes/tests/helper_utils_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/helpers.py b/source/jormungandr/jormungandr/scenarios/helpers.py index 76ef4ffdf2..ea4e4f0c0c 100644 --- a/source/jormungandr/jormungandr/scenarios/helpers.py +++ b/source/jormungandr/jormungandr/scenarios/helpers.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/journey_filter.py b/source/jormungandr/jormungandr/scenarios/journey_filter.py index 49b5f0dde7..85a663d4ae 100644 --- a/source/jormungandr/jormungandr/scenarios/journey_filter.py +++ b/source/jormungandr/jormungandr/scenarios/journey_filter.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -37,6 +37,7 @@ from navitiacommon import response_pb2 from jormungandr.utils import pb_del_if, ComposedFilter, portable_min from jormungandr.fallback_modes import FallbackModes +from jormungandr.scenarios.qualifier import get_ASAP_journey def delete_journeys(responses, request): @@ -390,15 +391,15 @@ def filter_func(self, journey): return max_duration > journey.duration -def get_min_connections(journeys): +def get_best_pt_journey_connections(journeys, request): """ - Returns min connection count among journeys + Returns the nb of connection of the best pt_journey Returns None if journeys empty """ if not journeys: return None - - return portable_min((get_nb_connections(j) for j in journeys if not to_be_deleted(j)), default=0) + best = get_ASAP_journey((j for j in journeys if 'non_pt' not in j.tags), request) + return get_nb_connections(best) if best else None def get_nb_connections(journey): @@ -711,7 +712,7 @@ def _filter_similar_journeys(journey_pairs_pool, request, similar_journey_genera def _filter_too_much_connections(journeys, instance, request): """ eliminates journeys with a number of connections strictly superior to the - minimum number of connections among all journeys + _max_additional_connections + the number of connections of the best pt_journey + _max_additional_connections """ logger = logging.getLogger(__name__) max_additional_connections = get_or_default( @@ -720,11 +721,33 @@ def _filter_too_much_connections(journeys, instance, request): import itertools it1, it2 = itertools.tee(journeys, 2) - min_connections = get_min_connections(it1) + best_pt_journey_connections = get_best_pt_journey_connections(it1, request) is_debug = request.get('debug', False) - if min_connections is not None: - max_connections_allowed = max_additional_connections + min_connections + if best_pt_journey_connections is not None: + max_connections_allowed = max_additional_connections + best_pt_journey_connections for j in it2: if get_nb_connections(j) > max_connections_allowed: logger.debug("the journey {} has a too much connections, we delete it".format(j.internal_id)) mark_as_dead(j, is_debug, "too_much_connections") + + +def remove_excess_tickets(response): + """ + Remove excess tickets + """ + logger = logging.getLogger(__name__) + + fare_ticket_id_list = set() + for j in response.journeys: + for t_id in j.fare.ticket_id: + fare_ticket_id_list.add(t_id) + # ridesharing case + for s in j.sections: + for rj in s.ridesharing_journeys: + for t_id in rj.fare.ticket_id: + fare_ticket_id_list.add(t_id) + + for t in response.tickets: + if not t.id in fare_ticket_id_list: + logger.debug('remove excess ticket id %s', t.id) + response.tickets.remove(t) diff --git a/source/jormungandr/jormungandr/scenarios/new_default.py b/source/jormungandr/jormungandr/scenarios/new_default.py index c9a80eb26b..b73a02cabd 100644 --- a/source/jormungandr/jormungandr/scenarios/new_default.py +++ b/source/jormungandr/jormungandr/scenarios/new_default.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -67,6 +67,8 @@ non_pt_journey, has_walk, and_filters, + get_ASAP_journey, + comfort_crit, ) import numpy as np import collections @@ -702,7 +704,7 @@ def type_journeys(resp, req): # Then, we want something like the old types trip_caracs = [ # comfort tends to limit the number of transfers and fallback - ("comfort", trip_carac([has_no_car], [transfers_crit, nonTC_crit, best_crit, duration_crit])), + ("comfort", trip_carac([has_no_car], [comfort_crit, best_crit, duration_crit])), # for car we want at most one journey, the earliest one ( "car", @@ -746,7 +748,7 @@ def type_journeys(resp, req): best.type = name # Finally, we want exactly one best, the ASAP one - best = min_from_criteria(resp.journeys, [best_crit, duration_crit, transfers_crit, nonTC_crit]) + best = get_ASAP_journey(resp.journeys, req) if best is not None: best.type = "best" @@ -769,7 +771,13 @@ def merge_responses(responses, debug): # we have to add the additional fares too # if at least one journey has the ticket we add it - tickets_to_add = set(t for j in r.journeys for t in j.fare.ticket_id) + # and if the journey is not to be deleted in debug mode + tickets_to_add = set( + t + for j in r.journeys + if not (journey_filter.to_be_deleted(j) and not debug) + for t in j.fare.ticket_id + ) merged_response.tickets.extend((t for t in r.tickets if t.id in tickets_to_add)) initial_feed_publishers = {} @@ -1038,6 +1046,8 @@ def fill_journeys(self, request_type, api_request, instance): journey_filter.delete_journeys((pb_resp,), api_request) type_journeys(pb_resp, api_request) culling_journeys(pb_resp, api_request) + # need to clean extra tickets after culling journeys + journey_filter.remove_excess_tickets(pb_resp) self._compute_pagination_links(pb_resp, instance, api_request['clockwise']) return pb_resp diff --git a/source/jormungandr/jormungandr/scenarios/qualifier.py b/source/jormungandr/jormungandr/scenarios/qualifier.py index 5e9639f1e8..b1526c694a 100644 --- a/source/jormungandr/jormungandr/scenarios/qualifier.py +++ b/source/jormungandr/jormungandr/scenarios/qualifier.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -228,3 +228,24 @@ def nonTC_crit(j_1, j_2): def duration_crit(j_1, j_2): return compare_minus(j_1.duration, j_2.duration) + + +def comfort_crit(j_1, j_2): + # this filter tends to limit the nb of transfers + # Case 1: + # if j_1 and j_2 have PT sections and nb_transfers ARE NOT equal: return the journey has minimum nb transfer + # Case 2: + # if j_1 and j_2 have PT sections and nb_transfers ARE equal: return the journey has minimum non tc duration + # Case 3: + # if one of journeys is direct_path: return the journey has minimum non tc duration + + transfer = compare_minus(j_1.nb_transfers, j_2.nb_transfers) + if transfer != 0 and has_pt(j_1) and has_pt(j_2): + return transfer + # j_1 is better than j_2 and j_1 is not pt + return nonTC_crit(j_1, j_2) + + +def get_ASAP_journey(journeys, req): + best_crit = arrival_crit if req["clockwise"] else departure_crit + return min_from_criteria(journeys, [best_crit, duration_crit, transfers_crit, nonTC_crit]) diff --git a/source/jormungandr/jormungandr/scenarios/ridesharing/__init__.py b/source/jormungandr/jormungandr/scenarios/ridesharing/__init__.py index 00d1fa3f37..9bd9bf5747 100644 --- a/source/jormungandr/jormungandr/scenarios/ridesharing/__init__.py +++ b/source/jormungandr/jormungandr/scenarios/ridesharing/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/ridesharing/instant_system.py b/source/jormungandr/jormungandr/scenarios/ridesharing/instant_system.py index d1c829399a..a22afb96bd 100644 --- a/source/jormungandr/jormungandr/scenarios/ridesharing/instant_system.py +++ b/source/jormungandr/jormungandr/scenarios/ridesharing/instant_system.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_helper.py b/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_helper.py index c2efac4eb1..b57c768c3b 100644 --- a/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_helper.py +++ b/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_helper.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_journey.py b/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_journey.py index 65d4aef113..b8e15de964 100644 --- a/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_journey.py +++ b/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_journey.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py b/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py index 648fd3cc58..292082fa54 100644 --- a/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py +++ b/source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/ridesharing/tests/__init__.py b/source/jormungandr/jormungandr/scenarios/ridesharing/tests/__init__.py index 00d1fa3f37..9bd9bf5747 100644 --- a/source/jormungandr/jormungandr/scenarios/ridesharing/tests/__init__.py +++ b/source/jormungandr/jormungandr/scenarios/ridesharing/tests/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/ridesharing/tests/instant_system_tests.py b/source/jormungandr/jormungandr/scenarios/ridesharing/tests/instant_system_tests.py index d93200b43f..b3f69726de 100644 --- a/source/jormungandr/jormungandr/scenarios/ridesharing/tests/instant_system_tests.py +++ b/source/jormungandr/jormungandr/scenarios/ridesharing/tests/instant_system_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/simple.py b/source/jormungandr/jormungandr/scenarios/simple.py index 85414d3b74..7877c138b7 100644 --- a/source/jormungandr/jormungandr/scenarios/simple.py +++ b/source/jormungandr/jormungandr/scenarios/simple.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/scenarios/tests/__init__.py b/source/jormungandr/jormungandr/scenarios/tests/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/jormungandr/jormungandr/scenarios/tests/__init__.py +++ b/source/jormungandr/jormungandr/scenarios/tests/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/scenarios/tests/helpers_tests.py b/source/jormungandr/jormungandr/scenarios/tests/helpers_tests.py index e27c03cef2..4670ec7428 100644 --- a/source/jormungandr/jormungandr/scenarios/tests/helpers_tests.py +++ b/source/jormungandr/jormungandr/scenarios/tests/helpers_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/scenarios/tests/journey_compare_tests.py b/source/jormungandr/jormungandr/scenarios/tests/journey_compare_tests.py index 7ce7a2a38c..944b8c6fcf 100644 --- a/source/jormungandr/jormungandr/scenarios/tests/journey_compare_tests.py +++ b/source/jormungandr/jormungandr/scenarios/tests/journey_compare_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/scenarios/tests/new_default_tests.py b/source/jormungandr/jormungandr/scenarios/tests/new_default_tests.py index a4e48f8a40..686ca3a528 100644 --- a/source/jormungandr/jormungandr/scenarios/tests/new_default_tests.py +++ b/source/jormungandr/jormungandr/scenarios/tests/new_default_tests.py @@ -23,14 +23,14 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division import navitiacommon.response_pb2 as response_pb2 import jormungandr.scenarios.tests.helpers_tests as helpers_tests -from jormungandr.scenarios import new_default +from jormungandr.scenarios import new_default, journey_filter from jormungandr.scenarios.new_default import _tag_journey_by_mode, get_kraken_calls from jormungandr.scenarios.utils import switch_back_to_ridesharing from werkzeug.exceptions import HTTPException @@ -140,6 +140,8 @@ def build_mocked_response(): arrival_time, jrny_type, sections_idx = jrny pb_j = response.journeys.add() pb_j.arrival_date_time = arrival_time + # we remove the street network section + pb_j.nb_transfers = len(sections_idx) - 1 - (1 in sections_idx) - (10 in sections_idx) if jrny_type: pb_j.type = jrny_type for idx in sections_idx: @@ -150,6 +152,11 @@ def build_mocked_response(): section.street_network.mode = network_mode if line_uri: section.uris.line = line_uri + + new_default._tag_by_mode([response]) + new_default._tag_direct_path([response]) + new_default._tag_bike_in_pt([response]) + return response @@ -509,3 +516,30 @@ def crowfly_in_ridesharing_test(): assert journey.durations.car == 0 assert journey.distances.ridesharing == 43 assert journey.distances.car == 0 + + +def filter_too_many_connections_test(): + # yes, it's a hack... + instance = lambda: None + + instance.max_additional_connections = 10 + mocked_pb_response = build_mocked_response() + mocked_request = {'debug': True, 'datetime': 1444903200, 'clockwise': True} + journey_filter.apply_final_journey_filters([mocked_pb_response], instance, mocked_request) + assert all('deleted_because_too_much_connections' not in j.tags for j in mocked_pb_response.journeys) + + instance.max_additional_connections = 0 + mocked_pb_response = build_mocked_response() + mocked_request = {'debug': True, 'datetime': 1444903200, 'clockwise': True} + journey_filter.apply_final_journey_filters([mocked_pb_response], instance, mocked_request) + assert sum('deleted_because_too_much_connections' not in j.tags for j in mocked_pb_response.journeys) == 17 + # the best journey must be kept + assert 'deleted_because_too_much_connections' not in mocked_pb_response.journeys[14].tags + + instance.max_additional_connections = 0 + mocked_pb_response = build_mocked_response() + mocked_request = {'_max_additional_connections': 1, 'debug': True, 'datetime': 1444903200, 'clockwise': True} + journey_filter.apply_final_journey_filters([mocked_pb_response], instance, mocked_request) + assert sum('deleted_because_too_much_connections' not in j.tags for j in mocked_pb_response.journeys) == 19 + # the best journey must be kept + assert 'deleted_because_too_much_connections' not in mocked_pb_response.journeys[14].tags diff --git a/source/jormungandr/jormungandr/scenarios/tests/protobuf_builder.py b/source/jormungandr/jormungandr/scenarios/tests/protobuf_builder.py index d548ea9419..3b261044db 100644 --- a/source/jormungandr/jormungandr/scenarios/tests/protobuf_builder.py +++ b/source/jormungandr/jormungandr/scenarios/tests/protobuf_builder.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/scenarios/tests/qualifier_tests.py b/source/jormungandr/jormungandr/scenarios/tests/qualifier_tests.py index a9a4cf7c8e..9f3e1e728f 100644 --- a/source/jormungandr/jormungandr/scenarios/tests/qualifier_tests.py +++ b/source/jormungandr/jormungandr/scenarios/tests/qualifier_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/scenarios/utils.py b/source/jormungandr/jormungandr/scenarios/utils.py index 5aaba18a16..06d1e964a5 100644 --- a/source/jormungandr/jormungandr/scenarios/utils.py +++ b/source/jormungandr/jormungandr/scenarios/utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/schedule.py b/source/jormungandr/jormungandr/schedule.py index 317372197c..f9673362c2 100644 --- a/source/jormungandr/jormungandr/schedule.py +++ b/source/jormungandr/jormungandr/schedule.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/stat_manager.py b/source/jormungandr/jormungandr/stat_manager.py index 2cdaa713b3..e883cd2196 100644 --- a/source/jormungandr/jormungandr/stat_manager.py +++ b/source/jormungandr/jormungandr/stat_manager.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/__init__.py b/source/jormungandr/jormungandr/street_network/__init__.py index 0b8281ae37..3e484d4a6e 100644 --- a/source/jormungandr/jormungandr/street_network/__init__.py +++ b/source/jormungandr/jormungandr/street_network/__init__.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/asgard.py b/source/jormungandr/jormungandr/street_network/asgard.py index f418b2540b..a5e90166c9 100644 --- a/source/jormungandr/jormungandr/street_network/asgard.py +++ b/source/jormungandr/jormungandr/street_network/asgard.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/geovelo.py b/source/jormungandr/jormungandr/street_network/geovelo.py index add913e1df..593afd1c2b 100644 --- a/source/jormungandr/jormungandr/street_network/geovelo.py +++ b/source/jormungandr/jormungandr/street_network/geovelo.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/here.py b/source/jormungandr/jormungandr/street_network/here.py index a798f88191..b310209f9f 100644 --- a/source/jormungandr/jormungandr/street_network/here.py +++ b/source/jormungandr/jormungandr/street_network/here.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/kraken.py b/source/jormungandr/jormungandr/street_network/kraken.py index 1625098899..c4609608dc 100644 --- a/source/jormungandr/jormungandr/street_network/kraken.py +++ b/source/jormungandr/jormungandr/street_network/kraken.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/parking/abstract_parking_module.py b/source/jormungandr/jormungandr/street_network/parking/abstract_parking_module.py index 1123010825..d9a58c5c7b 100644 --- a/source/jormungandr/jormungandr/street_network/parking/abstract_parking_module.py +++ b/source/jormungandr/jormungandr/street_network/parking/abstract_parking_module.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/parking/augeas.py b/source/jormungandr/jormungandr/street_network/parking/augeas.py index d14a676f1a..6d3a57af30 100644 --- a/source/jormungandr/jormungandr/street_network/parking/augeas.py +++ b/source/jormungandr/jormungandr/street_network/parking/augeas.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/parking/constant_parking.py b/source/jormungandr/jormungandr/street_network/parking/constant_parking.py index 1ed9b983eb..ad0fc8165f 100644 --- a/source/jormungandr/jormungandr/street_network/parking/constant_parking.py +++ b/source/jormungandr/jormungandr/street_network/parking/constant_parking.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/ridesharing.py b/source/jormungandr/jormungandr/street_network/ridesharing.py index fe97b0683b..e533101a93 100644 --- a/source/jormungandr/jormungandr/street_network/ridesharing.py +++ b/source/jormungandr/jormungandr/street_network/ridesharing.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/street_network.py b/source/jormungandr/jormungandr/street_network/street_network.py index 73e4c51efd..735be6877a 100644 --- a/source/jormungandr/jormungandr/street_network/street_network.py +++ b/source/jormungandr/jormungandr/street_network/street_network.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/streetnetwork_backend_manager.py b/source/jormungandr/jormungandr/street_network/streetnetwork_backend_manager.py index fd206dd033..20639dde43 100644 --- a/source/jormungandr/jormungandr/street_network/streetnetwork_backend_manager.py +++ b/source/jormungandr/jormungandr/street_network/streetnetwork_backend_manager.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/taxi.py b/source/jormungandr/jormungandr/street_network/taxi.py index a41468a7b3..d2f22c445f 100644 --- a/source/jormungandr/jormungandr/street_network/taxi.py +++ b/source/jormungandr/jormungandr/street_network/taxi.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/tests/__init__.py b/source/jormungandr/jormungandr/street_network/tests/__init__.py index 71e53839f1..defaab5092 100644 --- a/source/jormungandr/jormungandr/street_network/tests/__init__.py +++ b/source/jormungandr/jormungandr/street_network/tests/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/tests/asgard_test.py b/source/jormungandr/jormungandr/street_network/tests/asgard_test.py index 7fbf96978c..4a7c449359 100644 --- a/source/jormungandr/jormungandr/street_network/tests/asgard_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/asgard_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/tests/geovelo_test.py b/source/jormungandr/jormungandr/street_network/tests/geovelo_test.py index 3018bb4d90..7b28407339 100644 --- a/source/jormungandr/jormungandr/street_network/tests/geovelo_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/geovelo_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/street_network/tests/here_test.py b/source/jormungandr/jormungandr/street_network/tests/here_test.py index 0cf559d6c0..6058ae64b9 100644 --- a/source/jormungandr/jormungandr/street_network/tests/here_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/here_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/tests/kraken_test.py b/source/jormungandr/jormungandr/street_network/tests/kraken_test.py index 06a18e76cd..72dd437d27 100644 --- a/source/jormungandr/jormungandr/street_network/tests/kraken_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/kraken_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/tests/ridesharing_test.py b/source/jormungandr/jormungandr/street_network/tests/ridesharing_test.py index 4c37955c4a..94c83b4b8b 100644 --- a/source/jormungandr/jormungandr/street_network/tests/ridesharing_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/ridesharing_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_manager_test.py b/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_manager_test.py index 0450784a90..90f18c1de3 100644 --- a/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_manager_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_manager_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_mock.py b/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_mock.py index 6ab5a868e4..e9826a6d89 100644 --- a/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_mock.py +++ b/source/jormungandr/jormungandr/street_network/tests/streetnetwork_backend_mock.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/tests/streetnetwork_test_utils.py b/source/jormungandr/jormungandr/street_network/tests/streetnetwork_test_utils.py index df1722e594..93e7ed6eec 100644 --- a/source/jormungandr/jormungandr/street_network/tests/streetnetwork_test_utils.py +++ b/source/jormungandr/jormungandr/street_network/tests/streetnetwork_test_utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/street_network/tests/taxi_test.py b/source/jormungandr/jormungandr/street_network/tests/taxi_test.py index 40dfde4a27..22edee9f2b 100644 --- a/source/jormungandr/jormungandr/street_network/tests/taxi_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/taxi_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/tests/valhalla_test.py b/source/jormungandr/jormungandr/street_network/tests/valhalla_test.py index d5d5d33f1f..ee3007ad37 100644 --- a/source/jormungandr/jormungandr/street_network/tests/valhalla_test.py +++ b/source/jormungandr/jormungandr/street_network/tests/valhalla_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/jormungandr/street_network/utils.py b/source/jormungandr/jormungandr/street_network/utils.py index 85fdc3ac43..e3b6224e16 100644 --- a/source/jormungandr/jormungandr/street_network/utils.py +++ b/source/jormungandr/jormungandr/street_network/utils.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/street_network/valhalla.py b/source/jormungandr/jormungandr/street_network/valhalla.py index e9f6021460..8bd030e72c 100644 --- a/source/jormungandr/jormungandr/street_network/valhalla.py +++ b/source/jormungandr/jormungandr/street_network/valhalla.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/street_network/with_parking.py b/source/jormungandr/jormungandr/street_network/with_parking.py index e8bf91530e..0513b851b7 100644 --- a/source/jormungandr/jormungandr/street_network/with_parking.py +++ b/source/jormungandr/jormungandr/street_network/with_parking.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/tests/__init__.py b/source/jormungandr/jormungandr/tests/__init__.py index f0b1d582dd..d66b2ab567 100644 --- a/source/jormungandr/jormungandr/tests/__init__.py +++ b/source/jormungandr/jormungandr/tests/__init__.py @@ -25,6 +25,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/tests/authentication_test.py b/source/jormungandr/jormungandr/tests/authentication_test.py index 20b2378b47..c37cd03aa4 100644 --- a/source/jormungandr/jormungandr/tests/authentication_test.py +++ b/source/jormungandr/jormungandr/tests/authentication_test.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/tests/instance_manager_tests.py b/source/jormungandr/jormungandr/tests/instance_manager_tests.py index 6ad45dec09..ab97cc3732 100644 --- a/source/jormungandr/jormungandr/tests/instance_manager_tests.py +++ b/source/jormungandr/jormungandr/tests/instance_manager_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/tests/instance_tests.py b/source/jormungandr/jormungandr/tests/instance_tests.py index c57d28a35b..3cf8fa8406 100644 --- a/source/jormungandr/jormungandr/tests/instance_tests.py +++ b/source/jormungandr/jormungandr/tests/instance_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/tests/utils_test.py b/source/jormungandr/jormungandr/tests/utils_test.py index 445c26107b..c3968f62b5 100644 --- a/source/jormungandr/jormungandr/tests/utils_test.py +++ b/source/jormungandr/jormungandr/tests/utils_test.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/jormungandr/timezone.py b/source/jormungandr/jormungandr/timezone.py index d9df05fdb6..f22c9ca879 100644 --- a/source/jormungandr/jormungandr/timezone.py +++ b/source/jormungandr/jormungandr/timezone.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/jormungandr/travelers_profile.py b/source/jormungandr/jormungandr/travelers_profile.py index 8d1c812d59..fb517dbbde 100644 --- a/source/jormungandr/jormungandr/travelers_profile.py +++ b/source/jormungandr/jormungandr/travelers_profile.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -36,27 +36,29 @@ ) from six.moves import map from six import text_type +from typing import Dict, Text, List, Optional class TravelerProfile(object): def __init__( self, - walking_speed=1.12, - bike_speed=3.33, - bss_speed=3.33, - car_speed=11.11, - max_duration_to_pt=None, - first_section_mode=None, - last_section_mode=None, - wheelchair=False, - first_and_last_section_mode=None, - max_walking_duration_to_pt=15 * 60, - max_bike_duration_to_pt=15 * 60, - max_bss_duration_to_pt=15 * 60, - max_car_duration_to_pt=15 * 60, - traveler_type='', - is_from_db=False, + walking_speed=1.12, # type: float + bike_speed=3.33, # type: float + bss_speed=3.33, # type: float + car_speed=11.11, # type: float + max_duration_to_pt=None, # type: Optional[int] + first_section_mode=None, # type: Optional[List[Text]] + last_section_mode=None, # type: Optional[List[Text]] + wheelchair=False, # type: bool + first_and_last_section_mode=None, # type: Optional[List[Text]] + max_walking_duration_to_pt=15 * 60, # type: int + max_bike_duration_to_pt=15 * 60, # type: int + max_bss_duration_to_pt=15 * 60, # type: int + max_car_duration_to_pt=15 * 60, # type: int + traveler_type='', # type: Text + is_from_db=False, # type: bool ): + self.walking_speed = walking_speed self.bike_speed = bike_speed self.bss_speed = bss_speed @@ -115,11 +117,12 @@ def override(pair): @memory_cache.memoize(app.config.get(str('MEMORY_CACHE_CONFIGURATION'), {}).get(str('TIMEOUT_PARAMS'), 30)) @cache.memoize(app.config.get(str('CACHE_CONFIGURATION'), {}).get(str('TIMEOUT_PARAMS'), 300)) def make_traveler_profile(cls, coverage, traveler_type): + # type: (Text, Text) -> TravelerProfile """ travelers_profile factory method, Return a traveler_profile constructed with default params or params retrieved from db """ - if app.config['DISABLE_DATABASE']: + if app.config[str('DISABLE_DATABASE')]: return default_traveler_profiles[traveler_type] # retrieve TravelerProfile from db with coverage and traveler_type @@ -146,6 +149,7 @@ def make_traveler_profile(cls, coverage, traveler_type): @classmethod def get_profiles_by_coverage(cls, coverage): + # type: (Text) -> List[TravelerProfile] traveler_profiles = [] for traveler_type in acceptable_traveler_types: profile = cls.make_traveler_profile(coverage, traveler_type) @@ -153,7 +157,7 @@ def get_profiles_by_coverage(cls, coverage): return traveler_profiles -default_traveler_profiles = {} +default_traveler_profiles = {} # type: Dict[Text, TravelerProfile] for (traveler_type_id, params) in default_traveler_profile_params.items(): - default_traveler_profiles[traveler_type_id] = TravelerProfile(is_from_db=False, **params) + default_traveler_profiles[traveler_type_id] = TravelerProfile(is_from_db=False, **params) # type: ignore diff --git a/source/jormungandr/jormungandr/utils.py b/source/jormungandr/jormungandr/utils.py index 42ded7406e..032a88603a 100644 --- a/source/jormungandr/jormungandr/utils.py +++ b/source/jormungandr/jormungandr/utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/requirements.txt b/source/jormungandr/requirements.txt index 1fe8cebaf4..1743cfcd90 100644 --- a/source/jormungandr/requirements.txt +++ b/source/jormungandr/requirements.txt @@ -32,7 +32,7 @@ future==0.15.2 zeep==1.1.0 gevent==1.3.7 Flask-Caching==1.7.2 -git+https://github.com/canaltp/serpy.git@ctp +serpy-ctp==0.2.1 python-json-logger==0.1.7 jmespath==0.9.3 shortuuid==0.5.0 diff --git a/source/jormungandr/setup.py b/source/jormungandr/setup.py index 5d06e27afe..95b443b1aa 100644 --- a/source/jormungandr/setup.py +++ b/source/jormungandr/setup.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/__init__.py b/source/jormungandr/tests/__init__.py index 238f0f8f1d..3963e631ca 100644 --- a/source/jormungandr/tests/__init__.py +++ b/source/jormungandr/tests/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/authentication_tests.py b/source/jormungandr/tests/authentication_tests.py index 1bef9fbf73..84876b03ed 100644 --- a/source/jormungandr/tests/authentication_tests.py +++ b/source/jormungandr/tests/authentication_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/autocomplete_tests.py b/source/jormungandr/tests/autocomplete_tests.py index 724004470a..ce93783559 100644 --- a/source/jormungandr/tests/autocomplete_tests.py +++ b/source/jormungandr/tests/autocomplete_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/bragi_autocomplete_tests.py b/source/jormungandr/tests/bragi_autocomplete_tests.py index 84daa53c49..aa95dc857c 100644 --- a/source/jormungandr/tests/bragi_autocomplete_tests.py +++ b/source/jormungandr/tests/bragi_autocomplete_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -705,6 +705,15 @@ def mock_bragi_autocomplete_call(bragi_response, limite=10, http_response_code=2 @dataset({'main_routing_test': MOCKED_INSTANCE_CONF}, global_config={'activate_bragi': True}) class TestBragiAutocomplete(AbstractTestFixture): + def test_autocomplete_no_json(self): + """ + """ + with requests_mock.Mocker() as m: + m.post('https://host_of_bragi/autocomplete', text="this isn't a json") + resp, status = self.query_region('places?q=bob&from=3.25;49.84', check=False) + assert status == 500 + assert m.called + def test_autocomplete_call(self): with mock_bragi_autocomplete_call(BRAGI_MOCK_RESPONSE): response = self.query_region( diff --git a/source/jormungandr/tests/calendar_tests.py b/source/jormungandr/tests/calendar_tests.py index 7e678e7fad..01b02bb374 100644 --- a/source/jormungandr/tests/calendar_tests.py +++ b/source/jormungandr/tests/calendar_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/chaos_disruptions_tests.py b/source/jormungandr/tests/chaos_disruptions_tests.py index 1ce5e176d1..78ad1bed97 100644 --- a/source/jormungandr/tests/chaos_disruptions_tests.py +++ b/source/jormungandr/tests/chaos_disruptions_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/check_utils.py b/source/jormungandr/tests/check_utils.py index 4c06f5a12d..ab7b90f612 100644 --- a/source/jormungandr/tests/check_utils.py +++ b/source/jormungandr/tests/check_utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/coverage_tests.py b/source/jormungandr/tests/coverage_tests.py index 25512f954d..5f3ef2500e 100644 --- a/source/jormungandr/tests/coverage_tests.py +++ b/source/jormungandr/tests/coverage_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/departure_board_tests.py b/source/jormungandr/tests/departure_board_tests.py index 0312e6694a..047c0b5730 100644 --- a/source/jormungandr/tests/departure_board_tests.py +++ b/source/jormungandr/tests/departure_board_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division @@ -931,6 +931,42 @@ def test_departure(self): assert not [l for l in response.get('links') if l.get('rel') == 'next'] self.check_departure_rt_sol(departures) + def test_departures_with_direction_type(self): + """ + Test direction type parameter for filtering departures response + data contains : + - route A (direction type = forward) + * 3 departures on stop uri : S1 + - route B (direction type = backward) + * 1 departure on stop uri : S1 + """ + + # Without direction type parameter + response = self.query_region("stop_points/S1/departures?_current_datetime=20160101T080000") + assert "departures" in response + assert len(response["departures"]) == 4 + + # With direction type = all (same as without direction type parameter) + response = self.query_region( + "stop_points/S1/departures?direction_type=all&_current_datetime=20160101T080000" + ) + assert "departures" in response + assert len(response["departures"]) == 4 + + # With direction type = forward + response = self.query_region( + "stop_points/S1/departures?direction_type=forward&_current_datetime=20160101T080000" + ) + assert "departures" in response + assert len(response["departures"]) == 3 + + # With direction type = backward + response = self.query_region( + "stop_points/S1/departures?direction_type=backward&_current_datetime=20160101T080000" + ) + assert "departures" in response + assert len(response["departures"]) == 1 + def test_departure_base_sched(self): """ test a departure, no date time and base schedule, we should get base schedule diff --git a/source/jormungandr/tests/direct_path_asgard_integration_tests.py b/source/jormungandr/tests/direct_path_asgard_integration_tests.py index b024c897ed..29f3f5f0ed 100644 --- a/source/jormungandr/tests/direct_path_asgard_integration_tests.py +++ b/source/jormungandr/tests/direct_path_asgard_integration_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/direct_path_parking_with_asgard_integration_tests.py b/source/jormungandr/tests/direct_path_parking_with_asgard_integration_tests.py index 2946d9a63b..f5415b22c8 100644 --- a/source/jormungandr/tests/direct_path_parking_with_asgard_integration_tests.py +++ b/source/jormungandr/tests/direct_path_parking_with_asgard_integration_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/direct_path_valhalla_integration_tests.py b/source/jormungandr/tests/direct_path_valhalla_integration_tests.py index 254afac6e6..64307d10bb 100644 --- a/source/jormungandr/tests/direct_path_valhalla_integration_tests.py +++ b/source/jormungandr/tests/direct_path_valhalla_integration_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/disruptions_tests.py b/source/jormungandr/tests/disruptions_tests.py index 1fd891f2a3..2425c57997 100644 --- a/source/jormungandr/tests/disruptions_tests.py +++ b/source/jormungandr/tests/disruptions_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/end_point_tests.py b/source/jormungandr/tests/end_point_tests.py index 9b921d877c..bc74a6ce7f 100644 --- a/source/jormungandr/tests/end_point_tests.py +++ b/source/jormungandr/tests/end_point_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/equipment_mock.py b/source/jormungandr/tests/equipment_mock.py index 8e65ff0142..565c8299a4 100644 --- a/source/jormungandr/tests/equipment_mock.py +++ b/source/jormungandr/tests/equipment_mock.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/equipment_tests.py b/source/jormungandr/tests/equipment_tests.py index 469e44175c..bb4cc0bd28 100644 --- a/source/jormungandr/tests/equipment_tests.py +++ b/source/jormungandr/tests/equipment_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/graphical_isochrones_tests.py b/source/jormungandr/tests/graphical_isochrones_tests.py index 265e4d1fb4..e3ac807642 100644 --- a/source/jormungandr/tests/graphical_isochrones_tests.py +++ b/source/jormungandr/tests/graphical_isochrones_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/heat_maps_tests.py b/source/jormungandr/tests/heat_maps_tests.py index 728e9d6590..206f294f79 100644 --- a/source/jormungandr/tests/heat_maps_tests.py +++ b/source/jormungandr/tests/heat_maps_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/here_distributed_routing_tests.py b/source/jormungandr/tests/here_distributed_routing_tests.py index 761570bc9c..7e53b6a868 100644 --- a/source/jormungandr/tests/here_distributed_routing_tests.py +++ b/source/jormungandr/tests/here_distributed_routing_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/instant_system_new_default_routing_tests.py b/source/jormungandr/tests/instant_system_new_default_routing_tests.py index 80ac2e1d04..b2e035971d 100644 --- a/source/jormungandr/tests/instant_system_new_default_routing_tests.py +++ b/source/jormungandr/tests/instant_system_new_default_routing_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/integration_tests_settings.py b/source/jormungandr/tests/integration_tests_settings.py index 9e442e1df4..61a4a5d041 100644 --- a/source/jormungandr/tests/integration_tests_settings.py +++ b/source/jormungandr/tests/integration_tests_settings.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/tests/isochrone_tests.py b/source/jormungandr/tests/isochrone_tests.py index 4a911defa0..64e1070a86 100644 --- a/source/jormungandr/tests/isochrone_tests.py +++ b/source/jormungandr/tests/isochrone_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/journey_common_tests.py b/source/jormungandr/tests/journey_common_tests.py index 3dbde23d1f..296040d5e2 100644 --- a/source/jormungandr/tests/journey_common_tests.py +++ b/source/jormungandr/tests/journey_common_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -1218,18 +1218,6 @@ def test_journeys_too_short_heavy_mode_fallback_filter(self): assert 'deleted_because_too_short_heavy_mode_fallback' in car_fallback_pt_journey['tags'] - def test_journey_ticket(self): - """ - Test that the ticket info are correctly serialized in the response - """ - query = "journeys?from=stop_point:stopB&to=stop_point:stopA&datetime=20120614080101&" - response = self.query_region(query) - - assert len(response['tickets']) == 1 - assert response['tickets'][0]['name'] == 'M-Ticket name' - assert response['tickets'][0]['source_id'] == 'M-Ticket' - assert response['tickets'][0]['comment'] == 'This is M-Ticket' - @dataset({"main_stif_test": {}}) class AddErrorFieldInJormun(object): @@ -2291,3 +2279,130 @@ def test_direct_path_mode_bike_and_direct_path_mode_none(self): assert len(response["journeys"]) == 1 assert "walking" in response["journeys"][0]["tags"] assert "non_pt" not in response["journeys"][0]["tags"] + + +@dataset({"min_nb_journeys_test": {}}) +class JourneysTickets: + def test_journey_tickets(self): + """ + 2 solutions are found with 1 ticket for each journey + """ + query = 'journeys?from=2.39592;48.84838&to=2.36381;48.86750&datetime=20180309T080000' + response = self.query_region(query) + self.is_valid_journey_response(response, query) + + # Journeys + assert len(response['journeys']) == 2 + assert 'fare' in response['journeys'][0] + assert response['journeys'][0]['fare']['total']['value'] == '120.0' + assert response['journeys'][0]['fare']['total']['currency'] == 'euro' + assert len(response['journeys'][0]['fare']['links']) == 1 + assert 'fare' in response['journeys'][1] + assert response['journeys'][1]['fare']['total']['value'] == '100.0' + assert response['journeys'][1]['fare']['total']['currency'] == 'euro' + assert len(response['journeys'][1]['fare']['links']) == 1 + + # Tickets + assert len(response['tickets']) == 2 + assert response['tickets'][0]['name'] == 'A-Ticket name' + assert response['tickets'][0]['source_id'] == 'A-Ticket' + assert response['tickets'][0]['comment'] == 'A-Ticket comment' + assert response['tickets'][1]['name'] == 'B-Ticket name' + assert response['tickets'][1]['source_id'] == 'B-Ticket' + assert response['tickets'][1]['comment'] == 'B-Ticket comment' + + # Links between journeys.fare and journeys.tickets + assert response['tickets'][0]['id'] == response['journeys'][1]['fare']['links'][0]['id'] + assert response['tickets'][1]['id'] == response['journeys'][0]['fare']['links'][0]['id'] + + def test_journey_tickets_with_max_nb_journeys(self): + """ + 2 solutions found, but with max_nb_journeys option, only 1 journey remains. + Check there is only one ticket. + The max_nb_journeys option forces filtering of one journey and the associated ticket too + """ + query = 'journeys?from=2.39592;48.84838&to=2.36381;48.86750&datetime=20180309T080000&max_nb_journeys=1' + response = self.query_region(query) + self.is_valid_journey_response(response, query) + + # Journeys + assert len(response['journeys']) == 1 + assert 'fare' in response['journeys'][0] + assert response['journeys'][0]['fare']['total']['value'] == '120.0' + assert response['journeys'][0]['fare']['total']['currency'] == 'euro' + assert len(response['journeys'][0]['fare']['links']) == 1 + + # Tickets + assert len(response['tickets']) == 1 + assert response['tickets'][0]['name'] == 'B-Ticket name' + assert response['tickets'][0]['source_id'] == 'B-Ticket' + assert response['tickets'][0]['comment'] == 'B-Ticket comment' + + # Links between journeys.fare and journeys.tickets + assert response['tickets'][0]['id'] == response['journeys'][0]['fare']['links'][0]['id'] + + +@dataset({"main_stif_test": {}}) +class JourneysTicketsWithDebug: + def test_journey_tickets_with_debug_true(self): + """ + Line P Line Q Line R Line S + P-Ticket Q-Ticket R-Ticket S-Ticket + stopP -------> stopQ -------> stopR -------> stopS -------> stopT + 15:00 16:00 17:00 18:00 19:00 + + Line T + T-Ticket + stopP ----------------------------------------------------> stopT + 15:00 20:00 + Goal : Test if tickets work correctly with the debug option + """ + # debug = false + # Tickets have to be filtered like journeys + query = "journeys?from=stopP&to=stopT&datetime=20140614T145500&" "_max_successive_physical_mode=3" + response = self.query_region(query) + + # Journeys + assert len(response['journeys']) == 1 + assert 'fare' in response['journeys'][0] + assert response['journeys'][0]['fare']['total']['value'] == '99.0' + assert response['journeys'][0]['fare']['total']['currency'] == 'euro' + assert len(response['journeys'][0]['fare']['links']) == 1 + + # Tickets + assert len(response['tickets']) == 1 + assert response['tickets'][0]['source_id'] == 'T-Ticket' + + # Links between journeys.fare and journeys.tickets + assert response['tickets'][0]['id'] == response['journeys'][0]['fare']['links'][0]['id'] + + # debug = true + # All solutions are retreived with their associated tickets + query = ( + "journeys?from=stopP&to=stopT&datetime=20140614T145500&" "_max_successive_physical_mode=3&debug=true" + ) + response = self.query_region(query) + + # Journeys + assert len(response['journeys']) == 2 + assert response['journeys'][0]['fare']['total']['value'] == '400.0' + assert response['journeys'][0]['fare']['total']['currency'] == 'euro' + assert len(response['journeys'][0]['fare']['links']) == 4 + assert response['journeys'][1]['fare']['total']['value'] == '99.0' + assert response['journeys'][1]['fare']['total']['currency'] == 'euro' + assert len(response['journeys'][1]['fare']['links']) == 1 + + # Tickets + assert len(response['tickets']) == 5 + assert response['tickets'][0]['source_id'] == 'P-Ticket' + assert response['tickets'][1]['source_id'] == 'Q-Ticket' + assert response['tickets'][2]['source_id'] == 'R-Ticket' + assert response['tickets'][3]['source_id'] == 'S-Ticket' + assert response['tickets'][4]['source_id'] == 'T-Ticket' + + # Links between journeys.fare and journeys.tickets + assert response['tickets'][0]['id'] == response['journeys'][0]['fare']['links'][0]['id'] + assert response['tickets'][1]['id'] == response['journeys'][0]['fare']['links'][1]['id'] + assert response['tickets'][2]['id'] == response['journeys'][0]['fare']['links'][2]['id'] + assert response['tickets'][3]['id'] == response['journeys'][0]['fare']['links'][3]['id'] + assert response['tickets'][4]['id'] == response['journeys'][1]['fare']['links'][0]['id'] diff --git a/source/jormungandr/tests/kirin_realtime_tests.py b/source/jormungandr/tests/kirin_realtime_tests.py index cf818d0cfc..8fb0d1478c 100644 --- a/source/jormungandr/tests/kirin_realtime_tests.py +++ b/source/jormungandr/tests/kirin_realtime_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/line_sections_tests.py b/source/jormungandr/tests/line_sections_tests.py index 9ded1ec3e8..a7dccab668 100644 --- a/source/jormungandr/tests/line_sections_tests.py +++ b/source/jormungandr/tests/line_sections_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/no_stats_tests.py b/source/jormungandr/tests/no_stats_tests.py index 893b921bae..0cd85f788f 100644 --- a/source/jormungandr/tests/no_stats_tests.py +++ b/source/jormungandr/tests/no_stats_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/overlapping_routing_tests.py b/source/jormungandr/tests/overlapping_routing_tests.py index 351cd6b092..8756fff8b9 100644 --- a/source/jormungandr/tests/overlapping_routing_tests.py +++ b/source/jormungandr/tests/overlapping_routing_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/parking_places_provider_tests.py b/source/jormungandr/tests/parking_places_provider_tests.py index 68f0bb0af0..afac9815ce 100644 --- a/source/jormungandr/tests/parking_places_provider_tests.py +++ b/source/jormungandr/tests/parking_places_provider_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import diff --git a/source/jormungandr/tests/places_tests.py b/source/jormungandr/tests/places_tests.py index 86ce56e76e..1af73fd0ed 100644 --- a/source/jormungandr/tests/places_tests.py +++ b/source/jormungandr/tests/places_tests.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division @@ -129,6 +129,52 @@ def test_places_nearby_with_coords_without_region_and_type(self): for place in places_nearby: assert place["embedded_type"] == "stop_area" + def test_places_nearby_with_coords_with_type_and_pagination(self): + """check the pagination""" + + query = "/v1/coords/0.000001;0.000898311281954/places_nearby?type[]=stop_point&count=1" + response = self.query(query) + assert response['pagination']['total_result'] == 4 + places_nearby = response['places_nearby'] + assert len(places_nearby) == 1 + is_valid_places(places_nearby) + assert places_nearby[0]["embedded_type"] == "stop_point" + assert places_nearby[0]["id"] == "stop_point:stopB" + + response = self.query(query + "&start_page=1") + assert response['pagination']['total_result'] == 4 + places_nearby = response['places_nearby'] + assert len(places_nearby) == 1 + is_valid_places(places_nearby) + assert places_nearby[0]["embedded_type"] == "stop_point" + assert places_nearby[0]["id"] == "stop_point:stopC" + + def test_places_nearby_with_coords_with_type_filter_and_count(self): + """ + check places_nearby with /coords and type[]=stop_point, filter=line.uri=D, count=1 + + from the coord, you can find: + + stop_B -> 70m + stop_C -> 72m ( <- it's the stop_point that we are expecting with filter=line.uri=D) + stop_A -> 121m + stop_uselessA -> 121m + """ + query = "/v1/coords/0.000001;0.000898311281954/places_nearby?type[]=stop_point&count=1" + response = self.query(query) + places_nearby = response['places_nearby'] + assert len(places_nearby) == 1 + is_valid_places(places_nearby) + assert places_nearby[0]["embedded_type"] == "stop_point" + assert places_nearby[0]["id"] == "stop_point:stopB" + + response = self.query(query + "&filter=line.uri=D") + places_nearby = response['places_nearby'] + assert len(places_nearby) == 1 + is_valid_places(places_nearby) + assert places_nearby[0]["embedded_type"] == "stop_point" + assert places_nearby[0]["id"] == "stop_point:stopC" + def test_places_nearby_with_coords_current_datetime(self): """places_nearby with _current_datetime""" diff --git a/source/jormungandr/tests/proxy_realtime_cleverage_integration_tests.py b/source/jormungandr/tests/proxy_realtime_cleverage_integration_tests.py index 5d01b65285..536ce8a902 100644 --- a/source/jormungandr/tests/proxy_realtime_cleverage_integration_tests.py +++ b/source/jormungandr/tests/proxy_realtime_cleverage_integration_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/proxy_realtime_sirilite_integration_tests.py b/source/jormungandr/tests/proxy_realtime_sirilite_integration_tests.py index 78f3061068..d49c833eb2 100644 --- a/source/jormungandr/tests/proxy_realtime_sirilite_integration_tests.py +++ b/source/jormungandr/tests/proxy_realtime_sirilite_integration_tests.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/proxy_realtime_synthese_integration_tests.py b/source/jormungandr/tests/proxy_realtime_synthese_integration_tests.py index 16758e82ec..9654ddc6ae 100644 --- a/source/jormungandr/tests/proxy_realtime_synthese_integration_tests.py +++ b/source/jormungandr/tests/proxy_realtime_synthese_integration_tests.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/proxy_realtime_sytral_integration_tests.py b/source/jormungandr/tests/proxy_realtime_sytral_integration_tests.py index e79a6f1a90..bb3f4ab7e8 100644 --- a/source/jormungandr/tests/proxy_realtime_sytral_integration_tests.py +++ b/source/jormungandr/tests/proxy_realtime_sytral_integration_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/proxy_realtime_tests.py b/source/jormungandr/tests/proxy_realtime_tests.py index 3336570f2e..61cf95b735 100644 --- a/source/jormungandr/tests/proxy_realtime_tests.py +++ b/source/jormungandr/tests/proxy_realtime_tests.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -138,7 +138,7 @@ def test_stop_schedule_stop_point_has_no_rt(self): response = self.query_region(query) stop_schedule_A = response['stop_schedules'][0] - assert stop_schedule_A['route']['name'] == 'A' + assert stop_schedule_A['route']['name'] == 'A:0' next_passage_dts = [dt["date_time"] for dt in stop_schedule_A['date_times']] next_passage_base_dts = [dt["base_date_time"] for dt in stop_schedule_A['date_times']] values = ['20160102T110000', '20160103T090000', '20160103T100000'] @@ -149,7 +149,7 @@ def test_stop_schedule_stop_point_has_no_rt(self): assert dt['data_freshness'] == 'base_schedule' stop_schedule_B = response['stop_schedules'][1] - assert stop_schedule_B['route']['name'] == 'B' + assert stop_schedule_B['route']['name'] == 'B:1' next_passage_dts = [dt["date_time"] for dt in stop_schedule_B['date_times']] assert ['20160102T113000'] == next_passage_dts diff --git a/source/jormungandr/tests/proxy_realtime_timeo_integration_tests.py b/source/jormungandr/tests/proxy_realtime_timeo_integration_tests.py index a936d30229..175b47d30c 100644 --- a/source/jormungandr/tests/proxy_realtime_timeo_integration_tests.py +++ b/source/jormungandr/tests/proxy_realtime_timeo_integration_tests.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/ptref_tests.py b/source/jormungandr/tests/ptref_tests.py index e0ca80d797..1bb3b78481 100644 --- a/source/jormungandr/tests/ptref_tests.py +++ b/source/jormungandr/tests/ptref_tests.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/rabbitmq_utils.py b/source/jormungandr/tests/rabbitmq_utils.py index b00bda191c..3756c97416 100644 --- a/source/jormungandr/tests/rabbitmq_utils.py +++ b/source/jormungandr/tests/rabbitmq_utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/routing_tests_experimental.py b/source/jormungandr/tests/routing_tests_experimental.py index b0616e50d0..d9e9e10efc 100644 --- a/source/jormungandr/tests/routing_tests_experimental.py +++ b/source/jormungandr/tests/routing_tests_experimental.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -313,6 +313,16 @@ class TestDistributedTimeFrameDuration(JourneysTimeFrameDuration, NewDefaultScen pass +@config({"scenario": "distributed"}) +class TestDistributedJourneyTickets(JourneysTickets, NewDefaultScenarioAbstractTestFixture): + pass + + +@config({"scenario": "distributed"}) +class TestDistributedJourneyTicketsWithDebug(JourneysTicketsWithDebug, NewDefaultScenarioAbstractTestFixture): + pass + + def _make_function_over_upper_limit(from_coord, to_coord, mode, op): def test_ko_direct_path_longer_than_max_mode_direct_path_duration(self): query = ( diff --git a/source/jormungandr/tests/routing_tests_new_default.py b/source/jormungandr/tests/routing_tests_new_default.py index 3f71e33a20..9209e4cae1 100644 --- a/source/jormungandr/tests/routing_tests_new_default.py +++ b/source/jormungandr/tests/routing_tests_new_default.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division @@ -408,6 +408,16 @@ class TestNewDefaultTimeFrameDuration(JourneysTimeFrameDuration, NewDefaultScena pass +@config({"scenario": "new_default"}) +class TestNewDefaultJourneyTickets(JourneysTickets, NewDefaultScenarioAbstractTestFixture): + pass + + +@config({"scenario": "new_default"}) +class TestNewDefaultJourneyTicketsWithDebug(JourneysTicketsWithDebug, NewDefaultScenarioAbstractTestFixture): + pass + + @dataset({"main_routing_test": {"scenario": "new_default"}}) class TestTaxiNewDefault(NewDefaultScenarioAbstractTestFixture): def test_taxi_with_new_default(self): diff --git a/source/jormungandr/tests/schema_tests.py b/source/jormungandr/tests/schema_tests.py index 1a372b35dd..d1cafec4f1 100644 --- a/source/jormungandr/tests/schema_tests.py +++ b/source/jormungandr/tests/schema_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/stats_tests.py b/source/jormungandr/tests/stats_tests.py index 1fe5dcd819..a2b3c3eac1 100644 --- a/source/jormungandr/tests/stats_tests.py +++ b/source/jormungandr/tests/stats_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/jormungandr/tests/stif_tests.py b/source/jormungandr/tests/stif_tests.py index 85bb887ec3..df5476e33f 100644 --- a/source/jormungandr/tests/stif_tests.py +++ b/source/jormungandr/tests/stif_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -171,8 +171,8 @@ def test_stif_max_successive_buses_with_tram_in_between(self): response = self.query_region(query) assert len(response['journeys']) == 2 - # As we modify the value of _max_additional_connections to 2 we delete the second journey because - # it contains more then nb_connections + 2 () + # As we modify the value of _max_additional_connections to 2 + # since the best journey is the one with 6 connexions, we will find 2 journeys query = ( "journeys?from={from_sp}&to={to_sp}&datetime={datetime}&_override_scenario=new_default" "&_max_successive_physical_mode=5&_max_additional_connections=2".format( @@ -181,4 +181,4 @@ def test_stif_max_successive_buses_with_tram_in_between(self): ) response = self.query_region(query) - assert len(response['journeys']) == 1 + assert len(response['journeys']) == 2 diff --git a/source/jormungandr/tests/tests_mechanism.py b/source/jormungandr/tests/tests_mechanism.py index 199b5e2434..5068e57ee5 100644 --- a/source/jormungandr/tests/tests_mechanism.py +++ b/source/jormungandr/tests/tests_mechanism.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -375,8 +375,7 @@ def is_valid_journey_response(self, response, query_str, check_journey_links=Tru is_valid_ticket(f, self.tester) all_tickets[f['id']] = f - # TODO: Implement NAVP-974 to handle tickets-sections internal links - # check_internal_links(response, self.tester) + check_internal_links(response, self.tester) # check other links if check_journey_links: diff --git a/source/jormungandr/tests/timezone_cape_verde_tests.py b/source/jormungandr/tests/timezone_cape_verde_tests.py index 96a053d0d8..b7c618a4e2 100644 --- a/source/jormungandr/tests/timezone_cape_verde_tests.py +++ b/source/jormungandr/tests/timezone_cape_verde_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from __future__ import absolute_import, print_function, unicode_literals, division diff --git a/source/jormungandr/tests/traveler_profile_tests.py b/source/jormungandr/tests/traveler_profile_tests.py index bcb5be965f..567933a1fa 100644 --- a/source/jormungandr/tests/traveler_profile_tests.py +++ b/source/jormungandr/tests/traveler_profile_tests.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/kraken/apply_disruption.cpp b/source/kraken/apply_disruption.cpp index 0cd834d8da..05225e33d8 100644 --- a/source/kraken/apply_disruption.cpp +++ b/source/kraken/apply_disruption.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -364,11 +364,13 @@ struct add_impacts_visitor : public apply_impacts_visitor { std::vector new_stop_times; const auto* vj = impacted_vj.vj; auto& new_vp = impacted_vj.new_vp; - const auto& stop_points_section = impacted_vj.impacted_stops; for (const auto& st : vj->stop_time_list) { + // We need to get the associated base stop_time to compare its rank + const auto base_st = st.get_base_stop_time(); // stop is ignored if its stop_point is not in impacted_stops - if (stop_points_section.count(st.stop_point)) { + // if we don't find an associated base we keep it + if (base_st && impacted_vj.impacted_ranks.count(base_st->order())) { LOG4CPLUS_TRACE(log, "Ignoring stop " << st.stop_point->uri << "on " << vj->uri); continue; } @@ -565,10 +567,11 @@ struct add_impacts_visitor : public apply_impacts_visitor { static bool is_modifying_effect(nt::disruption::Effect e) { // check if the effect needs to modify the model - return in(e, {nt::disruption::Effect::NO_SERVICE, nt::disruption::Effect::UNKNOWN_EFFECT, - nt::disruption::Effect::SIGNIFICANT_DELAYS, nt::disruption::Effect::MODIFIED_SERVICE, - nt::disruption::Effect::DETOUR, nt::disruption::Effect::REDUCED_SERVICE, - nt::disruption::Effect::ADDITIONAL_SERVICE}); + return contains({nt::disruption::Effect::NO_SERVICE, nt::disruption::Effect::UNKNOWN_EFFECT, + nt::disruption::Effect::SIGNIFICANT_DELAYS, nt::disruption::Effect::MODIFIED_SERVICE, + nt::disruption::Effect::DETOUR, nt::disruption::Effect::REDUCED_SERVICE, + nt::disruption::Effect::ADDITIONAL_SERVICE}, + e); } void apply_impact(boost::shared_ptr impact, nt::PT_Data& pt_data, const nt::MetaData& meta) { diff --git a/source/kraken/apply_disruption.h b/source/kraken/apply_disruption.h index 618d75d72f..f23b50f43b 100644 --- a/source/kraken/apply_disruption.h +++ b/source/kraken/apply_disruption.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/configuration.cpp b/source/kraken/configuration.cpp index edf3ac8573..971b11dbc2 100644 --- a/source/kraken/configuration.cpp +++ b/source/kraken/configuration.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/configuration.h b/source/kraken/configuration.h index 858e86cec9..c281f93be1 100644 --- a/source/kraken/configuration.h +++ b/source/kraken/configuration.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/data_manager.h b/source/kraken/data_manager.h index 2f6569e95c..6f8aa9e3e1 100644 --- a/source/kraken/data_manager.h +++ b/source/kraken/data_manager.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/fill_disruption_from_database.cpp b/source/kraken/fill_disruption_from_database.cpp index 66142106de..aae30d5353 100644 --- a/source/kraken/fill_disruption_from_database.cpp +++ b/source/kraken/fill_disruption_from_database.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/fill_disruption_from_database.h b/source/kraken/fill_disruption_from_database.h index 1d446af72c..d3b2c9194a 100644 --- a/source/kraken/fill_disruption_from_database.h +++ b/source/kraken/fill_disruption_from_database.h @@ -24,7 +24,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/kraken_zmq.cpp b/source/kraken/kraken_zmq.cpp index 2495115be3..88db893605 100644 --- a/source/kraken/kraken_zmq.cpp +++ b/source/kraken/kraken_zmq.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/kraken_zmq.h b/source/kraken/kraken_zmq.h index dc452fc47f..dddb329b76 100644 --- a/source/kraken/kraken_zmq.h +++ b/source/kraken/kraken_zmq.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/maintenance_worker.cpp b/source/kraken/maintenance_worker.cpp index 8c2fed4ab8..5ec98b31a3 100644 --- a/source/kraken/maintenance_worker.cpp +++ b/source/kraken/maintenance_worker.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/maintenance_worker.h b/source/kraken/maintenance_worker.h index aea8153c66..9970ac7bc4 100644 --- a/source/kraken/maintenance_worker.h +++ b/source/kraken/maintenance_worker.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/make_disruption_from_chaos.cpp b/source/kraken/make_disruption_from_chaos.cpp index 91a17469c0..2f6a3b8823 100644 --- a/source/kraken/make_disruption_from_chaos.cpp +++ b/source/kraken/make_disruption_from_chaos.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/make_disruption_from_chaos.h b/source/kraken/make_disruption_from_chaos.h index 41ee1a27f5..830c339256 100644 --- a/source/kraken/make_disruption_from_chaos.h +++ b/source/kraken/make_disruption_from_chaos.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/metrics.cpp b/source/kraken/metrics.cpp index e65bc35f41..7eed0f81c9 100644 --- a/source/kraken/metrics.cpp +++ b/source/kraken/metrics.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/metrics.h b/source/kraken/metrics.h index 4852e768ce..c3a2feb864 100644 --- a/source/kraken/metrics.h +++ b/source/kraken/metrics.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/realtime.cpp b/source/kraken/realtime.cpp index 5d77af18ae..cfd4aa3a4f 100644 --- a/source/kraken/realtime.cpp +++ b/source/kraken/realtime.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -105,8 +105,8 @@ static bool is_circulating_trip(const transit_realtime::TripUpdate& trip_update) static bool is_deleted(const transit_realtime::TripUpdate_StopTimeEvent& event) { if (event.HasExtension(kirin::stop_time_event_status)) { - return in(event.GetExtension(kirin::stop_time_event_status), - {kirin::StopTimeEventStatus::DELETED, kirin::StopTimeEventStatus::DELETED_FOR_DETOUR}); + return contains({kirin::StopTimeEventStatus::DELETED, kirin::StopTimeEventStatus::DELETED_FOR_DETOUR}, + event.GetExtension(kirin::stop_time_event_status)); } else { return false; } @@ -161,8 +161,8 @@ static bool check_disruption(const nt::disruption::Disruption& disruption) { for (const auto& stu : impact->aux_info.stop_times) { const auto& st = stu.stop_time; - bool arr_deleted = - in(stu.arrival_status, {StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR}); + bool arr_deleted = contains({StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR}, + stu.arrival_status); if (!arr_deleted) { if (last_stop_event_time > st.arrival_time) { LOG4CPLUS_WARN(log, "stop time " << st << " is not correctly ordered regarding arrival"); @@ -170,8 +170,8 @@ static bool check_disruption(const nt::disruption::Disruption& disruption) { } last_stop_event_time = st.arrival_time; } - bool dep_deleted = - in(stu.departure_status, {StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR}); + bool dep_deleted = contains({StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR}, + stu.departure_status); if (!dep_deleted) { if (last_stop_event_time > st.departure_time) { LOG4CPLUS_WARN(log, "stop time " << st << " is not correctly ordered regarding departure"); @@ -303,10 +303,10 @@ static bool is_added_stop_time(const transit_realtime::TripUpdate& trip_update) if (trip_update.stop_time_update_size()) { for (const auto& st : trip_update.stop_time_update()) { // adding a stop_time event (adding departure or/and arrival) is adding service - if (in(get_status(st.departure(), st), - {StopTimeUpdate::Status::ADDED, StopTimeUpdate::Status::ADDED_FOR_DETOUR}) - || in(get_status(st.arrival(), st), - {StopTimeUpdate::Status::ADDED, StopTimeUpdate::Status::ADDED_FOR_DETOUR})) { + if (contains({StopTimeUpdate::Status::ADDED, StopTimeUpdate::Status::ADDED_FOR_DETOUR}, + get_status(st.departure(), st)) + || contains({StopTimeUpdate::Status::ADDED, StopTimeUpdate::Status::ADDED_FOR_DETOUR}, + get_status(st.arrival(), st))) { LOG4CPLUS_TRACE(log, "Disruption has ADDED stop_time event"); return true; } @@ -581,14 +581,15 @@ static const type::disruption::Disruption* create_disruption(const std::string& // for deleted stoptime departure (resp. arrival), we disable pickup (resp. drop_off) // but we keep the departure/arrival to be able to match the stoptime to it's base stoptime - if (in(arrival_status, {StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR})) { + if (contains({StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR}, + arrival_status)) { stop_time.set_drop_off_allowed(false); } else { stop_time.set_drop_off_allowed(st.arrival().has_time()); } - if (in(departure_status, - {StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR})) { + if (contains({StopTimeUpdate::Status::DELETED, StopTimeUpdate::Status::DELETED_FOR_DETOUR}, + departure_status)) { stop_time.set_pick_up_allowed(false); } else { stop_time.set_pick_up_allowed(st.departure().has_time()); diff --git a/source/kraken/realtime.h b/source/kraken/realtime.h index 7b3c52227e..e0f445be16 100644 --- a/source/kraken/realtime.h +++ b/source/kraken/realtime.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/apply_disruption_test.cpp b/source/kraken/tests/apply_disruption_test.cpp index 86ec301ffc..7e78d2c7aa 100644 --- a/source/kraken/tests/apply_disruption_test.cpp +++ b/source/kraken/tests/apply_disruption_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -1438,7 +1438,7 @@ BOOST_AUTO_TEST_CASE(add_impact_on_line_section_cancelling_vj) { /* * In case we have a pretty complex line with repeated stops, since a line_section is only defined by - * a line, two stop areas and an optional list of routes, we're impacting the longest section possible for each + * a line, two stop areas and an optional list of routes, we're impacting the shortest sections possible for each * route. Let's take a look at the line A below, with 4 routes, all departing from s1 and ending at s6. * * 1st route s1/s2/s3/s2/s3/s4/s5/s4/s5/s6 : @@ -1563,9 +1563,14 @@ BOOST_AUTO_TEST_CASE(add_line_section_impact_on_line_with_repeated_stops) { base_vp = vj->base_validity_pattern()->days; BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "111111"), adapted_vp); BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "000000"), base_vp); - BOOST_REQUIRE_EQUAL(vj->stop_time_list.size(), 2); - BOOST_REQUIRE_EQUAL(vj->stop_time_list.front().stop_point->uri, "s1"); - BOOST_REQUIRE_EQUAL(vj->stop_time_list.back().stop_point->uri, "s6"); + // 6 stop_times since we don't impact the first iteration of each loop + BOOST_REQUIRE_EQUAL(vj->stop_time_list.size(), 6); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(0).stop_point->uri, "s1"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(1).stop_point->uri, "s2"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(2).stop_point->uri, "s3"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(3).stop_point->uri, "s4"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(4).stop_point->uri, "s5"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(5).stop_point->uri, "s6"); vj = b.get("vehicle_journey:vj:2:Adapted:0:line_section_sa1_sa5_routesA1-2-3"); BOOST_CHECK_EQUAL(vj->meta_vj->get_impacts().size(), 1); @@ -2326,3 +2331,219 @@ BOOST_AUTO_TEST_CASE(update_disruption_with_multiple_impact_on_different_vj) { BOOST_REQUIRE_EQUAL(b.data->pt_data->vehicle_journeys_map.at("vehicle_journey:vj:1")->get_impacts().size(), 0); BOOST_REQUIRE_EQUAL(b.data->pt_data->vehicle_journeys_map.at("vehicle_journey:vj:2")->get_impacts().size(), 0); } + +/* + * The real life use case associated with this test is when we have a line ending + * with two stop_points in the same stop_area (mainly we have a drop off stop and + * a different parking stop just after). + * + * Route : + * + * sp:10 ---> sp:20 ---> sp:30 ---> sp:31 ---> sp:40 ---> sp:50 ---> sp:51 + * + * Each sp: are in the corresponding stop_area sa:. + * + * If we a have a line_section impacting sa:3 to sa:5 we need to impact sp:30 to sp:51. + * Even if we work on the shortest line_section the section is defined by stop_areas. + */ +BOOST_AUTO_TEST_CASE(add_impact_on_line_section_with_successive_stop_in_same_area) { + ed::builder b("20190901"); + b.sa("stop_area:1", 0, 0, false, true)("stop_point:10"); + b.sa("stop_area:2", 0, 0, false, true)("stop_point:20"); + b.sa("stop_area:3", 0, 0, false, true)("stop_point:30")("stop_point:31"); + b.sa("stop_area:4", 0, 0, false, true)("stop_point:40"); + b.sa("stop_area:5", 0, 0, false, true)("stop_point:50")("stop_point:51"); + + b.vj("line:A", "111111", "", true, "vj:1")("stop_point:10", "08:10"_t, "08:11"_t)( + "stop_point:20", "08:20"_t, "08:21"_t)("stop_point:30", "08:30"_t, "08:31"_t)( + "stop_point:31", "08:31"_t, "08:32"_t)("stop_point:40", "08:40"_t, "08:41"_t)( + "stop_point:50", "08:50"_t, "08:51"_t)("stop_point:51", "08:51"_t, "08:52"_t); + + b.make(); + b.data->meta->production_date = bg::date_period(bg::date(2019, 9, 1), bg::days(7)); + + navitia::apply_disruption(b.impact(nt::RTLevel::Adapted, "line_section_on_line:A_diverted") + .severity(nt::disruption::Effect::NO_SERVICE) + .application_periods(btp("20190901T120000"_dt, "20190910T090000"_dt)) + .on_line_section("line:A", "stop_area:3", "stop_area:5", {"line:A:0"}) + .get_disruption(), + *b.data->pt_data, *b.data->meta); + + BOOST_REQUIRE_EQUAL(b.data->pt_data->lines.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->routes.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->vehicle_journeys.size(), 2); + + // Check the original vj + auto* vj = b.get("vehicle_journey:vj:1"); + auto adapted_vp = vj->adapted_validity_pattern()->days; + auto base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "000001"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "111111"), base_vp); + + // Check the adapted vj + vj = b.get("vehicle_journey:vj:1:Adapted:0:line_section_on_line:A_diverted"); + adapted_vp = vj->adapted_validity_pattern()->days; + base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "111110"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "000000"), base_vp); + // The adapted vj should have only 2 stop_times + BOOST_REQUIRE_EQUAL(vj->stop_time_list.size(), 2); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.front().stop_point->uri, "stop_point:10"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.back().stop_point->uri, "stop_point:20"); +} + +/* + * When we have a vj A/B/C/B/D : + * + * D + * ^ + * | + * | + * A -----------> B -----------> C + * | | + * | | + * '--------------' + * + * If we impact B/C, since we want the smallest sections, we need to have an adapted vj A/B/D + * We have B since the second passage through B should not be impacted + */ +BOOST_AUTO_TEST_CASE(add_impact_lollipop_vj_impact_stop_only_once) { + ed::builder b("20190901"); + + b.sa("stop_area:1", 0, 0, false, true)("stop_point:10"); + b.sa("stop_area:2", 0, 0, false, true)("stop_point:20"); + b.sa("stop_area:3", 0, 0, false, true)("stop_point:30"); + b.sa("stop_area:4", 0, 0, false, true)("stop_point:40"); + + b.vj("line:A", "111111", "", true, "vj:1")("stop_point:10", "08:10"_t, "08:11"_t)( + "stop_point:20", "08:20"_t, "08:21"_t)("stop_point:30", "08:30"_t, "08:31"_t)( + "stop_point:20", "08:40"_t, "08:41"_t)("stop_point:40", "08:50"_t, "08:51"_t); + + b.make(); + b.data->meta->production_date = bg::date_period(bg::date(2019, 9, 1), bg::days(7)); + + navitia::apply_disruption(b.impact(nt::RTLevel::Adapted, "line_section_on_line:A_diverted") + .severity(nt::disruption::Effect::NO_SERVICE) + .application_periods(btp("20190901T120000"_dt, "20190910T090000"_dt)) + .on_line_section("line:A", "stop_area:2", "stop_area:3", {"line:A:0"}) + .get_disruption(), + *b.data->pt_data, *b.data->meta); + + BOOST_REQUIRE_EQUAL(b.data->pt_data->lines.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->routes.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->vehicle_journeys.size(), 2); + + // Check the original vj + auto* vj = b.get("vehicle_journey:vj:1"); + auto adapted_vp = vj->adapted_validity_pattern()->days; + auto base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "000001"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "111111"), base_vp); + + // Check the adapted vj + vj = b.get("vehicle_journey:vj:1:Adapted:0:line_section_on_line:A_diverted"); + adapted_vp = vj->adapted_validity_pattern()->days; + base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "111110"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "000000"), base_vp); + // The adapted vj should have 3 stop_times + BOOST_REQUIRE_EQUAL(vj->stop_time_list.size(), 3); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.front().stop_point->uri, "stop_point:10"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(1).stop_point->uri, "stop_point:20"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(1).departure_time, "08:41"_t); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.back().stop_point->uri, "stop_point:40"); +} + +// Show a limitation of the current algorithm +// If we impact a non-base vehicle_journey we need to find the base stop_time associated +// to each stop_time of the vj to be able to know if its origin rank is impacted or not. +// Since get_base_stop_time is not perfect (we only check stop_point and departure_time) +// there is some (dumb) cases where we impact some stops we should not. +BOOST_AUTO_TEST_CASE(limitation_impact_repeated_stop_points_same_stop_time) { + ed::builder b("20190901"); + + b.sa("stop_area:1", 0, 0, false, true)("stop_point:10"); + b.sa("stop_area:2", 0, 0, false, true)("stop_point:20"); + b.sa("stop_area:3", 0, 0, false, true)("stop_point:30"); + b.sa("stop_area:4", 0, 0, false, true)("stop_point:40"); + + b.vj("line:A", "111111", "", true, "vj:1")("stop_point:10", "08:10"_t, "08:11"_t)( + "stop_point:20", "08:10"_t, "08:11"_t)("stop_point:30", "08:10"_t, "08:11"_t)( + "stop_point:20", "08:10"_t, "08:11"_t)("stop_point:40", "08:10"_t, "08:11"_t); + + b.make(); + b.data->meta->production_date = bg::date_period(bg::date(2019, 9, 1), bg::days(7)); + + // Impact from 2 to 3 once + navitia::apply_disruption(b.impact(nt::RTLevel::Adapted, "line_section_on_line:A_diverted") + .severity(nt::disruption::Effect::NO_SERVICE) + .application_periods(btp("20190901T120000"_dt, "20190910T090000"_dt)) + .on_line_section("line:A", "stop_area:2", "stop_area:3", {"line:A:0"}) + .get_disruption(), + *b.data->pt_data, *b.data->meta); + + BOOST_REQUIRE_EQUAL(b.data->pt_data->lines.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->routes.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->vehicle_journeys.size(), 2); + + // Check the original vj + auto* vj = b.get("vehicle_journey:vj:1"); + auto adapted_vp = vj->adapted_validity_pattern()->days; + auto base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "000001"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "111111"), base_vp); + + // Check the adapted vj + vj = b.get("vehicle_journey:vj:1:Adapted:0:line_section_on_line:A_diverted"); + adapted_vp = vj->adapted_validity_pattern()->days; + base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "111110"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "000000"), base_vp); + // The adapted vj should have 3 stop_times + BOOST_REQUIRE_EQUAL(vj->stop_time_list.size(), 3); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.front().stop_point->uri, "stop_point:10"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.at(1).stop_point->uri, "stop_point:20"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.back().stop_point->uri, "stop_point:40"); + + // And a second time on a slightly different calendar + navitia::apply_disruption(b.impact(nt::RTLevel::Adapted, "line_section_on_line:A_diverted_twice") + .severity(nt::disruption::Effect::NO_SERVICE) + .application_periods(btp("20190901T000000"_dt, "20190910T090000"_dt)) + .on_line_section("line:A", "stop_area:2", "stop_area:3", {"line:A:0"}) + .get_disruption(), + *b.data->pt_data, *b.data->meta); + + BOOST_REQUIRE_EQUAL(b.data->pt_data->lines.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->routes.size(), 1); + BOOST_REQUIRE_EQUAL(b.data->pt_data->vehicle_journeys.size(), 3); + + // Check the original vj + vj = b.get("vehicle_journey:vj:1"); + adapted_vp = vj->adapted_validity_pattern()->days; + base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "000000"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "111111"), base_vp); + + for (auto* vj : b.data->pt_data->vehicle_journeys) { + std::cerr << vj->uri << std::endl; + } + + // Check the adapted vj + vj = b.get( + "vehicle_journey:vj:1:Adapted:0:line_section_on_line:A_diverted:Adapted:2:line_section_on_line:A_diverted_" + "twice"); + adapted_vp = vj->adapted_validity_pattern()->days; + base_vp = vj->base_validity_pattern()->days; + BOOST_CHECK_MESSAGE(ba::ends_with(adapted_vp.to_string(), "111110"), adapted_vp); + BOOST_CHECK_MESSAGE(ba::ends_with(base_vp.to_string(), "000000"), base_vp); + // The adapted vj should have 3 stop_times + // But since the previous vj is adapted we must find the base stop time associated to the adapted + // one to impact it. + // However each stop_time have the same departure_time, so we are finding the base stop_time + // of rank 1 for the stop_time initially of rank 3 (both are on stop_point:20). + // We are lead to believe it is impacted even if it is not in reality. + // Nothing we can do really since there is no hard link between the adapted stop_time and base one + BOOST_REQUIRE_EQUAL(vj->stop_time_list.size(), 2); // Should be 3 [10, 20, 40] + BOOST_REQUIRE_EQUAL(vj->stop_time_list.front().stop_point->uri, "stop_point:10"); + BOOST_REQUIRE_EQUAL(vj->stop_time_list.back().stop_point->uri, "stop_point:40"); +} diff --git a/source/kraken/tests/data_manager_test.cpp b/source/kraken/tests/data_manager_test.cpp index 187f3f5b03..737e39c949 100644 --- a/source/kraken/tests/data_manager_test.cpp +++ b/source/kraken/tests/data_manager_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/data_manager_with_type_data_test.cpp b/source/kraken/tests/data_manager_with_type_data_test.cpp index 249a317e3b..dd1f06483c 100644 --- a/source/kraken/tests/data_manager_with_type_data_test.cpp +++ b/source/kraken/tests/data_manager_with_type_data_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/direct_path_test.cpp b/source/kraken/tests/direct_path_test.cpp index 68c5f79035..c843c6c306 100644 --- a/source/kraken/tests/direct_path_test.cpp +++ b/source/kraken/tests/direct_path_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/disruption_periods_test.cpp b/source/kraken/tests/disruption_periods_test.cpp index dffa6e6dee..da367ce381 100644 --- a/source/kraken/tests/disruption_periods_test.cpp +++ b/source/kraken/tests/disruption_periods_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/disruption_reader_test.cpp b/source/kraken/tests/disruption_reader_test.cpp index 5e844f76f7..fac193923f 100644 --- a/source/kraken/tests/disruption_reader_test.cpp +++ b/source/kraken/tests/disruption_reader_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/fill_disruption_from_chaos_tests.cpp b/source/kraken/tests/fill_disruption_from_chaos_tests.cpp index 316f7309a1..ea58263cfc 100644 --- a/source/kraken/tests/fill_disruption_from_chaos_tests.cpp +++ b/source/kraken/tests/fill_disruption_from_chaos_tests.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/realtime_test.cpp b/source/kraken/tests/realtime_test.cpp index 2d6b941e79..d96241414f 100644 --- a/source/kraken/tests/realtime_test.cpp +++ b/source/kraken/tests/realtime_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/tests/worker_test.cpp b/source/kraken/tests/worker_test.cpp index e86dcd192b..d2391bc315 100644 --- a/source/kraken/tests/worker_test.cpp +++ b/source/kraken/tests/worker_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/kraken/worker.cpp b/source/kraken/worker.cpp index 1c65d2b2f6..398ff0e878 100644 --- a/source/kraken/worker.cpp +++ b/source/kraken/worker.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -999,6 +999,8 @@ void Worker::dispatch(const pbnavitia::Request& request, const nt::Data& data) { // These api can respond even if the data isn't loaded if (request.requested_api() == pbnavitia::STATUS) { status(); + // Metadatas are needed for /status requests to update timezone + metadatas(); return; } if (request.requested_api() == pbnavitia::METADATAS) { diff --git a/source/kraken/worker.h b/source/kraken/worker.h index 76759a5ad3..fbcb5bb088 100644 --- a/source/kraken/worker.h +++ b/source/kraken/worker.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/lz4_filter/filter.h b/source/lz4_filter/filter.h index 1efd338cfe..975687c5d3 100644 --- a/source/lz4_filter/filter.h +++ b/source/lz4_filter/filter.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/lz4_filter/tests/test.cpp b/source/lz4_filter/tests/test.cpp index 4e42434210..e11442b5af 100644 --- a/source/lz4_filter/tests/test.cpp +++ b/source/lz4_filter/tests/test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/monitor/monitor_kraken/__init__.py b/source/monitor/monitor_kraken/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/monitor/monitor_kraken/__init__.py +++ b/source/monitor/monitor_kraken/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/monitor/monitor_kraken/app.py b/source/monitor/monitor_kraken/app.py index e26cda0681..588c17ba1f 100644 --- a/source/monitor/monitor_kraken/app.py +++ b/source/monitor/monitor_kraken/app.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/monitor/setup.py b/source/monitor/setup.py index d2d5d10833..b6b4cb6d5e 100644 --- a/source/monitor/setup.py +++ b/source/monitor/setup.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitia_version.py.cmake b/source/navitia_version.py.cmake index 2e04fbb6d8..07cda47e90 100644 --- a/source/navitia_version.py.cmake +++ b/source/navitia_version.py.cmake @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/__init__.py b/source/navitiacommon/navitiacommon/__init__.py index ce7e3bcd02..0c16a2ba4c 100644 --- a/source/navitiacommon/navitiacommon/__init__.py +++ b/source/navitiacommon/navitiacommon/__init__.py @@ -23,6 +23,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/default_traveler_profile_params.py b/source/navitiacommon/navitiacommon/default_traveler_profile_params.py index 9b5f254d5e..d89f1ec7f3 100644 --- a/source/navitiacommon/navitiacommon/default_traveler_profile_params.py +++ b/source/navitiacommon/navitiacommon/default_traveler_profile_params.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/default_values.py b/source/navitiacommon/navitiacommon/default_values.py index 0670b75db0..6b2430fe3a 100644 --- a/source/navitiacommon/navitiacommon/default_values.py +++ b/source/navitiacommon/navitiacommon/default_values.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/launch_exec.py b/source/navitiacommon/navitiacommon/launch_exec.py index 629328c65e..59ab0ec60b 100644 --- a/source/navitiacommon/navitiacommon/launch_exec.py +++ b/source/navitiacommon/navitiacommon/launch_exec.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/log.py b/source/navitiacommon/navitiacommon/log.py index f0a689a422..edd6993a46 100644 --- a/source/navitiacommon/navitiacommon/log.py +++ b/source/navitiacommon/navitiacommon/log.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/models/__init__.py b/source/navitiacommon/navitiacommon/models/__init__.py index e62a06734a..ec60caf6c2 100644 --- a/source/navitiacommon/navitiacommon/models/__init__.py +++ b/source/navitiacommon/navitiacommon/models/__init__.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -589,19 +589,13 @@ def delete_dataset(self, _type): if not result: return 0 - job_list = {} for dataset, job in result: # Cascade Delete not working so delete Metric associated manually db.session.query(Metric).filter(Metric.dataset_id == dataset.id).delete() db.session.delete(dataset) # Delete a job without any dataset - if job.id not in job_list: - job_list[job.id] = 1 - else: - job_list[job.id] += 1 - - if not (len(job.data_sets.all()) - job_list[job.id]): + if not len(job.data_sets.all()): db.session.delete(job) db.session.commit() diff --git a/source/navitiacommon/navitiacommon/models/autocomplete_parameter.py b/source/navitiacommon/navitiacommon/models/autocomplete_parameter.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/source/navitiacommon/navitiacommon/models/bss_provider.py b/source/navitiacommon/navitiacommon/models/bss_provider.py index 1e15b7bbca..c062ddaacf 100644 --- a/source/navitiacommon/navitiacommon/models/bss_provider.py +++ b/source/navitiacommon/navitiacommon/models/bss_provider.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/models/equipments_providers.py b/source/navitiacommon/navitiacommon/models/equipments_providers.py index c823afd354..099d6b1fca 100644 --- a/source/navitiacommon/navitiacommon/models/equipments_providers.py +++ b/source/navitiacommon/navitiacommon/models/equipments_providers.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/models/streetnetwork_backend.py b/source/navitiacommon/navitiacommon/models/streetnetwork_backend.py index a80a284c93..fce8eb8e47 100644 --- a/source/navitiacommon/navitiacommon/models/streetnetwork_backend.py +++ b/source/navitiacommon/navitiacommon/models/streetnetwork_backend.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/parser_args_type.py b/source/navitiacommon/navitiacommon/parser_args_type.py index 0489015553..e45e652fb0 100644 --- a/source/navitiacommon/navitiacommon/parser_args_type.py +++ b/source/navitiacommon/navitiacommon/parser_args_type.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io from collections import namedtuple diff --git a/source/navitiacommon/navitiacommon/sqlalchemy.py b/source/navitiacommon/navitiacommon/sqlalchemy.py index 250c20796d..48c5a0f754 100644 --- a/source/navitiacommon/navitiacommon/sqlalchemy.py +++ b/source/navitiacommon/navitiacommon/sqlalchemy.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/navitiacommon/utils.py b/source/navitiacommon/navitiacommon/utils.py index 035aa31924..1570204a5c 100644 --- a/source/navitiacommon/navitiacommon/utils.py +++ b/source/navitiacommon/navitiacommon/utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/setup.py b/source/navitiacommon/setup.py index 1266d3eb02..17e03ff8a1 100644 --- a/source/navitiacommon/setup.py +++ b/source/navitiacommon/setup.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/testscommon/__init__.py b/source/navitiacommon/testscommon/__init__.py index 80063fa2cd..34ed196a9e 100644 --- a/source/navitiacommon/testscommon/__init__.py +++ b/source/navitiacommon/testscommon/__init__.py @@ -24,6 +24,6 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/navitiacommon/testscommon/docker_wrapper.py b/source/navitiacommon/testscommon/docker_wrapper.py index 8cb4da557c..eef0d8b226 100644 --- a/source/navitiacommon/testscommon/docker_wrapper.py +++ b/source/navitiacommon/testscommon/docker_wrapper.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/proximity_list/proximity_list.h b/source/proximity_list/proximity_list.h index f514e5ab0d..1341ba3d55 100644 --- a/source/proximity_list/proximity_list.h +++ b/source/proximity_list/proximity_list.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/proximity_list/proximitylist_api.cpp b/source/proximity_list/proximitylist_api.cpp index 77eb5d2705..c609606c34 100644 --- a/source/proximity_list/proximitylist_api.cpp +++ b/source/proximity_list/proximitylist_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -127,15 +127,17 @@ void find(navitia::PbCreator& pb_creator, return; } } + // We have to find all objects within distance, then apply the filter + int search_count = -1; switch (type) { case nt::Type_e::StopArea: - list = pb_creator.data->pt_data->stop_area_proximity_list.find_within(coord, distance, count); + list = pb_creator.data->pt_data->stop_area_proximity_list.find_within(coord, distance, search_count); break; case nt::Type_e::StopPoint: - list = pb_creator.data->pt_data->stop_point_proximity_list.find_within(coord, distance, count); + list = pb_creator.data->pt_data->stop_point_proximity_list.find_within(coord, distance, search_count); break; case nt::Type_e::POI: - list = pb_creator.data->geo_ref->poi_proximity_list.find_within(coord, distance, count); + list = pb_creator.data->geo_ref->poi_proximity_list.find_within(coord, distance, search_count); break; default: break; diff --git a/source/proximity_list/proximitylist_api.h b/source/proximity_list/proximitylist_api.h index 12262c7b84..e9179981fb 100644 --- a/source/proximity_list/proximitylist_api.h +++ b/source/proximity_list/proximitylist_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/proximity_list/tests/test.cpp b/source/proximity_list/tests/test.cpp index 542926410a..1eff5efca2 100644 --- a/source/proximity_list/tests/test.cpp +++ b/source/proximity_list/tests/test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptref_graph.cpp b/source/ptreferential/ptref_graph.cpp index 0c28d6726c..66379752d1 100644 --- a/source/ptreferential/ptref_graph.cpp +++ b/source/ptreferential/ptref_graph.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptref_graph.h b/source/ptreferential/ptref_graph.h index 4996706770..8a610e33a9 100644 --- a/source/ptreferential/ptref_graph.h +++ b/source/ptreferential/ptref_graph.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential.cpp b/source/ptreferential/ptreferential.cpp index 25d8f8cd20..df99ff1293 100644 --- a/source/ptreferential/ptreferential.cpp +++ b/source/ptreferential/ptreferential.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential.h b/source/ptreferential/ptreferential.h index 775138d7ce..c570b5e568 100644 --- a/source/ptreferential/ptreferential.h +++ b/source/ptreferential/ptreferential.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential_api.cpp b/source/ptreferential/ptreferential_api.cpp index 596dbc2fec..8219a99205 100644 --- a/source/ptreferential/ptreferential_api.cpp +++ b/source/ptreferential/ptreferential_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential_api.h b/source/ptreferential/ptreferential_api.h index 321e61f542..3ead26d519 100644 --- a/source/ptreferential/ptreferential_api.h +++ b/source/ptreferential/ptreferential_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential_ng.cpp b/source/ptreferential/ptreferential_ng.cpp index 83e03c4cd8..cfddb2f4df 100644 --- a/source/ptreferential/ptreferential_ng.cpp +++ b/source/ptreferential/ptreferential_ng.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential_ng.h b/source/ptreferential/ptreferential_ng.h index 06c378b968..455dc68068 100644 --- a/source/ptreferential/ptreferential_ng.h +++ b/source/ptreferential/ptreferential_ng.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential_utils.cpp b/source/ptreferential/ptreferential_utils.cpp index d26601e28a..6aeb6a7820 100644 --- a/source/ptreferential/ptreferential_utils.cpp +++ b/source/ptreferential/ptreferential_utils.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/ptreferential_utils.h b/source/ptreferential/ptreferential_utils.h index d0c540d746..ac6719c248 100644 --- a/source/ptreferential/ptreferential_utils.h +++ b/source/ptreferential/ptreferential_utils.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/tests/ptref_companies_test.cpp b/source/ptreferential/tests/ptref_companies_test.cpp index ff4ab346db..d014eaa25f 100644 --- a/source/ptreferential/tests/ptref_companies_test.cpp +++ b/source/ptreferential/tests/ptref_companies_test.cpp @@ -24,7 +24,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/tests/ptref_ng_test.cpp b/source/ptreferential/tests/ptref_ng_test.cpp index 3d6a2468d2..c943c67590 100644 --- a/source/ptreferential/tests/ptref_ng_test.cpp +++ b/source/ptreferential/tests/ptref_ng_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -76,8 +76,8 @@ BOOST_AUTO_TEST_CASE(parse_pred) { R"#(vehicle_journey . has_code_type ( external_code ) )#", R"#(vehicle_journey.has_code_type("external_code"))#"); assert_expr( - R"#(route . has_code_type ( forward ) )#", - R"#(route.has_code_type("forward"))#"); + R"#(route . has_direction_type ( forward ) )#", + R"#(route.has_direction_type("forward"))#"); assert_expr(R"#(stop_area . uri ( "OIF:42" ) )#", R"#(stop_area.uri("OIF:42"))#"); assert_expr(R"#(stop_area . uri = "OIF:42" )#", R"#(stop_area.uri("OIF:42"))#"); assert_expr(R"#(stop_area . uri = OIF:42 )#", R"#(stop_area.uri("OIF:42"))#"); diff --git a/source/ptreferential/tests/ptref_odt_level_test.cpp b/source/ptreferential/tests/ptref_odt_level_test.cpp index 18fb4afb9a..2685f0d9df 100644 --- a/source/ptreferential/tests/ptref_odt_level_test.cpp +++ b/source/ptreferential/tests/ptref_odt_level_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/tests/ptref_test.cpp b/source/ptreferential/tests/ptref_test.cpp index 9253947e54..c702e6234f 100644 --- a/source/ptreferential/tests/ptref_test.cpp +++ b/source/ptreferential/tests/ptref_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/ptreferential/tests/vehicle_journey_test.cpp b/source/ptreferential/tests/vehicle_journey_test.cpp index f75b520bad..21cb848f68 100644 --- a/source/ptreferential/tests/vehicle_journey_test.cpp +++ b/source/ptreferential/tests/vehicle_journey_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/benchmark.cpp b/source/routing/benchmark.cpp index 9665807187..4d1e17fe16 100644 --- a/source/routing/benchmark.cpp +++ b/source/routing/benchmark.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/benchmark_full.cpp b/source/routing/benchmark_full.cpp index 8d130d2677..461775705a 100644 --- a/source/routing/benchmark_full.cpp +++ b/source/routing/benchmark_full.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/benchmark_raptor_cache.cpp b/source/routing/benchmark_raptor_cache.cpp index 2ddc5e790d..ee4a9bef75 100644 --- a/source/routing/benchmark_raptor_cache.cpp +++ b/source/routing/benchmark_raptor_cache.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/dataraptor.cpp b/source/routing/dataraptor.cpp index d9c9a39552..204e16297c 100644 --- a/source/routing/dataraptor.cpp +++ b/source/routing/dataraptor.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/dataraptor.h b/source/routing/dataraptor.h index bbed291be6..cf3ae62fa9 100644 --- a/source/routing/dataraptor.h +++ b/source/routing/dataraptor.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/get_stop_times.cpp b/source/routing/get_stop_times.cpp index 56b3beb9a0..c55cf296ae 100644 --- a/source/routing/get_stop_times.cpp +++ b/source/routing/get_stop_times.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/get_stop_times.h b/source/routing/get_stop_times.h index a0d990bc62..7b06b0a54c 100644 --- a/source/routing/get_stop_times.h +++ b/source/routing/get_stop_times.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/heat_map.cpp b/source/routing/heat_map.cpp index 76352c12ba..dd9f880f09 100644 --- a/source/routing/heat_map.cpp +++ b/source/routing/heat_map.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/heat_map.h b/source/routing/heat_map.h index 1c4846d033..37b5b4550a 100644 --- a/source/routing/heat_map.h +++ b/source/routing/heat_map.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/isochrone.cpp b/source/routing/isochrone.cpp index 855bf34dc7..664d1d88bf 100644 --- a/source/routing/isochrone.cpp +++ b/source/routing/isochrone.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/isochrone.h b/source/routing/isochrone.h index 38f73a307e..0511f186ea 100644 --- a/source/routing/isochrone.h +++ b/source/routing/isochrone.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/journey.cpp b/source/routing/journey.cpp index 0044daea49..2265a6b6fd 100644 --- a/source/routing/journey.cpp +++ b/source/routing/journey.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/journey.h b/source/routing/journey.h index f9e3696e77..9349fda5ec 100644 --- a/source/routing/journey.h +++ b/source/routing/journey.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/journey_pattern_container.cpp b/source/routing/journey_pattern_container.cpp index 487035710e..6a3f1d8f75 100644 --- a/source/routing/journey_pattern_container.cpp +++ b/source/routing/journey_pattern_container.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/journey_pattern_container.h b/source/routing/journey_pattern_container.h index bfdb1ef903..77d75211e5 100644 --- a/source/routing/journey_pattern_container.h +++ b/source/routing/journey_pattern_container.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/next_stop_time.cpp b/source/routing/next_stop_time.cpp index f9dd70cb3e..a1d1c762b5 100644 --- a/source/routing/next_stop_time.cpp +++ b/source/routing/next_stop_time.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/next_stop_time.h b/source/routing/next_stop_time.h index b24d133fee..b58fa3e5a0 100644 --- a/source/routing/next_stop_time.h +++ b/source/routing/next_stop_time.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/raptor.cpp b/source/routing/raptor.cpp index 05fe1e8c8c..d5c7237cb9 100644 --- a/source/routing/raptor.cpp +++ b/source/routing/raptor.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/raptor.h b/source/routing/raptor.h index c0a6a2d2d2..714e9fc5ba 100644 --- a/source/routing/raptor.h +++ b/source/routing/raptor.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/raptor_api.cpp b/source/routing/raptor_api.cpp index 395b457fd6..0177b58a93 100644 --- a/source/routing/raptor_api.cpp +++ b/source/routing/raptor_api.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/raptor_api.h b/source/routing/raptor_api.h index 71ea7bd800..ae62730340 100644 --- a/source/routing/raptor_api.h +++ b/source/routing/raptor_api.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/raptor_solution_reader.cpp b/source/routing/raptor_solution_reader.cpp index c89f93db39..4bbab6b21a 100644 --- a/source/routing/raptor_solution_reader.cpp +++ b/source/routing/raptor_solution_reader.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/raptor_solution_reader.h b/source/routing/raptor_solution_reader.h index db91a28d8e..a4fa593045 100644 --- a/source/routing/raptor_solution_reader.h +++ b/source/routing/raptor_solution_reader.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/raptor_utils.h b/source/routing/raptor_utils.h index 9b8570c140..26ff016e1a 100644 --- a/source/routing/raptor_utils.h +++ b/source/routing/raptor_utils.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/routing.cpp b/source/routing/routing.cpp index 4306eb717d..6ac87155e3 100644 --- a/source/routing/routing.cpp +++ b/source/routing/routing.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/routing.h b/source/routing/routing.h index 1115c0faed..f49babd84d 100644 --- a/source/routing/routing.h +++ b/source/routing/routing.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/stop_event.h b/source/routing/stop_event.h index d7197321e7..1d59b7bc77 100644 --- a/source/routing/stop_event.h +++ b/source/routing/stop_event.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/co2_emission_test.cpp b/source/routing/tests/co2_emission_test.cpp index 3d4f591a7f..79c4eded47 100644 --- a/source/routing/tests/co2_emission_test.cpp +++ b/source/routing/tests/co2_emission_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/disruptions_test.cpp b/source/routing/tests/disruptions_test.cpp index 2aa6fc4ac9..5b2c834616 100644 --- a/source/routing/tests/disruptions_test.cpp +++ b/source/routing/tests/disruptions_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/frequency_raptor_test.cpp b/source/routing/tests/frequency_raptor_test.cpp index ae2e00ad31..46ce1d6ec6 100644 --- a/source/routing/tests/frequency_raptor_test.cpp +++ b/source/routing/tests/frequency_raptor_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/get_stop_times_test.cpp b/source/routing/tests/get_stop_times_test.cpp index f5e8959211..39803f43ea 100644 --- a/source/routing/tests/get_stop_times_test.cpp +++ b/source/routing/tests/get_stop_times_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/heat_map_test.cpp b/source/routing/tests/heat_map_test.cpp index 12788740c7..f7fe8d6dec 100644 --- a/source/routing/tests/heat_map_test.cpp +++ b/source/routing/tests/heat_map_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/isochrone_test.cpp b/source/routing/tests/isochrone_test.cpp index fcd95626eb..dc02e5a54a 100644 --- a/source/routing/tests/isochrone_test.cpp +++ b/source/routing/tests/isochrone_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/journey_pattern_container_test.cpp b/source/routing/tests/journey_pattern_container_test.cpp index c9693b0e98..34e3551de8 100644 --- a/source/routing/tests/journey_pattern_container_test.cpp +++ b/source/routing/tests/journey_pattern_container_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/journey_test.cpp b/source/routing/tests/journey_test.cpp index 0c3fa93588..8ac43f84e7 100644 --- a/source/routing/tests/journey_test.cpp +++ b/source/routing/tests/journey_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/next_stop_time_test.cpp b/source/routing/tests/next_stop_time_test.cpp index f879a7739c..2deda7798a 100644 --- a/source/routing/tests/next_stop_time_test.cpp +++ b/source/routing/tests/next_stop_time_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/raptor_test.cpp b/source/routing/tests/raptor_test.cpp index 3fe431686a..07d1648659 100644 --- a/source/routing/tests/raptor_test.cpp +++ b/source/routing/tests/raptor_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/raptorfoot_test.cpp b/source/routing/tests/raptorfoot_test.cpp index 2a81156042..524b5da19c 100644 --- a/source/routing/tests/raptorfoot_test.cpp +++ b/source/routing/tests/raptorfoot_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/reverse_raptor_test.cpp b/source/routing/tests/reverse_raptor_test.cpp index 1d4b7d80cb..c3fae66ca3 100644 --- a/source/routing/tests/reverse_raptor_test.cpp +++ b/source/routing/tests/reverse_raptor_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/routing_api_test.cpp b/source/routing/tests/routing_api_test.cpp index 5e35092c81..f3285ca976 100644 --- a/source/routing/tests/routing_api_test.cpp +++ b/source/routing/tests/routing_api_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/routing/tests/routing_api_test_data.h b/source/routing/tests/routing_api_test_data.h index b38826c37c..4ebfc33a75 100644 --- a/source/routing/tests/routing_api_test_data.h +++ b/source/routing/tests/routing_api_test_data.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -492,20 +492,8 @@ struct routing_api_data { r->destination = b.sas.find("stopA")->second; } - // Add Fare - boost::gregorian::date start_date(boost::gregorian::neg_infin); - boost::gregorian::date end_date(boost::gregorian::pos_infin); - - b.data->fare->fare_map["M-Ticket"].add( - start_date, end_date, navitia::fare::Ticket("M-Ticket", "M-Ticket name", 100, "This is M-Ticket")); - - navitia::fare::Transition ticket_transition; - navitia::fare::State ticket_state; - ticket_state.line = "m"; - ticket_transition.ticket_key = "M-Ticket"; - - auto ticket_state_v = boost::add_vertex(ticket_state, b.data->fare->g); - boost::add_edge(b.data->fare->begin_v, ticket_state_v, ticket_transition, b.data->fare->g); + // Add tickets + b.add_ticket("M-Ticket", "M", 100, "This is M-Ticket"); } b.data->complete(); diff --git a/source/scripts/checkJenkinsJob.sh b/source/scripts/checkJenkinsJob.sh new file mode 100755 index 0000000000..17106e398c --- /dev/null +++ b/source/scripts/checkJenkinsJob.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +RED='\033[0;31m' +GREEN='\033[0;32m' +SET='\033[0m' + +JENKINS_JOB=$1 +JOB_ACCEPTED_COLOURS=('blue' 'blue_anime') +JOB_COLOUR=$(curl -s "https://ci.navitia.io/api/json" | jq ".jobs[] | select(.name==\"$JENKINS_JOB\").color") + +# Remove surrounding quotes +JOB_COLOUR=$(echo $JOB_COLOUR | tr -d \") + +if [[ -z "$JENKINS_JOB" ]]; then + echo "No job provided." + echo "" + echo "usage :" + echo " ./checkJenkinsJob " + echo "" + echo " - job: a string that defines the job's name to be checked" + echo "" + exit 1 +fi + +if [[ -z $JOB_COLOUR ]]; then + echo -e "${RED}Jenkins job '$JENKINS_JOB' does not exist${SET}" 1>&2 + exit 2 +elif [[ ! ${JOB_ACCEPTED_COLOURS[*]} =~ $JOB_COLOUR ]]; then + echo -e "${RED} 🔥 Jenkins job '$JENKINS_JOB' is broken 🔥, please cease all acticity and go fix it 🚒 " 1>&2 + echo -e "${RED} >> https://ci.navitia.io/job/$JENKINS_JOB/ ${SET}" 1>&2 + exit 3 +fi + +echo -e "${GREEN}Jenkins job '$JENKINS_JOB' is OK 👌 ${SET}" + diff --git a/source/tests/chaos/chaos_db_tests.cpp b/source/tests/chaos/chaos_db_tests.cpp index c7b7f35351..7d8083031c 100644 --- a/source/tests/chaos/chaos_db_tests.cpp +++ b/source/tests/chaos/chaos_db_tests.cpp @@ -24,7 +24,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/chaos/chaos_test.py b/source/tests/chaos/chaos_test.py index 023f91a316..89235b2396 100644 --- a/source/tests/chaos/chaos_test.py +++ b/source/tests/chaos/chaos_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tests/mock-kraken/basic_routing_test.cpp b/source/tests/mock-kraken/basic_routing_test.cpp index 64ee649ae3..116ccec75b 100644 --- a/source/tests/mock-kraken/basic_routing_test.cpp +++ b/source/tests/mock-kraken/basic_routing_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/basic_schedule_test.cpp b/source/tests/mock-kraken/basic_schedule_test.cpp index bb7337dbe6..788de9c3b0 100644 --- a/source/tests/mock-kraken/basic_schedule_test.cpp +++ b/source/tests/mock-kraken/basic_schedule_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/departure_board_test.cpp b/source/tests/mock-kraken/departure_board_test.cpp index 41d7fd63d1..e914d61c15 100644 --- a/source/tests/mock-kraken/departure_board_test.cpp +++ b/source/tests/mock-kraken/departure_board_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/empty_routing_test.cpp b/source/tests/mock-kraken/empty_routing_test.cpp index 25671f1ed6..53b2bddc20 100644 --- a/source/tests/mock-kraken/empty_routing_test.cpp +++ b/source/tests/mock-kraken/empty_routing_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/line_sections_test.cpp b/source/tests/mock-kraken/line_sections_test.cpp index f72c122e6c..9de1b65403 100644 --- a/source/tests/mock-kraken/line_sections_test.cpp +++ b/source/tests/mock-kraken/line_sections_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/main_autocomplete_test.cpp b/source/tests/mock-kraken/main_autocomplete_test.cpp index 9397d7a2bf..1c55b7d5de 100644 --- a/source/tests/mock-kraken/main_autocomplete_test.cpp +++ b/source/tests/mock-kraken/main_autocomplete_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/main_ptref_test.cpp b/source/tests/mock-kraken/main_ptref_test.cpp index 7a153514c0..02677dd5ac 100644 --- a/source/tests/mock-kraken/main_ptref_test.cpp +++ b/source/tests/mock-kraken/main_ptref_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/main_routing_test.cpp b/source/tests/mock-kraken/main_routing_test.cpp index f17eb5e9e5..d2afba8bb0 100644 --- a/source/tests/mock-kraken/main_routing_test.cpp +++ b/source/tests/mock-kraken/main_routing_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/main_routing_without_pt_test.cpp b/source/tests/mock-kraken/main_routing_without_pt_test.cpp index a4da987186..cc8bbf8ef5 100644 --- a/source/tests/mock-kraken/main_routing_without_pt_test.cpp +++ b/source/tests/mock-kraken/main_routing_without_pt_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/main_stif_test.cpp b/source/tests/mock-kraken/main_stif_test.cpp index 2c98bbae09..99f008afb9 100644 --- a/source/tests/mock-kraken/main_stif_test.cpp +++ b/source/tests/mock-kraken/main_stif_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -67,6 +67,13 @@ int main(int argc, const char* const argv[]) { b.connection("stopV", "stopV", 0); b.vj("PW", "11111111", "", true, "", "", "physical_mode:Bus")("stopP", "15:00"_t)("stopW", "21:00"_t); // Bus + // Add tickets + b.add_ticket("P-Ticket", "P", 100, "P-Ticket comment"); + b.add_ticket("Q-Ticket", "Q", 100, "Q-Ticket comment"); + b.add_ticket("R-Ticket", "R", 100, "R-Ticket comment"); + b.add_ticket("S-Ticket", "S", 100, "S-Ticket comment"); + b.add_ticket("T-Ticket", "T", 99, "T-Ticket comment"); + b.make(); mock_kraken kraken(b, argc, argv); diff --git a/source/tests/mock-kraken/min_nb_journeys_test.cpp b/source/tests/mock-kraken/min_nb_journeys_test.cpp index 9b46a74a6d..1e9ce0aa48 100644 --- a/source/tests/mock-kraken/min_nb_journeys_test.cpp +++ b/source/tests/mock-kraken/min_nb_journeys_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -138,6 +138,10 @@ int main(int argc, const char* const argv[]) { b.lines["N"]->color = "BC5AC8"; b.lines["N"]->text_color = "FFFFFF"; + // Add tickets + b.add_ticket("A-Ticket", "A", 100, "A-Ticket comment"); + b.add_ticket("B-Ticket", "B", 120, "B-Ticket comment"); + // build data b.data->complete(); b.manage_admin(); diff --git a/source/tests/mock-kraken/mock_kraken.h b/source/tests/mock-kraken/mock_kraken.h index 1337cb3b65..7b955a55f8 100644 --- a/source/tests/mock-kraken/mock_kraken.h +++ b/source/tests/mock-kraken/mock_kraken.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/multiple_schedules.cpp b/source/tests/mock-kraken/multiple_schedules.cpp index 7f60cc4fdc..dafa5299b2 100644 --- a/source/tests/mock-kraken/multiple_schedules.cpp +++ b/source/tests/mock-kraken/multiple_schedules.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/null_status_test.cpp b/source/tests/mock-kraken/null_status_test.cpp index 07eae6c4a8..8c8265c65d 100644 --- a/source/tests/mock-kraken/null_status_test.cpp +++ b/source/tests/mock-kraken/null_status_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/timezone_cape_verde_test.cpp b/source/tests/mock-kraken/timezone_cape_verde_test.cpp index 33b8ff8224..cb164aadf4 100644 --- a/source/tests/mock-kraken/timezone_cape_verde_test.cpp +++ b/source/tests/mock-kraken/timezone_cape_verde_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tests/mock-kraken/timezone_hong_kong_test.cpp b/source/tests/mock-kraken/timezone_hong_kong_test.cpp index 5424a82151..f778fab1a9 100644 --- a/source/tests/mock-kraken/timezone_hong_kong_test.cpp +++ b/source/tests/mock-kraken/timezone_hong_kong_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/departure_boards.cpp b/source/time_tables/departure_boards.cpp index 52c4759606..c711b5e6df 100644 --- a/source/time_tables/departure_boards.cpp +++ b/source/time_tables/departure_boards.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/departure_boards.h b/source/time_tables/departure_boards.h index 35412f79ca..19e9b5c3ac 100644 --- a/source/time_tables/departure_boards.h +++ b/source/time_tables/departure_boards.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/passages.cpp b/source/time_tables/passages.cpp index d41697d72f..e45df6ea04 100644 --- a/source/time_tables/passages.cpp +++ b/source/time_tables/passages.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/passages.h b/source/time_tables/passages.h index a68913e713..18d6130b7f 100644 --- a/source/time_tables/passages.h +++ b/source/time_tables/passages.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/request_handle.cpp b/source/time_tables/request_handle.cpp index 84a84fcc77..ed23d7de73 100644 --- a/source/time_tables/request_handle.cpp +++ b/source/time_tables/request_handle.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/request_handle.h b/source/time_tables/request_handle.h index d34c9b809c..2bbb736860 100644 --- a/source/time_tables/request_handle.h +++ b/source/time_tables/request_handle.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/route_schedules.cpp b/source/time_tables/route_schedules.cpp index 1974805833..2e9e83c917 100644 --- a/source/time_tables/route_schedules.cpp +++ b/source/time_tables/route_schedules.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/route_schedules.h b/source/time_tables/route_schedules.h index 0ebbfe30ca..6b2e4a4a28 100644 --- a/source/time_tables/route_schedules.h +++ b/source/time_tables/route_schedules.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/tests/departure_board_test_data.h b/source/time_tables/tests/departure_board_test_data.h index 5d53fb4d7f..56682457fc 100644 --- a/source/time_tables/tests/departure_board_test_data.h +++ b/source/time_tables/tests/departure_board_test_data.h @@ -39,11 +39,13 @@ struct departure_board_fixture { departure_board_fixture() : b("20160101") { b.sa("SA1")("S1")("S2"); - b.vj("A").name("A:vj1")("A:s", "08:00"_t)("S1", "09:00"_t)("S2", "10:00"_t)("A:e", "11:00"_t); + b.vj("A") + .route("A:0", "forward") + .name("A:vj1")("A:s", "08:00"_t)("S1", "09:00"_t)("S2", "10:00"_t)("A:e", "11:00"_t); b.vj("A").name("A:vj2")("A:s", "09:00"_t)("S1", "10:00"_t)("S2", "11:00"_t)("A:e", "12:00"_t); b.vj("A").name("A:vj3")("A:s", "10:00"_t)("S1", "11:00"_t)("S2", "12:00"_t)("A:e", "13:00"_t); - b.vj("B").name("B:vj1")("B:s", "10:30"_t)("S1", "11:30"_t)("B:e", "12:30"_t); + b.vj("B").route("B:1", "anticlockwise").name("B:vj1")("B:s", "10:30"_t)("S1", "11:30"_t)("B:e", "12:30"_t); b.vj("C").name("C:vj1")("C:S0", "11:30"_t)("C:S1", "12:30"_t)("C:S2", "13:30"_t); b.lines.find("C")->second->properties["realtime_system"] = "Kisio数字"; diff --git a/source/time_tables/tests/departure_boards_test.cpp b/source/time_tables/tests/departure_boards_test.cpp index 40333d9489..7ba4c83f81 100644 --- a/source/time_tables/tests/departure_boards_test.cpp +++ b/source/time_tables/tests/departure_boards_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/tests/passages_test.cpp b/source/time_tables/tests/passages_test.cpp index b9905cb65e..de0ea5a5f6 100644 --- a/source/time_tables/tests/passages_test.cpp +++ b/source/time_tables/tests/passages_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/tests/route_schedules_test.cpp b/source/time_tables/tests/route_schedules_test.cpp index 41b121821f..f00d39ea09 100644 --- a/source/time_tables/tests/route_schedules_test.cpp +++ b/source/time_tables/tests/route_schedules_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/tests/thermometer.cpp b/source/time_tables/tests/thermometer.cpp index 8d56215ce3..b4705f6d8b 100644 --- a/source/time_tables/tests/thermometer.cpp +++ b/source/time_tables/tests/thermometer.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/thermometer.cpp b/source/time_tables/thermometer.cpp index 568fcbd116..1167991e20 100644 --- a/source/time_tables/thermometer.cpp +++ b/source/time_tables/thermometer.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/time_tables/thermometer.h b/source/time_tables/thermometer.h index ae1ef6406f..ac4ee9992c 100644 --- a/source/time_tables/thermometer.h +++ b/source/time_tables/thermometer.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/tools/dumpsn.cpp b/source/tools/dumpsn.cpp index 83394e055c..f6f46ca66d 100644 --- a/source/tools/dumpsn.cpp +++ b/source/tools/dumpsn.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/calendar.cpp b/source/type/calendar.cpp index 3c8b3a739a..afe8e7a03e 100644 --- a/source/type/calendar.cpp +++ b/source/type/calendar.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/calendar.h b/source/type/calendar.h index 07be91bfe7..f35e6b4d36 100644 --- a/source/type/calendar.h +++ b/source/type/calendar.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/code_container.h b/source/type/code_container.h index 2bf110d317..f714e367d6 100644 --- a/source/type/code_container.h +++ b/source/type/code_container.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/comment.cpp b/source/type/comment.cpp index 19a0ed3ba2..6a93174fdc 100644 --- a/source/type/comment.cpp +++ b/source/type/comment.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/comment.h b/source/type/comment.h index 499f73c847..d52d4329d4 100644 --- a/source/type/comment.h +++ b/source/type/comment.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/comment_container.cpp b/source/type/comment_container.cpp index cd7304f1ab..05b571cd43 100644 --- a/source/type/comment_container.cpp +++ b/source/type/comment_container.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/comment_container.h b/source/type/comment_container.h index fea44a76a5..8cabafd80a 100644 --- a/source/type/comment_container.h +++ b/source/type/comment_container.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/commercial_mode.cpp b/source/type/commercial_mode.cpp index 411c800425..e586bac825 100644 --- a/source/type/commercial_mode.cpp +++ b/source/type/commercial_mode.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/commercial_mode.h b/source/type/commercial_mode.h index 512ffcc2aa..dd106c0bc5 100644 --- a/source/type/commercial_mode.h +++ b/source/type/commercial_mode.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/company.cpp b/source/type/company.cpp index 727c854273..c11519f697 100644 --- a/source/type/company.cpp +++ b/source/type/company.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/company.h b/source/type/company.h index b12626f89f..762b656937 100644 --- a/source/type/company.h +++ b/source/type/company.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/concerns_base_at_period.h b/source/type/concerns_base_at_period.h index 1a2815cc46..dfc0a023a4 100644 --- a/source/type/concerns_base_at_period.h +++ b/source/type/concerns_base_at_period.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/connection.cpp b/source/type/connection.cpp index 2fc2658eec..9a32a20b60 100644 --- a/source/type/connection.cpp +++ b/source/type/connection.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/connection.h b/source/type/connection.h index 148c41229e..18f7330bc9 100644 --- a/source/type/connection.h +++ b/source/type/connection.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/contributor.cpp b/source/type/contributor.cpp index 2d68bd06fe..82d210cdba 100644 --- a/source/type/contributor.cpp +++ b/source/type/contributor.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/contributor.h b/source/type/contributor.h index bc2c024ca7..0c55d5fdd7 100644 --- a/source/type/contributor.h +++ b/source/type/contributor.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/data.cpp b/source/type/data.cpp index bb38214a3e..311fc53c9d 100644 --- a/source/type/data.cpp +++ b/source/type/data.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -491,8 +491,8 @@ void Data::aggregate_odt() { } // we add it for the ODT type where the vehicle comes directly to the user route->for_each_vehicle_journey([&](const VehicleJourney& vj) { - if (in(vj.vehicle_journey_type, - {VehicleJourneyType::adress_to_stop_point, VehicleJourneyType::odt_point_to_point})) { + if (contains({VehicleJourneyType::adress_to_stop_point, VehicleJourneyType::odt_point_to_point}, + vj.vehicle_journey_type)) { for (const auto& st : vj.stop_time_list) { for (auto* admin : st.stop_point->admin_list) { odt_stops_by_admin[admin].insert(st.stop_point); diff --git a/source/type/data.h b/source/type/data.h index 31b591d7c0..c2afe778cf 100644 --- a/source/type/data.h +++ b/source/type/data.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/data_exceptions.h b/source/type/data_exceptions.h index be535be079..d2887cb572 100644 --- a/source/type/data_exceptions.h +++ b/source/type/data_exceptions.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/dataset.cpp b/source/type/dataset.cpp index 4c71645d73..383848074d 100644 --- a/source/type/dataset.cpp +++ b/source/type/dataset.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/dataset.h b/source/type/dataset.h index b06413ccfa..a77e15b6c4 100644 --- a/source/type/dataset.h +++ b/source/type/dataset.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/datetime.cpp b/source/type/datetime.cpp index 03dbd2275b..222841db5f 100644 --- a/source/type/datetime.cpp +++ b/source/type/datetime.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/datetime.h b/source/type/datetime.h index 52c6316987..bbb9759d4a 100644 --- a/source/type/datetime.h +++ b/source/type/datetime.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/fwd_type.h b/source/type/fwd_type.h index 0b5317ae4f..6a33457834 100644 --- a/source/type/fwd_type.h +++ b/source/type/fwd_type.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/geographical_coord.cpp b/source/type/geographical_coord.cpp index fa47b6ec8c..6f8535099e 100644 --- a/source/type/geographical_coord.cpp +++ b/source/type/geographical_coord.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/geographical_coord.h b/source/type/geographical_coord.h index 052d8a3e35..253ee62e49 100644 --- a/source/type/geographical_coord.h +++ b/source/type/geographical_coord.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/headsign_handler.cpp b/source/type/headsign_handler.cpp index 40adde0fa2..af0c327c56 100644 --- a/source/type/headsign_handler.cpp +++ b/source/type/headsign_handler.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/headsign_handler.h b/source/type/headsign_handler.h index b7c2c5a0b5..83493e6204 100644 --- a/source/type/headsign_handler.h +++ b/source/type/headsign_handler.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/indexes.h b/source/type/indexes.h index 0789cde58e..a8e3e8e68e 100644 --- a/source/type/indexes.h +++ b/source/type/indexes.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/line.cpp b/source/type/line.cpp index d177713417..45bdc55de9 100644 --- a/source/type/line.cpp +++ b/source/type/line.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/line.h b/source/type/line.h index fe4a530992..20ac782097 100644 --- a/source/type/line.h +++ b/source/type/line.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/message.cpp b/source/type/message.cpp index 2c7343bcb9..4a9a2addb8 100644 --- a/source/type/message.cpp +++ b/source/type/message.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -145,7 +145,7 @@ std::vector get_impacted_vehicle_journeys(const LineSection& ls, } // Filtering each journey to see if it's impacted by the section. - auto section = vj.get_sections_stop_points(ls.start_point, ls.end_point); + auto section = vj.get_sections_ranks(ls.start_point, ls.end_point); // If the vj pass by both stops both elements will be different than nullptr, otherwise // it's not passing by both stops and should not be impacted if (!section.empty()) { @@ -200,10 +200,13 @@ struct InformedEntitiesLinker : public boost::static_visitor<> { // it's the first time we see this metavj, we add the impact to it vj->meta_vj->add_impact(impact); } - for (auto* sp : impacted_vj.impacted_stops) { - if (impacted_stop_points.insert(sp).second) { + // Get base vj to impact all stop_points + auto base_vj = vj->get_corresponding_base(); + for (const auto& st : base_vj->stop_time_list) { + // if the stop_point is impacted and it's the first time we see it + if (impacted_vj.impacted_ranks.count(st.order()) && impacted_stop_points.insert(st.stop_point).second) { // it's the first time we see this stoppoint, we add the impact to it - sp->add_impact(impact); + st.stop_point->add_impact(impact); } } } @@ -339,9 +342,13 @@ std::set LineSection::get_stop_points_section() const { std::set res; for (const auto* route : routes) { route->for_each_vehicle_journey([&](const VehicleJourney& vj) { - res = vj.get_sections_stop_points(start_point, end_point); - if (res.empty()) { + auto ranks = vj.get_sections_ranks(start_point, end_point); + if (ranks.empty()) { return true; + } else { + for (const auto& rank : ranks) { + res.insert(vj.stop_time_list.at(rank).stop_point); + } } return false; }); diff --git a/source/type/message.h b/source/type/message.h index 0c58434be1..8fee6c67c6 100644 --- a/source/type/message.h +++ b/source/type/message.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -411,9 +411,9 @@ class DisruptionHolder { struct ImpactedVJ { const VehicleJourney* vj; // vj before impact ValidityPattern new_vp; - std::set impacted_stops; - ImpactedVJ(const VehicleJourney* vj, ValidityPattern vp, std::set r) - : vj(vj), new_vp(vp), impacted_stops(std::move(r)) {} + std::set impacted_ranks; + ImpactedVJ(const VehicleJourney* vj, ValidityPattern vp, std::set r) + : vj(vj), new_vp(vp), impacted_ranks(std::move(r)) {} }; /* * return the list of vehicle journey that are impacted by the linesection diff --git a/source/type/meta_data.h b/source/type/meta_data.h index 5d8852c40c..53788491f9 100644 --- a/source/type/meta_data.h +++ b/source/type/meta_data.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/multi_polygon_map.h b/source/type/multi_polygon_map.h index 15627c3bb9..99c5c2bc18 100644 --- a/source/type/multi_polygon_map.h +++ b/source/type/multi_polygon_map.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/network.cpp b/source/type/network.cpp index 888f5c373d..79c8680ce7 100644 --- a/source/type/network.cpp +++ b/source/type/network.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/network.h b/source/type/network.h index 5ea80adf8a..44ae8a095f 100644 --- a/source/type/network.h +++ b/source/type/network.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/odt_properties.cpp b/source/type/odt_properties.cpp index 530ff7aa79..78ac680fd9 100644 --- a/source/type/odt_properties.cpp +++ b/source/type/odt_properties.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/odt_properties.h b/source/type/odt_properties.h index e8aa83b961..a278b43025 100644 --- a/source/type/odt_properties.h +++ b/source/type/odt_properties.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/pb_converter.cpp b/source/type/pb_converter.cpp index 09569b8e0c..80ed7169e5 100644 --- a/source/type/pb_converter.cpp +++ b/source/type/pb_converter.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -99,10 +99,11 @@ struct PbCreator::Filler::PtObjVisitor : public boost::static_visitor<> { } bool is_detour(nd::StopTimeUpdate::Status dep_status, nd::StopTimeUpdate::Status arr_status) const { - return (in(dep_status, - {nd::StopTimeUpdate::Status::ADDED_FOR_DETOUR, nd::StopTimeUpdate::Status::DELETED_FOR_DETOUR}) - || in(arr_status, - {nd::StopTimeUpdate::Status::ADDED_FOR_DETOUR, nd::StopTimeUpdate::Status::DELETED_FOR_DETOUR})); + return ( + contains({nd::StopTimeUpdate::Status::ADDED_FOR_DETOUR, nd::StopTimeUpdate::Status::DELETED_FOR_DETOUR}, + dep_status) + || contains({nd::StopTimeUpdate::Status::ADDED_FOR_DETOUR, nd::StopTimeUpdate::Status::DELETED_FOR_DETOUR}, + arr_status)); } void operator()(const nd::UnknownPtObj&) const {} diff --git a/source/type/pb_converter.h b/source/type/pb_converter.h index 93c13d120b..796ca74bbb 100644 --- a/source/type/pb_converter.h +++ b/source/type/pb_converter.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/physical_mode.cpp b/source/type/physical_mode.cpp index 6c107dd6cb..7008df438e 100644 --- a/source/type/physical_mode.cpp +++ b/source/type/physical_mode.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/physical_mode.h b/source/type/physical_mode.h index 00bb93d48e..f8c60d0a6b 100644 --- a/source/type/physical_mode.h +++ b/source/type/physical_mode.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/pt_data.cpp b/source/type/pt_data.cpp index 77015aa48e..d21268bb24 100644 --- a/source/type/pt_data.cpp +++ b/source/type/pt_data.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/pt_data.h b/source/type/pt_data.h index 691bcdfc65..d51c6183bd 100644 --- a/source/type/pt_data.h +++ b/source/type/pt_data.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/route.cpp b/source/type/route.cpp index 10b5344add..b6b06a5836 100644 --- a/source/type/route.cpp +++ b/source/type/route.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/route.h b/source/type/route.h index 6ca7079496..26bc0843d8 100644 --- a/source/type/route.h +++ b/source/type/route.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/rt_level.h b/source/type/rt_level.h index f3ff03dc81..a538202959 100644 --- a/source/type/rt_level.h +++ b/source/type/rt_level.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/serialization.h b/source/type/serialization.h index 05645da702..f73a681d89 100644 --- a/source/type/serialization.h +++ b/source/type/serialization.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/stop_area.cpp b/source/type/stop_area.cpp index 94fdf53b6f..ba154bfdaf 100644 --- a/source/type/stop_area.cpp +++ b/source/type/stop_area.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/stop_area.h b/source/type/stop_area.h index 32a94581ef..227ab394a0 100644 --- a/source/type/stop_area.h +++ b/source/type/stop_area.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/stop_point.cpp b/source/type/stop_point.cpp index 0fe3e9cb41..3e2b235c4e 100644 --- a/source/type/stop_point.cpp +++ b/source/type/stop_point.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/stop_point.h b/source/type/stop_point.h index a884431e45..9587f98b43 100644 --- a/source/type/stop_point.h +++ b/source/type/stop_point.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/stop_time.cpp b/source/type/stop_time.cpp index 537b348783..7e9101c7b2 100644 --- a/source/type/stop_time.cpp +++ b/source/type/stop_time.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/stop_time.h b/source/type/stop_time.h index c90e77c906..ecf6ea7197 100644 --- a/source/type/stop_time.h +++ b/source/type/stop_time.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/accessible.cpp b/source/type/tests/accessible.cpp index d7945a26e1..b115b5d165 100644 --- a/source/type/tests/accessible.cpp +++ b/source/type/tests/accessible.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/aggregation_odt_test.cpp b/source/type/tests/aggregation_odt_test.cpp index b91491528a..5775b9d122 100644 --- a/source/type/tests/aggregation_odt_test.cpp +++ b/source/type/tests/aggregation_odt_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/associated_calendar_test.cpp b/source/type/tests/associated_calendar_test.cpp index 873250c39c..c3f85d560e 100644 --- a/source/type/tests/associated_calendar_test.cpp +++ b/source/type/tests/associated_calendar_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/code_container_test.cpp b/source/type/tests/code_container_test.cpp index aa5ef7aaa9..0c5e169d88 100644 --- a/source/type/tests/code_container_test.cpp +++ b/source/type/tests/code_container_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/comments_test.cpp b/source/type/tests/comments_test.cpp index 850089c18a..7603d0f556 100644 --- a/source/type/tests/comments_test.cpp +++ b/source/type/tests/comments_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/create_vj_test.cpp b/source/type/tests/create_vj_test.cpp index f56f324033..dd2a8746f0 100644 --- a/source/type/tests/create_vj_test.cpp +++ b/source/type/tests/create_vj_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/data_test.cpp b/source/type/tests/data_test.cpp index 8a9052c63c..3c5a6f5aca 100644 --- a/source/type/tests/data_test.cpp +++ b/source/type/tests/data_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/datetime.cpp b/source/type/tests/datetime.cpp index 5262b55429..4456a9540e 100644 --- a/source/type/tests/datetime.cpp +++ b/source/type/tests/datetime.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/fill_pb_object_tests.cpp b/source/type/tests/fill_pb_object_tests.cpp index 9cd8515579..971e2810e1 100644 --- a/source/type/tests/fill_pb_object_tests.cpp +++ b/source/type/tests/fill_pb_object_tests.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/fill_pb_placemark_test.cpp b/source/type/tests/fill_pb_placemark_test.cpp index cdf0156051..4410f5fe11 100644 --- a/source/type/tests/fill_pb_placemark_test.cpp +++ b/source/type/tests/fill_pb_placemark_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/headsign_test.cpp b/source/type/tests/headsign_test.cpp index 48320fafe5..ca345d5ebb 100644 --- a/source/type/tests/headsign_test.cpp +++ b/source/type/tests/headsign_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/multi_polygon_map_test.cpp b/source/type/tests/multi_polygon_map_test.cpp index 2ecd19c379..123eed2362 100644 --- a/source/type/tests/multi_polygon_map_test.cpp +++ b/source/type/tests/multi_polygon_map_test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/tests/test.cpp b/source/type/tests/test.cpp index 28399f1a70..4e2addc5f8 100644 --- a/source/type/tests/test.cpp +++ b/source/type/tests/test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -224,42 +224,42 @@ BOOST_AUTO_TEST_CASE(tz_handler_overflow_test) { BOOST_CHECK_EQUAL(build_dst_periods.begin()->first, 60 * 60 * 12); } -BOOST_AUTO_TEST_CASE(get_sections_stop_points) { +BOOST_AUTO_TEST_CASE(get_sections_ranks) { ed::builder b("20120614"); - // 0 1 0 2 3 0 4 2 - const auto* vj = b.vj("A")("0", "09:00"_t)("1", "09:00"_t)("0", "09:00"_t)("2", "09:00"_t)("3", "09:00"_t)( - "0", "09:00"_t)("4", "09:00"_t)("2", "09:00"_t)("5", "09:00"_t)("2", "09:00"_t) + + b.sa("0", 0, 0, false, true)("0a")("0b")("0c"); + // 0a 0b 1 0a 2 3 0a 0b 0c 4 2 5 2 + const auto* vj = b.vj("A")("0a", "09:00"_t)("0b", "09:00"_t)("1", "09:00"_t)("0a", "09:00"_t)("2", "09:00"_t)( + "3", "09:00"_t)("0a", "09:00"_t)("0b", "09:00"_t)("0c", "09:00"_t)("4", "09:00"_t)( + "2", "09:00"_t)("5", "09:00"_t)("2", "09:00"_t) .make(); b.data->pt_data->sort_and_index(); b.data->complete(); b.finish(); auto sa = [&](const std::string& id) { return b.get(id); }; - auto sp = [&](const std::string& id) { return b.get(id); }; - - // 0 1 0 2 3 0 4 2 5 2 - // * - BOOST_CHECK_EQUAL(vj->get_sections_stop_points(sa("1"), sa("1")), std::set({sp("1")})); - // 0 1 0 2 3 0 4 2 5 2 - // ******* - BOOST_CHECK_EQUAL(vj->get_sections_stop_points(sa("1"), sa("3")), - std::set({sp("1"), sp("0"), sp("2"), sp("3")})); - // 0 1 0 2 3 0 4 2 5 2 + + // 0a 0b 1 0a 2 3 0a 0b 0c 4 2 5 2 + // * + BOOST_CHECK_EQUAL(vj->get_sections_ranks(sa("1"), sa("1")), std::set({2})); + // 0a 0b 1 0a 2 3 0a 0b 0c 4 2 5 2 + // ******** + BOOST_CHECK_EQUAL(vj->get_sections_ranks(sa("1"), sa("3")), std::set({2, 3, 4, 5})); + // 0a 0b 1 0a 2 3 0a 0b 0c 4 2 5 2 // // 4 is after 0 -> empty - BOOST_CHECK_EQUAL(vj->get_sections_stop_points(sa("4"), sa("0")), std::set({})); - // 0 1 0 2 3 0 4 2 5 2 - // * * * + BOOST_CHECK_EQUAL(vj->get_sections_ranks(sa("4"), sa("0")), std::set({})); + // 0a 0b 1 0a 2 3 0a 0b 0c 4 2 5 2 + // ** ** ** ** ** ** // route point, only the corresponding stop point - BOOST_CHECK_EQUAL(vj->get_sections_stop_points(sa("0"), sa("0")), std::set({sp("0")})); - // 0 1 0 2 3 0 4 2 5 2 - // ***** + BOOST_CHECK_EQUAL(vj->get_sections_ranks(sa("0"), sa("0")), std::set({0, 1, 3, 6, 7, 8})); + // 0a 0b 1 0a 2 3 0a 0b 0c 4 2 5 2 + // ****** // shortest sections, thus we don't have 1 - BOOST_CHECK_EQUAL(vj->get_sections_stop_points(sa("0"), sa("3")), - std::set({sp("0"), sp("2"), sp("3")})); - // 0 1 0 2 3 0 4 2 5 2 - // *** ***** + BOOST_CHECK_EQUAL(vj->get_sections_ranks(sa("0"), sa("3")), std::set({3, 4, 5})); + // 0a 0b 1 0a 2 3 0a 0b 0c 4 2 5 2 + // **** ************ // shortest sections, thus we don't have 1, 3 and 5 - BOOST_CHECK_EQUAL(vj->get_sections_stop_points(sa("0"), sa("2")), - std::set({sp("0"), sp("2"), sp("4")})); + // We still have 0a 0b 0c in the second section since they are in the same area + BOOST_CHECK_EQUAL(vj->get_sections_ranks(sa("0"), sa("2")), std::set({3, 4, 6, 7, 8, 9, 10})); } diff --git a/source/type/time_duration.h b/source/type/time_duration.h index ac414b977c..7e6a50da2d 100644 --- a/source/type/time_duration.h +++ b/source/type/time_duration.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/timezone_manager.cpp b/source/type/timezone_manager.cpp index 6faeefb2ae..a0e218dd1c 100644 --- a/source/type/timezone_manager.cpp +++ b/source/type/timezone_manager.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/timezone_manager.h b/source/type/timezone_manager.h index 7adb69ad6b..7a3bd90a32 100644 --- a/source/type/timezone_manager.h +++ b/source/type/timezone_manager.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/type.cpp b/source/type/type.cpp index bc2e9038fb..f8fda6db6c 100644 --- a/source/type/type.cpp +++ b/source/type/type.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/type.h b/source/type/type.h index abc666cf70..7e2ef95c3e 100644 --- a/source/type/type.h +++ b/source/type/type.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/type_interfaces.cpp b/source/type/type_interfaces.cpp index 6da8de0c01..8769e3aac0 100644 --- a/source/type/type_interfaces.cpp +++ b/source/type/type_interfaces.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/type_interfaces.h b/source/type/type_interfaces.h index 47626bcfe3..c521b36a3a 100644 --- a/source/type/type_interfaces.h +++ b/source/type/type_interfaces.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/type_utils.cpp b/source/type/type_utils.cpp index 2c7f1e7701..763743fddc 100644 --- a/source/type/type_utils.cpp +++ b/source/type/type_utils.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/type_utils.h b/source/type/type_utils.h index eb34910cfe..aa4207f9de 100644 --- a/source/type/type_utils.h +++ b/source/type/type_utils.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/validity_pattern.cpp b/source/type/validity_pattern.cpp index 82202bf315..882837aa40 100644 --- a/source/type/validity_pattern.cpp +++ b/source/type/validity_pattern.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/validity_pattern.h b/source/type/validity_pattern.h index 07234f2b0d..db2a1606d3 100644 --- a/source/type/validity_pattern.h +++ b/source/type/validity_pattern.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/type/vehicle_journey.cpp b/source/type/vehicle_journey.cpp index 3c7f429ac1..996a9f989c 100644 --- a/source/type/vehicle_journey.cpp +++ b/source/type/vehicle_journey.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -199,14 +199,16 @@ ValidityPattern VehicleJourney::get_vp_of_sp(const StopPoint& sp, return vp_for_stop_time; } -ValidityPattern VehicleJourney::get_vp_for_section(const std::set& section, +ValidityPattern VehicleJourney::get_vp_for_section(const std::set& section, RTLevel rt_level, const boost::posix_time::time_period& period) const { ValidityPattern vp_for_section{validity_patterns[rt_level]->beginning_date}; auto pass_in_the_section = [&](const nt::StopTime& stop_time) { - // Return if not in the section - if (!section.count(stop_time.stop_point)) { + // We need to get the associated base stop_time to compare its rank + const auto base_st = stop_time.get_base_stop_time(); + // Return if not in the section or associated base not found + if (!base_st || !section.count(base_st->order())) { return; } const auto& beginning_date = validity_patterns[rt_level]->beginning_date; @@ -227,11 +229,10 @@ ValidityPattern VehicleJourney::get_vp_for_section(const std::set& s return vp_for_section; } -std::set VehicleJourney::get_sections_stop_points(const StopArea* start_stop, - const StopArea* end_stop) const { +std::set VehicleJourney::get_sections_ranks(const StopArea* start_sa, const StopArea* end_sa) const { /* - * Identify all the smallest sections starting with start_stop and - * ending with end_stop. Then we return the set of stop points + * Identify all the smallest sections starting with start_sa and + * ending with end_sa. Then we return the list of ranks * corresponding to the identified sections. * * For example, if we want the section A B: @@ -239,6 +240,16 @@ std::set VehicleJourney::get_sections_stop_points(const StopArea* st * *** *** * we return {A, B} (not everything) * + * Since sections are defined by two stop_areas not stop_points we want to return the smallest + * sections between stop_areas. If we have consecutive stop_points in one of the starting or + * ending area we need to take them all. + * + * Same example for A B : + * A1 A2 B1 C1 D1 E1 A1 A2 B1 B2 + * ****** ********* + * + * we return {A1, A2, B1} and {A1, A2, B1, B2} + * * Note: * * We are checking if the journey pass first by the start_point of @@ -267,8 +278,9 @@ std::set VehicleJourney::get_sections_stop_points(const StopArea* st * - s1/s2 from the 5th to the 10th, * - s1/s2/s5 from the 11th to the 15th * */ - std::set res; - boost::optional start_idx; + std::set res; + boost::optional section_start_rank; + bool section_starting = false, section_ending = false; const auto* base_vj = this->get_corresponding_base(); const auto* vj = base_vj ? base_vj : this; for (const auto& st : vj->stop_time_list) { @@ -276,22 +288,44 @@ std::set VehicleJourney::get_sections_stop_points(const StopArea* st if (!st.stop_point || !st.stop_point->stop_area) { continue; } + const auto* sa = st.stop_point->stop_area; - // we want the shortest section, thus, we set the idx each - // time we see it - if (st.stop_point->stop_area->idx == start_stop->idx) { - start_idx = st.order(); + // Must close section before potentially starting a new one + // Keep going if where are still in the end stop area + if (section_ending && end_sa->idx != sa->idx) { + for (uint16_t i = *section_start_rank, last = st.order() - 1; i <= last; ++i) { + res.insert(i); + } + // the section is finished, we are no more in a section + section_start_rank = boost::none; + section_starting = false; + section_ending = false; } - // we want the shortest section, thus, we finish the section - // as soon as we see the end stop - if (start_idx && st.stop_point->stop_area->idx == end_stop->idx) { - for (uint16_t i = *start_idx, last = st.order(); i <= last; ++i) { - res.insert(vj->stop_time_list[i].stop_point); + // we want the shortest section, thus, we set the idx each + // time we see it, except if we are in the same area than the start idx + // Reset section_start_rank if the previous area was different + if (sa->idx == start_sa->idx) { + if (!section_starting) { + section_starting = true; + section_start_rank = st.order(); } + } else { + section_starting = false; + } - // the section is finished, we are no more in a section - start_idx = boost::none; + // we want the shortest section, thus, we mark the section + // as ending as soon as we see the end stop + // We must continue until we leave the stop_area + if (section_start_rank && sa->idx == end_sa->idx) { + section_ending = true; + } + } + + // Must close a potential section + if (section_ending) { + for (uint16_t i = *section_start_rank; i <= vj->stop_time_list.size() - 1; ++i) { + res.insert(i); } } return res; diff --git a/source/type/vehicle_journey.h b/source/type/vehicle_journey.h index 43e0be4315..d525ec72ba 100644 --- a/source/type/vehicle_journey.h +++ b/source/type/vehicle_journey.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ @@ -128,12 +128,12 @@ struct VehicleJourney : public Header, Nameable, hasVehicleProperties { const boost::posix_time::time_period& period) const; // Return the vp for all the stops of the section - ValidityPattern get_vp_for_section(const std::set& bounds_st, + ValidityPattern get_vp_for_section(const std::set& bounds_st, RTLevel rt_level, const boost::posix_time::time_period& period) const; - // return all the stoppoints of the base vj between the 2 stop areas - std::set get_sections_stop_points(const StopArea*, const StopArea*) const; + // return all the sections of the base vj between the 2 stop areas + std::set get_sections_ranks(const StopArea*, const StopArea*) const; // return the time period of circulation of the vj for one day boost::posix_time::time_period execution_period(const boost::gregorian::date& date) const; diff --git a/source/tyr/api_v1.md b/source/tyr/api_v1.md index c211f41bfd..519b7fd56f 100644 --- a/source/tyr/api_v1.md +++ b/source/tyr/api_v1.md @@ -45,7 +45,8 @@ If lots of elements expected in the response: } ``` -- POST /v1/: +- POST /v1/: +Used to create a new element of the endpoint. Returned status code should be **201**. ``` { "endpoint": [ @@ -56,7 +57,9 @@ If lots of elements expected in the response: } ``` -- PUT /v1/: +- PUT /v1/: +Used to update a new element of the endpoint. Returned status code should be **200**. +Note: If the POST method isn't available for an endpoint, PUT can be used to create a new element. In this case, the returned status code should be **201** ``` { "endpoint": [ diff --git a/source/tyr/manage_tyr.py b/source/tyr/manage_tyr.py index 5f4c140ec9..4efa43d1af 100755 --- a/source/tyr/manage_tyr.py +++ b/source/tyr/manage_tyr.py @@ -26,7 +26,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/migrations/env.py b/source/tyr/migrations/env.py index 4e0dfbf6dc..d711c335bd 100644 --- a/source/tyr/migrations/env.py +++ b/source/tyr/migrations/env.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/migrations/versions/1fd68e6d0456_.py b/source/tyr/migrations/versions/1fd68e6d0456_.py index 2f7dd7f0e8..f2c37d730e 100644 --- a/source/tyr/migrations/versions/1fd68e6d0456_.py +++ b/source/tyr/migrations/versions/1fd68e6d0456_.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/migrations/versions/423e8da9d857_.py b/source/tyr/migrations/versions/423e8da9d857_.py index 4b809e5a8f..9958b79abf 100644 --- a/source/tyr/migrations/versions/423e8da9d857_.py +++ b/source/tyr/migrations/versions/423e8da9d857_.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/migrations/versions/d1d12707b76_add_discarded_instance.py b/source/tyr/migrations/versions/d1d12707b76_add_discarded_instance.py index 418ecf35af..40cd593484 100644 --- a/source/tyr/migrations/versions/d1d12707b76_add_discarded_instance.py +++ b/source/tyr/migrations/versions/d1d12707b76_add_discarded_instance.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/setup.py b/source/tyr/setup.py index 58662ad61a..9958d10459 100644 --- a/source/tyr/setup.py +++ b/source/tyr/setup.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/check_utils.py b/source/tyr/tests/check_utils.py index ba6ca15eaa..84587af2d6 100644 --- a/source/tyr/tests/check_utils.py +++ b/source/tyr/tests/check_utils.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io import os diff --git a/source/tyr/tests/conftest.py b/source/tyr/tests/conftest.py index 9da0e8da02..2289bf4993 100644 --- a/source/tyr/tests/conftest.py +++ b/source/tyr/tests/conftest.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/__init__.py b/source/tyr/tests/integration/__init__.py index 82157c8460..30c7692cf1 100644 --- a/source/tyr/tests/integration/__init__.py +++ b/source/tyr/tests/integration/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/autocomplete_test.py b/source/tyr/tests/integration/autocomplete_test.py index a1f78eaf73..1d5e4fc179 100644 --- a/source/tyr/tests/integration/autocomplete_test.py +++ b/source/tyr/tests/integration/autocomplete_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/bss_configuration_test.py b/source/tyr/tests/integration/bss_configuration_test.py index f10c03bfcf..bb1c3b9f4b 100644 --- a/source/tyr/tests/integration/bss_configuration_test.py +++ b/source/tyr/tests/integration/bss_configuration_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/conftest.py b/source/tyr/tests/integration/conftest.py index e00dc3d17f..5e04b48d2c 100644 --- a/source/tyr/tests/integration/conftest.py +++ b/source/tyr/tests/integration/conftest.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/datapost_test.py b/source/tyr/tests/integration/datapost_test.py index 0a93e7a337..8dd8907434 100644 --- a/source/tyr/tests/integration/datapost_test.py +++ b/source/tyr/tests/integration/datapost_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/dataset_delete_by_type_test.py b/source/tyr/tests/integration/dataset_delete_by_type_test.py index 2fad868cef..11ae91230d 100644 --- a/source/tyr/tests/integration/dataset_delete_by_type_test.py +++ b/source/tyr/tests/integration/dataset_delete_by_type_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/endpoints_test.py b/source/tyr/tests/integration/endpoints_test.py index e12bf56390..151ad2dd68 100644 --- a/source/tyr/tests/integration/endpoints_test.py +++ b/source/tyr/tests/integration/endpoints_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/equipment_providers_test.py b/source/tyr/tests/integration/equipment_providers_test.py index 424951148e..625d5ab56e 100644 --- a/source/tyr/tests/integration/equipment_providers_test.py +++ b/source/tyr/tests/integration/equipment_providers_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -105,8 +105,10 @@ def test_equipments_provider_put(default_equipments_config): check=False, ) assert status == 201 - assert 'message' in resp - assert resp['message'] == 'Provider sytral3 is created' + assert 'equipments_provider' in resp + assert len(resp['equipments_provider']) == 1 + for key in new_provider.keys(): + assert resp['equipments_provider'][0][key] == new_provider[key] resp = api_get('/v0/equipments_providers') assert 'equipments_providers' in resp @@ -117,8 +119,10 @@ def test_equipments_provider_put(default_equipments_config): resp = api_put( 'v0/equipments_providers/sytral3', data=ujson.dumps(new_provider), content_type='application/json' ) - assert 'message' in resp - assert resp['message'] == 'Provider sytral3 from db is updated' + assert 'equipments_provider' in resp + assert len(resp['equipments_provider']) == 1 + for key in new_provider.keys(): + assert resp['equipments_provider'][0][key] == new_provider[key] resp = api_get('/v0/equipments_providers/sytral3') assert 'equipments_providers' in resp diff --git a/source/tyr/tests/integration/instance_test.py b/source/tyr/tests/integration/instance_test.py index 561e605e1d..70d80c16f9 100644 --- a/source/tyr/tests/integration/instance_test.py +++ b/source/tyr/tests/integration/instance_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -124,6 +124,12 @@ def test_update_instances(create_instance): "max_extra_second_pass": 1, "additional_time_after_first_section_taxi": 42, "additional_time_before_last_section_taxi": 789, + "max_walking_direct_path_duration": 789, + "max_bike_direct_path_duration": 856, + "max_bss_direct_path_duration": 6489, + "max_car_direct_path_duration": 2323, + "max_taxi_direct_path_duration": 4206, + "max_ridesharing_direct_path_duration": 456, "street_network_car": "taxiKraken", "street_network_walking": "taxiKraken", "street_network_bike": "taxiKraken", @@ -382,6 +388,32 @@ def test_update_additional_time_for_taxi(create_instance): assert resp[0]['additional_time_before_last_section_taxi'] == 3637 +def test_update_max_mode_direct_path_duration(create_instance): + resp = api_get('/v0/instances/fr') + assert resp[0]['max_walking_direct_path_duration'] == 86400 + assert resp[0]['max_bike_direct_path_duration'] == 86400 + assert resp[0]['max_bss_direct_path_duration'] == 86400 + assert resp[0]['max_car_direct_path_duration'] == 86400 + assert resp[0]['max_taxi_direct_path_duration'] == 86400 + assert resp[0]['max_ridesharing_direct_path_duration'] == 86400 + + params = { + 'max_walking_direct_path_duration': 3475, + 'max_bike_direct_path_duration': 9512, + 'max_bss_direct_path_duration': 7456, + 'max_car_direct_path_duration': 3214, + 'max_taxi_direct_path_duration': 1523, + 'max_ridesharing_direct_path_duration': 4456, + } + resp = api_put('/v0/instances/fr', data=json.dumps(params), content_type='application/json') + for key in params.keys(): + assert resp[key] == params[key] + + resp = api_get('/v0/instances/fr') + for key in params.keys(): + assert resp[0][key] == params[key] + + def test_update_forgotten_attributs_in_backend(create_instance): resp = api_get('/v0/instances/fr') assert resp[0]['max_additional_connections'] == 2 diff --git a/source/tyr/tests/integration/mimir_test.py b/source/tyr/tests/integration/mimir_test.py index 99a3453f22..d11748ef8d 100644 --- a/source/tyr/tests/integration/mimir_test.py +++ b/source/tyr/tests/integration/mimir_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/poi_type_json_test.py b/source/tyr/tests/integration/poi_type_json_test.py index af65aa9324..140302e381 100644 --- a/source/tyr/tests/integration/poi_type_json_test.py +++ b/source/tyr/tests/integration/poi_type_json_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/purge_test.py b/source/tyr/tests/integration/purge_test.py index 9c863cddd5..a09bc7961e 100644 --- a/source/tyr/tests/integration/purge_test.py +++ b/source/tyr/tests/integration/purge_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/streetnetwork_backends_test.py b/source/tyr/tests/integration/streetnetwork_backends_test.py index cd69d42191..4ab442af2e 100644 --- a/source/tyr/tests/integration/streetnetwork_backends_test.py +++ b/source/tyr/tests/integration/streetnetwork_backends_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/users_test.py b/source/tyr/tests/integration/users_test.py index 06721bca8a..2dd113f021 100644 --- a/source/tyr/tests/integration/users_test.py +++ b/source/tyr/tests/integration/users_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tests/integration/v1_test.py b/source/tyr/tests/integration/v1_test.py index 137bb98690..cd24ff0b81 100644 --- a/source/tyr/tests/integration/v1_test.py +++ b/source/tyr/tests/integration/v1_test.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -81,6 +81,18 @@ def create_api(): models.db.session.delete(api) +@pytest.fixture +def create_autocomplete_parameters(): + with app.app_context(): + autocomp = models.AutocompleteParameter(name='autocomp_name') + models.db.session.add(autocomp) + models.db.session.commit() + + yield autocomp.name + + models.db.session.delete(autocomp) + + def check_v1_response(endpoint, request=None): if not request: request = endpoint @@ -197,3 +209,151 @@ def test_authorization_methods(create_5_users, create_instance, create_api): '/v1/users/{}/authorizations'.format(user_id), data=json.dumps(auth), content_type='application/json' ) assert len(resp_delete['user']['authorizations']) == 0 + + +def test_autocomplete_parameters(create_autocomplete_parameters): + check_v1_response('autocomplete_parameters') + check_v1_response( + 'autocomplete_parameters', 'autocomplete_parameters/{}'.format(create_autocomplete_parameters) + ) + + +def test_autocomplete_parameters_methods(): + resp_get = api_get('/v1/autocomplete_parameters') + assert 'autocomplete_parameters' in resp_get + initial_num = len(resp_get['autocomplete_parameters']) + assert initial_num == 0 + + autocomplete_data = { + 'street': 'OSM', + 'name': 'france', + 'address': 'BANO', + 'admin': 'COSMOGONY', + 'poi': 'OSM', + } + resp_post, status_post = api_post( + '/v1/autocomplete_parameters', + data=json.dumps(autocomplete_data), + content_type='application/json', + check=False, + ) + assert status_post == 201 + assert 'autocomplete_parameters' in resp_post + assert len(resp_post['autocomplete_parameters']) == 1 + for key in autocomplete_data.keys(): + assert resp_post['autocomplete_parameters'][0][key] == autocomplete_data[key] + autocomplete_name = resp_post['autocomplete_parameters'][0]['name'] + + resp_get = api_get('/v1/autocomplete_parameters') + assert 'autocomplete_parameters' in resp_get + assert len(resp_get['autocomplete_parameters']) == initial_num + 1 + assert resp_get['autocomplete_parameters'][0]['name'] == autocomplete_name + for key in autocomplete_data.keys(): + assert resp_get['autocomplete_parameters'][0][key] == autocomplete_data[key] + + autocomplete_data_update = {'address': 'OA'} + resp_put = api_put( + '/v1/autocomplete_parameters/{}'.format(autocomplete_name), + data=json.dumps(autocomplete_data_update), + content_type='application/json', + ) + assert 'autocomplete_parameters' in resp_put + assert len(resp_put['autocomplete_parameters']) == 1 + + resp_get = api_get('/v1/autocomplete_parameters') + assert 'autocomplete_parameters' in resp_get + assert len(resp_get['autocomplete_parameters']) == initial_num + 1 + assert resp_get['autocomplete_parameters'][0]['name'] == autocomplete_name + assert resp_get['autocomplete_parameters'][0]['address'] == autocomplete_data_update['address'] + + resp_delete, status_delete = api_delete( + '/v1/autocomplete_parameters/{}'.format(autocomplete_name), check=False, no_json=True + ) + assert status_delete == 204 + + resp_get = api_get('/v1/autocomplete_parameters') + assert 'autocomplete_parameters' in resp_get + assert len(resp_get['autocomplete_parameters']) == initial_num + + +def test_billing_plans(): + check_v1_response('billing_plans') + + +def test_billing_plans_methods(): + resp_get = api_get('/v1/billing_plans') + assert 'billing_plans' in resp_get + initial_num = len(resp_get['billing_plans']) + + billing_plan_data = {'name': 'tyr_v1_plan', 'default': False} + resp_post, status_post = api_post( + '/v1/billing_plans', data=json.dumps(billing_plan_data), content_type='application/json', check=False + ) + assert status_post == 201 + assert 'billing_plan' in resp_post + assert len(resp_post['billing_plan']) == 1 + billing_plan_id = resp_post['billing_plan'][0]['id'] + + resp_get = api_get('/v1/billing_plans') + assert 'billing_plans' in resp_get + assert len(resp_get['billing_plans']) == initial_num + 1 + + billing_plan_data_update = {'max_object_count': 1000} + resp_put = api_put( + '/v1/billing_plans/{}'.format(billing_plan_id), + data=json.dumps(billing_plan_data_update), + content_type='application/json', + ) + assert 'billing_plan' in resp_put + assert len(resp_put['billing_plan']) == 1 + assert resp_put['billing_plan'][0]['max_object_count'] == billing_plan_data_update['max_object_count'] + + resp_delete, status_delete = api_delete( + '/v1/billing_plans/{}'.format(billing_plan_id), check=False, no_json=True + ) + assert status_delete == 204 + + resp_get = api_get('/v1/billing_plans') + assert 'billing_plans' in resp_get + assert len(resp_get['billing_plans']) == initial_num + + +def test_end_points(): + check_v1_response('end_points') + + +def test_end_points_methods(): + resp_get = api_get('/v1/end_points') + assert 'end_points' in resp_get + initial_num = len(resp_get['end_points']) + + endpoint_data = {'name': 'tyr_v1', 'hostnames': ['host_v1']} + resp_post, status_post = api_post( + '/v1/end_points', data=json.dumps(endpoint_data), content_type='application/json', check=False + ) + assert status_post == 201 + assert 'end_point' in resp_post + assert len(resp_post['end_point']) == 1 + assert resp_post['end_point'][0]['name'] == endpoint_data['name'] + endpoint_id = resp_post['end_point'][0]['id'] + + resp_get = api_get('/v1/end_points') + assert 'end_points' in resp_get + assert len(resp_get['end_points']) == initial_num + 1 + + endpoint_data_update = {'name': 'Tyr_v1_update'} + resp_put = api_put( + '/v1/end_points/{}'.format(endpoint_id), + data=json.dumps(endpoint_data_update), + content_type='application/json', + ) + assert 'end_point' in resp_put + assert len(resp_put['end_point']) == 1 + assert resp_put['end_point'][0]['name'] == endpoint_data_update['name'] + + resp_delete, status_delete = api_delete('/v1/end_points/{}'.format(endpoint_id), check=False, no_json=True) + assert status_delete == 204 + + resp_get = api_get('/v1/end_points') + assert 'end_points' in resp_get + assert len(resp_get['end_points']) == initial_num diff --git a/source/tyr/tyr/__init__.py b/source/tyr/tyr/__init__.py index fa66823a05..02f620ee9e 100644 --- a/source/tyr/tyr/__init__.py +++ b/source/tyr/tyr/__init__.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/api.py b/source/tyr/tyr/api.py index faef07e527..89e987c113 100644 --- a/source/tyr/tyr/api.py +++ b/source/tyr/tyr/api.py @@ -26,7 +26,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -63,7 +63,12 @@ api.add_resource(resources.Job, '/v0/jobs/', '/v0/jobs//', endpoint=str('jobs')) -api.add_resource(resources.EndPoint, '/v0/end_points/', '/v0/end_points//', endpoint=str('end_points')) +api.add_resource( + resources.EndPoint, + '/v/end_points/', + '/v/end_points//', + endpoint=str('end_points'), +) api.add_resource( resources.TravelerProfile, @@ -71,12 +76,18 @@ '/v0/instances//traveler_profiles/', ) -api.add_resource(resources.BillingPlan, '/v0/billing_plans/', '/v0/billing_plans/') +api.add_resource( + resources.BillingPlan, + '/v/billing_plans/', + '/v/billing_plans/', +) api.add_resource(resources.InstancePoiType, '/v0/instances//poi_types') api.add_resource( - resources.AutocompleteParameter, '/v0/autocomplete_parameters/', '/v0/autocomplete_parameters/' + resources.AutocompleteParameter, + '/v/autocomplete_parameters/', + '/v/autocomplete_parameters/', ) api.add_resource(resources.AutocompletePoiType, '/v0/autocomplete_parameters//poi_types') diff --git a/source/tyr/tyr/binarisation.py b/source/tyr/tyr/binarisation.py index 821bace025..9aa457c700 100644 --- a/source/tyr/tyr/binarisation.py +++ b/source/tyr/tyr/binarisation.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/__init__.py b/source/tyr/tyr/command/__init__.py index 93562c6aef..4c2f6eb957 100644 --- a/source/tyr/tyr/command/__init__.py +++ b/source/tyr/tyr/command/__init__.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/bounding_shape.py b/source/tyr/tyr/command/bounding_shape.py index 139670ffee..c8fe2fdd52 100644 --- a/source/tyr/tyr/command/bounding_shape.py +++ b/source/tyr/tyr/command/bounding_shape.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/build_data.py b/source/tyr/tyr/command/build_data.py index 58405fa8aa..c15d5b56f1 100644 --- a/source/tyr/tyr/command/build_data.py +++ b/source/tyr/tyr/command/build_data.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/cities.py b/source/tyr/tyr/command/cities.py index 11c0c1c855..6a6643761b 100644 --- a/source/tyr/tyr/command/cities.py +++ b/source/tyr/tyr/command/cities.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/import_last_autocomplete_dataset.py b/source/tyr/tyr/command/import_last_autocomplete_dataset.py index c466fdc99c..c4ab41130a 100644 --- a/source/tyr/tyr/command/import_last_autocomplete_dataset.py +++ b/source/tyr/tyr/command/import_last_autocomplete_dataset.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/import_last_dataset.py b/source/tyr/tyr/command/import_last_dataset.py index 12742d112e..72e93cf8f2 100644 --- a/source/tyr/tyr/command/import_last_dataset.py +++ b/source/tyr/tyr/command/import_last_dataset.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/last_dataset.py b/source/tyr/tyr/command/last_dataset.py index 106e9f81ba..5c7da4e637 100644 --- a/source/tyr/tyr/command/last_dataset.py +++ b/source/tyr/tyr/command/last_dataset.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/load_data.py b/source/tyr/tyr/command/load_data.py index baeab4f12c..81c5014b72 100644 --- a/source/tyr/tyr/command/load_data.py +++ b/source/tyr/tyr/command/load_data.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/purge.py b/source/tyr/tyr/command/purge.py index cc7a215401..5e81642a5b 100644 --- a/source/tyr/tyr/command/purge.py +++ b/source/tyr/tyr/command/purge.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/command/reload_kraken.py b/source/tyr/tyr/command/reload_kraken.py index bccae68edf..33a5e28460 100644 --- a/source/tyr/tyr/command/reload_kraken.py +++ b/source/tyr/tyr/command/reload_kraken.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/fields.py b/source/tyr/tyr/fields.py index a1c660fefe..bceec41052 100644 --- a/source/tyr/tyr/fields.py +++ b/source/tyr/tyr/fields.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -167,6 +167,12 @@ def format(self, value): 'street_network_bss': FieldUrlStreetNetworkBackend(), 'street_network_ridesharing': FieldUrlStreetNetworkBackend(), 'street_network_taxi': FieldUrlStreetNetworkBackend(), + 'max_walking_direct_path_duration': fields.Raw, + 'max_bike_direct_path_duration': fields.Raw, + 'max_bss_direct_path_duration': fields.Raw, + 'max_car_direct_path_duration': fields.Raw, + 'max_taxi_direct_path_duration': fields.Raw, + 'max_ridesharing_direct_path_duration': fields.Raw, } api_fields = {'id': fields.Raw, 'name': fields.Raw} diff --git a/source/tyr/tyr/formats.py b/source/tyr/tyr/formats.py index 7dab320f99..f734e2bc55 100644 --- a/source/tyr/tyr/formats.py +++ b/source/tyr/tyr/formats.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/helper.py b/source/tyr/tyr/helper.py index 246a86e821..7ded2b76bb 100644 --- a/source/tyr/tyr/helper.py +++ b/source/tyr/tyr/helper.py @@ -24,7 +24,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/tyr/tyr/resources.py b/source/tyr/tyr/resources.py index 008f76eaf4..7e3e13a8e1 100644 --- a/source/tyr/tyr/resources.py +++ b/source/tyr/tyr/resources.py @@ -25,7 +25,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io @@ -643,6 +643,13 @@ def put(self, version=0, id=None, name=None): location=('json', 'values'), default=getattr(instance, "street_network_{}".format(mode)), ) + parser.add_argument( + 'max_{}_direct_path_duration'.format(mode), + type=int, + help='maximum duration of direct path for the mode {}'.format(mode), + location=('json', 'values'), + default=getattr(instance, "max_{}_direct_path_duration".format(mode)), + ) args = parser.parse_args() @@ -702,6 +709,12 @@ def map_args_to_instance(attr_name): 'street_network_bss', 'street_network_ridesharing', 'street_network_taxi', + 'max_walking_direct_path_duration', + 'max_bike_direct_path_duration', + 'max_bss_direct_path_duration', + 'max_car_direct_path_duration', + 'max_taxi_direct_path_duration', + 'max_ridesharing_direct_path_duration', ], ) max_nb_crowfly_by_mode = args.get('max_nb_crowfly_by_mode') @@ -1190,13 +1203,15 @@ def post(self, user_id, version=0): class EndPoint(flask_restful.Resource): - @marshal_with(end_point_fields) - def get(self): - return models.EndPoint.query.all() + def get(self, version=0): + resp = marshal(models.EndPoint.query.all(), end_point_fields) + if version == 1: + return {'end_points': resp} + return resp - def post(self): + def post(self, version=0): parser = reqparse.RequestParser() - parser.add_argument('name', type=unicode, required=True, help='name of the endpoint', location=('json')) + parser.add_argument('name', type=unicode, required=True, help='name of the endpoint', location='json') args = parser.parse_args() try: @@ -1214,13 +1229,19 @@ def post(self): tyr_events_rabbit_mq.request(tyr_end_point_event) except (sqlalchemy.exc.IntegrityError, sqlalchemy.orm.exc.FlushError) as e: - return ({'error': str(e)}, 409) + return {'error': str(e)}, 409 except Exception: logging.exception("fail") raise - return marshal(end_point, end_point_fields) + resp = marshal(end_point, end_point_fields) + if version == 1: + return {'end_point': [resp]}, 201 + return resp + + def put(self, version=0, id=None): + if not id: + abort(400, status="error", message='id is required') - def put(self, id): end_point = models.EndPoint.query.get_or_404(id) parser = reqparse.RequestParser() parser.add_argument( @@ -1243,13 +1264,19 @@ def put(self, id): tyr_events_rabbit_mq.request(tyr_end_point_event) except (sqlalchemy.exc.IntegrityError, sqlalchemy.orm.exc.FlushError) as e: - return ({'error': str(e)}, 409) + return {'error': str(e)}, 409 except Exception: logging.exception("fail") raise - return marshal(end_point, end_point_fields) + resp = marshal(end_point, end_point_fields) + if version == 1: + return {'end_point': [resp]} + return resp + + def delete(self, version=0, id=None): + if not id: + abort(400, status="error", message='id is required') - def delete(self, id): end_point = models.EndPoint.query.get_or_404(id) try: db.session.delete(end_point) @@ -1262,7 +1289,7 @@ def delete(self, id): except Exception: logging.exception("fail") raise - return ({}, 204) + return {}, 204 class TravelerProfile(flask_restful.Resource): @@ -1437,15 +1464,17 @@ def delete(self, name=None, traveler_type=None): class BillingPlan(flask_restful.Resource): - def get(self, billing_plan_id=None): + def get(self, version=0, billing_plan_id=None): if billing_plan_id: - billing_plan = models.BillingPlan.query.get_or_404(billing_plan_id) - return marshal(billing_plan, billing_plan_fields_full) + billing_plans = models.BillingPlan.query.get_or_404(billing_plan_id) else: billing_plans = models.BillingPlan.query.all() - return marshal(billing_plans, billing_plan_fields_full) + resp = marshal(billing_plans, billing_plan_fields_full) + if version == 1: + return {'billing_plans': resp} + return resp - def post(self): + def post(self, version=0): parser = reqparse.RequestParser() parser.add_argument( 'name', @@ -1488,7 +1517,7 @@ def post(self): end_point = models.EndPoint.get_default() if not end_point: - return ({'error': 'end_point doesn\'t exist'}, 400) + return {'error': 'end_point doesn\'t exist'}, 400 try: billing_plan = models.BillingPlan( @@ -1500,12 +1529,18 @@ def post(self): billing_plan.end_point = end_point db.session.add(billing_plan) db.session.commit() - return marshal(billing_plan, billing_plan_fields_full) + resp = marshal(billing_plan, billing_plan_fields_full) + if version == 1: + return {'billing_plan': [resp]}, 201 + return resp except Exception: logging.exception("fail") raise - def put(self, billing_plan_id=None): + def put(self, version=0, billing_plan_id=None): + if not id: + abort(400, status="error", message='billing_plan_id is required') + billing_plan = models.BillingPlan.query.get_or_404(billing_plan_id) parser = reqparse.RequestParser() parser.add_argument( @@ -1551,7 +1586,7 @@ def put(self, billing_plan_id=None): end_point = models.EndPoint.query.get(args['end_point_id']) if not end_point: - return ({'error': 'end_point doesn\'t exist'}, 400) + return {'error': 'end_point doesn\'t exist'}, 400 try: billing_plan.name = args['name'] @@ -1560,34 +1595,39 @@ def put(self, billing_plan_id=None): billing_plan.default = args['default'] billing_plan.end_point = end_point db.session.commit() - return marshal(billing_plan, billing_plan_fields_full) + resp = marshal(billing_plan, billing_plan_fields_full) + if version == 1: + return {'billing_plan': [resp]} + return resp except Exception: logging.exception("fail") raise - def delete(self, billing_plan_id=None): + def delete(self, version=0, billing_plan_id=None): billing_plan = models.BillingPlan.query.get_or_404(billing_plan_id) try: db.session.delete(billing_plan) db.session.commit() except (sqlalchemy.exc.IntegrityError, sqlalchemy.orm.exc.FlushError): - return ({'error': 'billing_plan used'}, 409) # Conflict + return {'error': 'billing_plan used'}, 409 # Conflict except Exception: logging.exception("fail") raise - return ({}, 204) + return {}, 204 class AutocompleteParameter(flask_restful.Resource): - def get(self, name=None): + def get(self, version=0, name=None): if name: - autocomplete_param = models.AutocompleteParameter.query.filter_by(name=name).first_or_404() - return marshal(autocomplete_param, autocomplete_parameter_fields) + autocomplete_params = models.AutocompleteParameter.query.filter_by(name=name).first_or_404() else: autocomplete_params = models.AutocompleteParameter.query.all() - return marshal(autocomplete_params, autocomplete_parameter_fields) + resp = marshal(autocomplete_params, autocomplete_parameter_fields) + if version == 1: + return {'autocomplete_parameters': resp} + return resp - def post(self): + def post(self, version=0): parser = reqparse.RequestParser() parser.add_argument( 'name', @@ -1650,13 +1690,17 @@ def post(self): create_autocomplete_depot.delay(autocomplete_parameter.name) except (sqlalchemy.exc.IntegrityError, sqlalchemy.orm.exc.FlushError): - return ({'error': 'duplicate name'}, 409) + return {'error': 'duplicate name'}, 409 except Exception: logging.exception("fail") raise - return marshal(autocomplete_parameter, autocomplete_parameter_fields) - def put(self, name=None): + resp = marshal(autocomplete_parameter, autocomplete_parameter_fields) + if version == 1: + return {'autocomplete_parameters': [resp]}, 201 + return resp + + def put(self, version=0, name=None): autocomplete_param = models.AutocompleteParameter.query.filter_by(name=name).first_or_404() parser = reqparse.RequestParser() parser.add_argument( @@ -1713,9 +1757,13 @@ def put(self, name=None): except Exception: logging.exception("fail") raise - return marshal(autocomplete_param, autocomplete_parameter_fields) - def delete(self, name=None): + resp = marshal(autocomplete_param, autocomplete_parameter_fields) + if version == 1: + return {'autocomplete_parameters': [resp]} + return resp + + def delete(self, version=0, name=None): autocomplete_param = models.AutocompleteParameter.query.filter_by(name=name).first_or_404() try: remove_autocomplete_depot.delay(name) @@ -1724,7 +1772,7 @@ def delete(self, name=None): except Exception: logging.exception("fail") raise - return ({}, 204) + return None, 204 class InstanceDataset(flask_restful.Resource): @@ -2023,11 +2071,9 @@ def _validate_input(json_data): try: provider = models.EquipmentsProvider.find_by_id(id) status = 200 - message["message"] = "Provider {} from db is updated".format(id) except sqlalchemy.orm.exc.NoResultFound: provider = models.EquipmentsProvider(id) models.db.session.add(provider) - message["message"] = "Provider {} is created".format(id) status = 201 provider.from_json(input_json) @@ -2035,7 +2081,7 @@ def _validate_input(json_data): models.db.session.commit() except sqlalchemy.exc.IntegrityError as ex: abort(400, status="error", message=str(ex)) - return message, status + return {'equipments_provider': [marshal(provider, equipment_provider_fields)]}, status def delete(self, id=None): """ diff --git a/source/tyr/tyr/tasks.py b/source/tyr/tyr/tasks.py index beaa482421..3654bcd2fa 100644 --- a/source/tyr/tyr/tasks.py +++ b/source/tyr/tyr/tasks.py @@ -23,7 +23,7 @@ # # Stay tuned using # twitter @navitia -# IRC #navitia on freenode +# channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org # https://groups.google.com/d/forum/navitia # www.navitia.io diff --git a/source/utils b/source/utils index 3a188c95eb..f86e6eb15c 160000 --- a/source/utils +++ b/source/utils @@ -1 +1 @@ -Subproject commit 3a188c95eb7cc376304df5793bfbec24d3e5e1d3 +Subproject commit f86e6eb15c0d0e84cae8cd6541239592fb5daae4 diff --git a/source/vptranslator/test.cpp b/source/vptranslator/test.cpp index d2abc94f3f..b806bceac0 100644 --- a/source/vptranslator/test.cpp +++ b/source/vptranslator/test.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/vptranslator/vptranslator.cpp b/source/vptranslator/vptranslator.cpp index 0ae27f6124..8406a41118 100644 --- a/source/vptranslator/vptranslator.cpp +++ b/source/vptranslator/vptranslator.cpp @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ diff --git a/source/vptranslator/vptranslator.h b/source/vptranslator/vptranslator.h index 8ac8decd6b..1f8c6a397a 100644 --- a/source/vptranslator/vptranslator.h +++ b/source/vptranslator/vptranslator.h @@ -23,7 +23,7 @@ along with this program. If not, see . Stay tuned using twitter @navitia -IRC #navitia on freenode +channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */