Skip to content

Commit

Permalink
prepend class structure; closes #244
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Sep 19, 2024
1 parent 956303c commit ac1eec5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dodgr
Title: Distances on Directed Graphs
Version: 0.4.1.025
Version: 0.4.1.026
Authors@R: c(
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre")),
person("Andreas", "Petutschnig", role = "aut"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Minor changes

- Pre-pend class structure of `dodgr_streetnet` objects to `data.frame`, rather than append; thanks to @agila5 (#244).
- Fix bug in graph contraction that left duplicated edges (#236, thanks to @Robinlovelace).
- Fix minor bug in de-duplication discovered via #236.

Expand Down
6 changes: 3 additions & 3 deletions R/weight-streetnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ weight_streetnet.sf <- function (x,
gr_cols <- dodgr_graph_cols (graph)
graph <- graph [which (!is.na (graph [[gr_cols$d_weighted]])), ]

class (graph) <- c (class (graph), "dodgr_streetnet")
class (graph) <- c ("dodgr_streetnet", class (graph))
attr (graph, "turn_penalty") <- FALSE

hash <- get_hash (graph, contracted = FALSE, force = TRUE)
Expand Down Expand Up @@ -656,9 +656,9 @@ weight_streetnet.sc <- function (x,
!is.na (graph [[gr_cols$time]])), ]

class (graph) <- c (
class (graph),
"dodgr_streetnet",
"dodgr_streetnet_sc"
"dodgr_streetnet_sc",
class (graph)
)

attr (graph, "hash") <-
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/dodgr",
"issueTracker": "https://github.com/UrbanAnalyst/dodgr/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.4.1.025",
"version": "0.4.1.026",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit ac1eec5

Please sign in to comment.