Skip to content

Commit

Permalink
Merge pull request #189 from ibi-group/upstream-merge-2023-10-20
Browse files Browse the repository at this point in the history
Upstream merge 2023-10-20
  • Loading branch information
miles-grant-ibigroup authored Oct 24, 2023
2 parents ec48631 + 3867083 commit ff6c6bd
Show file tree
Hide file tree
Showing 147 changed files with 4,041 additions and 1,593 deletions.
15 changes: 11 additions & 4 deletions ISSUE_TEMPLATE → .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
---
name: Bug report
about: Report a bug or issue
title: ''
labels: ''
assignees: ''

---

**NOTE:** this issue system is intended for reporting bugs and tracking progress in software
development. For all other usage and software development questions or discussion, please write to
the user mailing list(https://groups.google.com/forum/#!forum/opentripplanner-users) or post a
question in the developer chat: https://gitter.im/opentripplanner/OpenTripPlanner.
development. For all other usage and software development questions or discussion, please post a
question in our chat room: https://gitter.im/opentripplanner/OpenTripPlanner.


## Expected behavior
Expand All @@ -17,4 +25,3 @@ question in the developer chat: https://gitter.im/opentripplanner/OpenTripPlanne
## Router config and graph build config JSON

## Steps to reproduce the problem

24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest a feature or improvement for OTP
title: ''
labels: new feature
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Goal / high level use-case**
<!-- Describe the the goal, high level use-case or epic this is is part of. Link to roadmap epic -->
<!-- Roadmap: #1234 -->

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/roadmap_epic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Roadmap Epic
about: Suggest an idea for the Roadmap
title: ''
labels: Roadmap
assignees: ''

---

### Describe expected behavior:
- What: <!-- Clearly state what the desired changes or new features could look like. -->
- Why: <!-- Clearly state the effect/outcome of this change. -->
- When: <!-- Provide a timeline or timeframe for when these changes should be implemented, preferably on a quarterly basis (e.g., Y24 Q3). -->

### Linked issue(s)
<!-- Add a checkbox by typing “- [] ”. Then, link to an issue by typing “#” and searching for the issue by text or issue number, or create a new issue. -->

### OTP PO Discussion meeting details:
- Date: <!-- Specify the date when the discussion meeting took place. -->
- Link(s): <!-- Provide a link or location where the discussion notes or details can be found. This could be a meeting link or another document. -->

### Extra Comments (Optional)
4 changes: 4 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Fix fare calculation for combined interlined legs [#5408](https://github.com/opentripplanner/OpenTripPlanner/pull/5408)
- Fix board slack list mapping in Transmodel API [#5420](https://github.com/opentripplanner/OpenTripPlanner/pull/5420)
- Fix flexible quay querying in Transmodel API [#5417](https://github.com/opentripplanner/OpenTripPlanner/pull/5417)
- Add validation for missing calls in SIRI update [#5403](https://github.com/opentripplanner/OpenTripPlanner/pull/5403)
- Import Occupancy Status from GTFS-RT Vehicle Positions [#5372](https://github.com/opentripplanner/OpenTripPlanner/pull/5372)
- Add Roadmap epic template [#5413](https://github.com/opentripplanner/OpenTripPlanner/pull/5413)
- Allow multiple zones in an unscheduled flex trip [#5376](https://github.com/opentripplanner/OpenTripPlanner/pull/5376)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.4.0 (2023-09-13)
Expand Down
6 changes: 5 additions & 1 deletion docs/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,11 @@ Used to group requests when monitoring OTP.
"frequency" : "1m",
"headers" : {
"Header-Name" : "Header-Value"
}
},
"fuzzyTripMatching" : false,
"features" : [
"position"
]
},
{
"type" : "websocket-gtfs-rt-updater"
Expand Down
30 changes: 22 additions & 8 deletions docs/UpdaterConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,27 @@ The information is downloaded in a single HTTP request and polled regularly.
<!-- vehicle-positions BEGIN -->
<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. -->

| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|----------------------------|:---------------:|----------------------------------------------------------------------------|:----------:|---------------|:-----:|
| type = "vehicle-positions" | `enum` | The type of the updater. | *Required* | | 1.5 |
| feedId | `string` | Feed ID to which the update should be applied. | *Required* | | 2.2 |
| frequency | `duration` | How often the positions should be updated. | *Optional* | `"PT1M"` | 2.2 |
| url | `uri` | The URL of GTFS-RT protobuf HTTP resource to download the positions from. | *Required* | | 2.2 |
| [headers](#u__6__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.3 |
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|-----------------------------|:---------------:|----------------------------------------------------------------------------|:----------:|---------------|:-----:|
| type = "vehicle-positions" | `enum` | The type of the updater. | *Required* | | 1.5 |
| feedId | `string` | Feed ID to which the update should be applied. | *Required* | | 2.2 |
| frequency | `duration` | How often the positions should be updated. | *Optional* | `"PT1M"` | 2.2 |
| fuzzyTripMatching | `boolean` | Whether to match trips fuzzily. | *Optional* | `false` | 2.5 |
| url | `uri` | The URL of GTFS-RT protobuf HTTP resource to download the positions from. | *Required* | | 2.2 |
| [features](#u__6__features) | `enum set` | Which features of GTFS RT vehicle positions should be loaded into OTP. | *Optional* | | 2.5 |
| [headers](#u__6__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.3 |


##### Parameter details

<h4 id="u__6__features">features</h4>

**Since version:** `2.5`**Type:** `enum set`**Cardinality:** `Optional`
**Path:** /updaters/[6]
**Enum values:** `position` | `stop-position` | `occupancy`

Which features of GTFS RT vehicle positions should be loaded into OTP.

<h4 id="u__6__headers">headers</h4>

**Since version:** `2.3`**Type:** `map of string`**Cardinality:** `Optional`
Expand All @@ -256,7 +266,11 @@ HTTP headers to add to the request. Any header key, value can be inserted.
"frequency" : "1m",
"headers" : {
"Header-Name" : "Header-Value"
}
},
"fuzzyTripMatching" : false,
"features" : [
"position"
]
}
]
}
Expand Down
1 change: 0 additions & 1 deletion docs/sandbox/GeocoderAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ It supports the following URL parameters:
| `autocomplete` | Whether we should use the query string to do a prefix match |
| `stops` | Search for stops, either by name or stop code |
| `clusters` | Search for clusters by their name |
| `corners` | Search for street corners using at least one of the street names |

#### Stop clusters

Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@


<properties>
<otp.serialization.version.id>121</otp.serialization.version.id>
<otp.serialization.version.id>122</otp.serialization.version.id>
<!-- Lib versions - keep list sorted on property name -->
<geotools.version>29.2</geotools.version>
<geotools.version>30.0</geotools.version>
<google.dagger.version>2.48.1</google.dagger.version>
<jackson.version>2.15.3</jackson.version>
<jersey.version>3.1.3</jersey.version>
Expand Down Expand Up @@ -320,7 +320,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<version>0.8.11</version>
</plugin>
<plugin>
<!-- Get current Git commit information for use in MavenVersion class.
Expand Down Expand Up @@ -648,7 +648,7 @@
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-opengis</artifactId>
<artifactId>gt-api</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -913,7 +913,7 @@
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>21.1</version>
<version>21.2</version>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
Expand Down
98 changes: 98 additions & 0 deletions src/ext-test/java/org/opentripplanner/ext/flex/GtfsFlexTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package org.opentripplanner.ext.flex;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.opentripplanner.TestOtpModel;
import org.opentripplanner.ext.flex.trip.FlexTrip;
import org.opentripplanner.ext.flex.trip.UnscheduledTrip;
import org.opentripplanner.routing.graphfinder.NearbyStop;
import org.opentripplanner.standalone.config.sandbox.FlexConfig;
import org.opentripplanner.transit.model.framework.FeedScopedId;
import org.opentripplanner.transit.service.TransitModel;

/**
* This test makes sure that one of the example feeds in the GTFS-Flex repo works. It's the City of
* Aspen Downtown taxi service which is a completely unscheduled trip that takes you door-to-door in
* the city.
* <p>
* It only contains a single stop time which in GTFS static would not work but is valid in GTFS
* Flex.
*/
public class GtfsFlexTest extends FlexTest {

private static TransitModel transitModel;

@BeforeAll
static void setup() {
TestOtpModel model = FlexTest.buildFlexGraph(ASPEN_GTFS);
transitModel = model.transitModel();
}

@Test
void parseAspenTaxiAsUnscheduledTrip() {
var flexTrips = transitModel.getAllFlexTrips();
assertFalse(flexTrips.isEmpty());
assertEquals(
Set.of("t_1289262_b_29084_tn_0", "t_1289257_b_28352_tn_0"),
flexTrips.stream().map(FlexTrip::getId).map(FeedScopedId::getId).collect(Collectors.toSet())
);

assertEquals(
Set.of(UnscheduledTrip.class),
flexTrips.stream().map(FlexTrip::getClass).collect(Collectors.toSet())
);
}

@Test
void calculateAccessTemplate() {
var trip = getFlexTrip();
var nearbyStop = getNearbyStop(trip);

var accesses = trip
.getFlexAccessTemplates(nearbyStop, flexDate, calculator, FlexConfig.DEFAULT)
.toList();

assertEquals(1, accesses.size());

var access = accesses.get(0);
assertEquals(0, access.fromStopIndex);
assertEquals(0, access.toStopIndex);
}

@Test
void calculateEgressTemplate() {
var trip = getFlexTrip();
var nearbyStop = getNearbyStop(trip);
var egresses = trip
.getFlexEgressTemplates(nearbyStop, flexDate, calculator, FlexConfig.DEFAULT)
.toList();

assertEquals(1, egresses.size());

var egress = egresses.get(0);
assertEquals(0, egress.fromStopIndex);
assertEquals(0, egress.toStopIndex);
}

@Test
void shouldGeneratePatternForFlexTripWithSingleStop() {
assertFalse(transitModel.getAllTripPatterns().isEmpty());
}

private static NearbyStop getNearbyStop(FlexTrip<?, ?> trip) {
assertEquals(1, trip.getStops().size());
var stopLocation = trip.getStops().iterator().next();
return new NearbyStop(stopLocation, 0, List.of(), null);
}

private static FlexTrip<?, ?> getFlexTrip() {
var flexTrips = transitModel.getAllFlexTrips();
return flexTrips.iterator().next();
}
}
Loading

0 comments on commit ff6c6bd

Please sign in to comment.