Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7cf4af0
#82 multiline_to_sorted_linestring bug fix when missing start_point
gmatosferreira Jul 13, 2026
90664e9
#70 sample gtfs created for testing and initial test kick-off
gmatosferreira Jul 22, 2026
0089cb6
#70 tests implemented with 94.17% of coverage
gmatosferreira Jul 27, 2026
3abccfb
#70 test coverage action for PRs kick-off
gmatosferreira Jul 27, 2026
a3e3018
#70 test coverage action for PRs fix missing test dependencies
gmatosferreira Jul 27, 2026
88b92f3
#70 test coverage debug
gmatosferreira Jul 27, 2026
aaecea0
#70 tests fix
gmatosferreira Jul 27, 2026
dc2613d
#70 test coverage report format fix
gmatosferreira Jul 27, 2026
60842a1
#70 test coverage report format fix II
gmatosferreira Jul 27, 2026
c1414da
#70 test coverage report metrics per file fix
gmatosferreira Jul 27, 2026
669d772
#70 action to check package builds and runs in every major OS
gmatosferreira Jul 27, 2026
84a79ad
#70 home with R-CMD-check.yaml action badge
gmatosferreira Jul 27, 2026
6117189
#70 test coverage action integration with codecov.io
gmatosferreira Jul 27, 2026
90ec3bc
#70 removed manual code coverage reoport, as codecov.io already comme…
gmatosferreira Jul 27, 2026
6085a55
#70 download vignette fix to avoid missing env var error on R-CMD-che…
gmatosferreira Jul 27, 2026
398b708
#70 build check fixed with mandatory dependencies moved to Imports in…
gmatosferreira Jul 27, 2026
819585f
#75 bug fix when progress reaches value too close to 1 before last it…
gmatosferreira Jul 27, 2026
71733ff
#70 sample osmextract for TCB network
gmatosferreira Jul 27, 2026
37e7eeb
#70 sample for GTFS-RT collection for examples
gmatosferreira Jul 27, 2026
91d84f7
#70 methods global refactoring to make examples executable (with mino…
gmatosferreira Jul 28, 2026
b1e2f12
#70 global refactoring to fix "prioritize" typo to use BE version "pr…
gmatosferreira Jul 28, 2026
7294345
#70 samples moved to extdata/samples for better organization
gmatosferreira Jul 28, 2026
7b5e3ca
#70 removed unused sample data
gmatosferreira Jul 28, 2026
82da602
#70 generic imports narrowed to get only methods needed
gmatosferreira Jul 28, 2026
c4df0e9
#70 devtools::check minor fixes
gmatosferreira Jul 28, 2026
5de4fd4
#70 devtools::check minor fixes
gmatosferreira Jul 28, 2026
ab2810f
#70 global refactoring to avoid undefined global functions or variabl…
gmatosferreira Jul 28, 2026
fb59d2d
#70 global refactoring to avoid undefined global functions or variabl…
gmatosferreira Jul 28, 2026
c5fd657
#70 global refactoring to avoid library() calls in package code to pa…
gmatosferreira Jul 28, 2026
aa077c4
#70 global refactoring to avoid undefined global functions or variabl…
gmatosferreira Jul 28, 2026
4cdb8fb
#70 global refactoring to fix method examples with +100 characters to…
gmatosferreira Jul 28, 2026
fe843d7
#70 global refactoring to fix method examples with +100 characters to…
gmatosferreira Jul 28, 2026
6c7ec08
#70 build::check fixes
gmatosferreira Jul 28, 2026
cae956e
#70 global refactoring to avoid undefined global functions fixed for …
gmatosferreira Jul 29, 2026
d16e913
#70 devtools::test() fixes to make all tests run after major refactor…
gmatosferreira Jul 29, 2026
2c4edfe
#70 devtools::test() warnings reviewed
gmatosferreira Jul 29, 2026
ce809cd
#70 devtools::test() warnings review II
gmatosferreira Jul 29, 2026
a72c16b
#70 #2 osm_centerlines() accepting osm_file parameter to prevent test…
gmatosferreira Jul 29, 2026
c777423
#70 vignettes moved to vignettes/articles to avoid them being include…
gmatosferreira Jul 29, 2026
73177ec
#70 vignettes moved to vignettes/articles to avoid them being include…
gmatosferreira Jul 29, 2026
3140135
#70 reduced imports to pass devtools::check (moved to suggests those …
gmatosferreira Jul 29, 2026
3c5d162
#70 reduced sample files size to pass devtools::check (package size m…
gmatosferreira Jul 29, 2026
23dc6cd
#70 examples st_read with quiet=TRUE to reduce output extension
gmatosferreira Jul 29, 2026
3a91494
#2 giving credit to Miguel Relvas Pires for osm_centerlines method
gmatosferreira Jul 29, 2026
27ea3e0
#70 R-CMD-check.yaml fix missing osmium dependency
gmatosferreira Jul 29, 2026
42500ae
#70 R-CMD-check.yaml fix missing osmium dependency only Windows left
gmatosferreira Jul 29, 2026
8af01be
#70 test refactored to avoid problems with different group_split sort…
gmatosferreira Jul 29, 2026
9013a36
#70 syntax consistency fix
gmatosferreira Jul 29, 2026
2f9b8a7
#70 R-CMD-check.yaml fix missing osmium dependency on Windows II
gmatosferreira Jul 29, 2026
34a39cf
#70 R-CMD-check.yaml fix missing osmium dependency on Windows III
gmatosferreira Jul 29, 2026
9b7523d
#70 tests improved to avoid variable resulst on different os
gmatosferreira Jul 30, 2026
29d3f0c
#70 attachment::att_amend_desc()
gmatosferreira Jul 30, 2026
131bc71
#70 checkhelper::find_missing_tags() fix missing returns
gmatosferreira Jul 30, 2026
3c6dab9
#70 methods docs @return standardized for better consistency
gmatosferreira Jul 30, 2026
0a961be
#70 using withr to handle local files to avoid garbage generation (ch…
gmatosferreira Jul 30, 2026
130d5d7
#70 usethis::use_spell_check()
gmatosferreira Jul 30, 2026
1c54925
#70 urlchecker::url_check()
gmatosferreira Jul 30, 2026
4f6a553
#70 devtools::check_win_devel() minor improvement suggestions
gmatosferreira Jul 30, 2026
084fd48
#70 osmium examples only running when osmium installed, to avoid conf…
gmatosferreira Jul 30, 2026
b32de6e
#70 python example running only when neatnet present to avoid conflic…
gmatosferreira Jul 30, 2026
ad9a1e6
#70 latex expressions reviewed to avoid conflicts with devtools::chec…
gmatosferreira Jul 30, 2026
3d66115
#70 usethis::use_cran_comments(open = rlang::is_interactive()) with c…
gmatosferreira Jul 30, 2026
a973af0
#70 examples refactored to tun quicker to avoid problems with devtool…
gmatosferreira Jul 30, 2026
88a4b34
Increment version number to 0.12.0
gmatosferreira Jul 30, 2026
c8214fe
#70 pkgdown action extended to install osmium and neatnet dependencie…
gmatosferreira Jul 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .RDataTmp
Binary file not shown.
15 changes: 14 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,17 @@
^pkgdown$
^\.github$
^vignettes/articles$
^dev$
^dev$
^releases$
(^|/)venv(/.*)?$
LICENSE.md
CITATION.cff
^doc$
^Meta$
^scratch$
cache
(^|/)[^/]*cache[^/]*(/.*)?$
^\.RDataTmp$
^\.RData$
^revdep$
^cran-comments\.md$
75 changes: 75 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install osmium-tool (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y osmium-tool

- name: Install osmium-tool (macOS)
if: runner.os == 'macOS'
run: brew install osmium-tool

- name: Setup Conda (Windows)
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge
channel-priority: strict

- name: Install osmium-tool (Windows)
if: runner.os == 'Windows'
shell: bash -el {0}
run: |
conda install -y osmium-tool
echo "$CONDA_PREFIX/Library/bin" >> $GITHUB_PATH
echo "$CONDA_PREFIX/Scripts" >> $GITHUB_PATH
echo "$CONDA_PREFIX" >> $GITHUB_PATH

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
14 changes: 13 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,21 @@ jobs:
with:
use-public-rspm: true

- name: Install osmium-tool (Linux)
run: sudo apt-get install -y osmium-tool

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Python dependencies for neatnet (osm_centerlines)
run: |
python -m pip install --upgrade pip
pip install osmnx pandas geopandas shapely neatnet pyrosm

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
extra-packages: any::pkgdown, any::rosmium, any::reticulate, local::.
needs: website

- name: Build site
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: [main, master]

name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
MOBILITY_DATABASE: ${{ secrets.MOBILITY_DATABASE }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
# testthat and rosmium are Suggests (optional) in DESCRIPTION so they
# are not guaranteed to be installed automatically — list them explicitly.
extra-packages: any::covr, any::xml2, any::testthat, any::rosmium, local::.
needs: coverage

- name: Run tests and compute coverage
run: |
install_path <- file.path(
normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"
)

# Helper: print the .Rout.fail file so the actual test error is visible
# in the CI log instead of just a path reference.
dump_rout_fail <- function() {
fail_files <- list.files(install_path, pattern = "\\.Rout\\.fail$",
recursive = TRUE, full.names = TRUE)
if (length(fail_files) == 0) {
message("No .Rout.fail file found.")
return(invisible(NULL))
}
for (f in fail_files) {
message("\n========== ", basename(f), " ==========")
cat(readLines(f, warn = FALSE), sep = "\n")
message("============================================\n")
}
}

cov <- tryCatch(
covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = install_path
),
error = function(e) {
message("\n--- Test suite failed. Dumping .Rout.fail for diagnosis ---\n")
dump_rout_fail()
stop(e) # re-throw so the job still fails
}
)

# Print summary to the log
print(cov)

# Generate Cobertura XML report for Codecov upload
covr::to_cobertura(cov, filename = "coverage.xml")

# Compute total coverage percentage and write to GITHUB_ENV
pct <- covr::percent_coverage(cov)
message("Total coverage: ", round(pct, 2), "%")
writeLines(paste0("COVERAGE_PCT=", round(pct, 2)), Sys.getenv("GITHUB_ENV"))
shell: Rscript {0}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false # don't fail the PR if Codecov is unreachable

- name: Upload Cobertura XML as workflow artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml

- name: Enforce minimum coverage threshold
run: |
pct <- as.numeric(Sys.getenv("COVERAGE_PCT"))
threshold <- 0 # Set your desired minimum coverage % here (e.g. 60)
if (!is.na(pct) && pct < threshold) {
stop(paste0(
"Coverage (", round(pct, 2), "%) is below the required threshold of ",
threshold, "%."
))
} else {
message("Coverage check passed: ", round(pct, 2), "%")
}
shell: Rscript {0}
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
.Rproj.user
.Rhistory
.RData
.RDataTmp
.Ruserdata
inst/doc
docs

*.csv
*.gpkg
*.zip

releases/
vignettes/*_cache/*

scratch/*
scratch/*
/doc/
/Meta/
*cache*
revdep/
66 changes: 41 additions & 25 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,47 +1,63 @@
Package: GTFShift
Type: Package
Title: Explore and Analyse General Transit Feed Specification (GTFS) Files With a Focus on Urban Mobility
Version: 0.11.0
Package: GTFShift
Title: Explore and Analyse General Transit Feed Specification (GTFS) Files
with a Focus on Urban Mobility
Version: 0.12.0
Authors@R: c(
person(c("Gonçalo", "F."), "Matos", email = "goncaloafmatos@tecnico.pt", role = c("aut", "cre"), comment = c(ORCID = "0009-0001-3489-1732")),
person("Rosa", "Félix", email = "rosamfelix@tecnico.pt", role = c("aut"), comment = c(ORCID = "0000-0002-5642-6006")))
Description: GTFShift emerged from the necessity to perform systematic analysis for academic research
over General Transit Feed Specification (GTFS) files that were not supported by any R library. It compiles
the methods developed for this purpose, aiming to contribute to an open source culture.
Its functionality is built mostly on [tidytransit](https://r-transit.github.io/tidytransit/) package.
License: GNU General Public License, Version 3 (GPL-3)
Encoding: UTF-8
person(c("Gonçalo", "F."), "Matos", , "goncaloafmatos@tecnico.pt", role = c("aut", "cre"),
comment = c(ORCID = "0009-0001-3489-1732")),
person("Rosa", "Félix", , "rosamfelix@tecnico.pt", role = "aut",
comment = c(ORCID = "0000-0002-5642-6006")),
person("Miguel", "Relvas Pires", , "miguelpcrpires@tecnico.ulisboa.pt", role = "ctb")
)
Description: This package encompasses a complete bundle of methods to
harmonize GTFS and OSM data, enabling the integration and exploration
of different layers of transit data, starting with the planned
operations (GTFS), but also the infrastructure topology (OSM) and
real-time information (GTFS-RT).
License: GPL
URL: https://github.com/U-Shift/GTFShift,
https://u-shift.github.io/GTFShift/
Depends:
R (>= 4.1.0)
R (>= 4.1.0)
Imports:
tidytransit,
gtfstools,
zip,
sf,
tidyverse,
tidyselect,
tidyr,
lubridate,
gtfsrouter (>= 0.1.4),
httr,
jsonlite,
dplyr,
osmdata,
stplanr,
stringr,
reticulate,
progress,
callr,
stringi,
parallel
URL: https://github.com/U-Shift/GTFShift, https://u-shift.github.io/GTFShift/
purrr,
rlang,
xml2,
withr
Suggests:
knitr,
rmarkdown,
mapview,
xml2,
RProtoBuf,
osmextract,
rosmium
VignetteBuilder: knitr
rosmium,
testthat,
zip,
gtfsrouter (>= 0.1.4),
reticulate,
parallel,
RProtoBuf,
stplanr,
lwgeom,
progress,
stringi,
spelling
VignetteBuilder:
knitr
Config/Needs/website: rmarkdown
Config/roxygen2/version: 8.0.0
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.3.3
Loading
Loading