From ac1eec58a947eab2c89fb04a600b8417ec6f3460 Mon Sep 17 00:00:00 2001 From: mpadge Date: Thu, 19 Sep 2024 10:16:15 +0200 Subject: [PATCH] prepend class structure; closes #244 --- DESCRIPTION | 2 +- NEWS.md | 1 + R/weight-streetnet.R | 6 +++--- codemeta.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1c94592d..48edb271 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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"), diff --git a/NEWS.md b/NEWS.md index f6cdfafb..9fc00092 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. diff --git a/R/weight-streetnet.R b/R/weight-streetnet.R index 873e17e1..3573daf8 100644 --- a/R/weight-streetnet.R +++ b/R/weight-streetnet.R @@ -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) @@ -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") <- diff --git a/codemeta.json b/codemeta.json index 31b70acf..2a1f984a 100644 --- a/codemeta.json +++ b/codemeta.json @@ -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",