Skip to content

Commit 7fe42c2

Browse files
committed
r5py patches
1 parent 81a25c8 commit 7fe42c2

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,9 @@ jobs:
5050
- name: Publish to GH Packages
5151
# Supply access token to build.gradle (used in publishing.repositories.maven.credentials)
5252
env:
53+
GITHUB_PACKAGE_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
5354
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5455
run: gradle publish
56+
permissions:
57+
contents: read
58+
packages: write

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ publishing {
5454
repositories {
5555
maven {
5656
name = "GitHubPackages"
57-
url = uri("https://maven.pkg.github.com/conveyal/r5")
57+
url = uri("https://maven.pkg.github.com/" + System.getenv("GITHUB_PACKAGE_REPOSITORY"))
5858
credentials {
5959
username = System.getenv("GITHUB_ACTOR")
6060
password = System.getenv("GITHUB_TOKEN")

src/main/java/com/conveyal/r5/kryo/KryoNetworkSerializer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,14 @@ public static TransportNetwork read (File file) throws Exception {
131131
byte[] header = new byte[HEADER.length];
132132
input.read(header, 0, header.length);
133133
if (!Arrays.equals(HEADER, header)) {
134+
input.close();
134135
throw new RuntimeException("Unrecognized file header. Is this an R5 Kryo network?");
135136
}
136137
String formatVersion = kryo.readObject(input, String.class);
137138
String commit = kryo.readObject(input, String.class);
138139
LOG.info("Loading network from file format version {}, written by R5 commit {}", formatVersion, commit);
139140
if (!NETWORK_FORMAT_VERSION.equals(formatVersion)) {
141+
input.close();
140142
throw new RuntimeException(
141143
String.format("File format version is %s, this R5 requires %s", formatVersion, NETWORK_FORMAT_VERSION)
142144
);

src/main/java/com/conveyal/r5/transit/TransitLayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public class TransitLayer implements Serializable, Cloneable {
175175
/** Whether to save detailed trip shapes from GTFS (e.g., for Conveyal Taui sites). Unless the default false
176176
* value is overwritten by a transportNetworkConfig file, straight line segments between stops will be used in
177177
* visualiations.*/
178-
public boolean saveShapes = false;
178+
public boolean saveShapes = true;
179179

180180
/** Map from feed ID to feed CRC32 to ensure that we can't apply scenarios to the wrong feeds */
181181
public Map<String, Long> feedChecksums = new HashMap<>();

0 commit comments

Comments
 (0)