From 7c36ea9016038e3cb80fb845f52bd54b42bfc593 Mon Sep 17 00:00:00 2001 From: SebKrantz Date: Fri, 27 Feb 2026 09:50:10 +0300 Subject: [PATCH] New dev version. --- DESCRIPTION | 2 +- NAMESPACE | 1 + NEWS.md | 4 ++++ R/utils.R | 4 ++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cc939ce..fd783cd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: flownet Type: Package Title: Transport Modeling: Network Processing, Route Enumeration, and Traffic Assignment -Version: 0.2.1 +Version: 0.2.1.9000 Authors@R: c(person("Sebastian", "Krantz", email = "sebastian.krantz@graduateinstitute.ch", role = c("aut", "cre")), person("Kamol", "Roy", role = "ctb")) Description: High-performance tools for transport modeling - network processing, route diff --git a/NAMESPACE b/NAMESPACE index 5db930c..89a3f79 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -31,6 +31,7 @@ importFrom(collapse,ckmatch) importFrom(collapse,collap) importFrom(collapse,colorder) importFrom(collapse,colorderv) +importFrom(collapse,copyv) importFrom(collapse,dapply) importFrom(collapse,descr) importFrom(collapse,fduplicated) diff --git a/NEWS.md b/NEWS.md index 4174ed4..bfc4132 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# flownet 0.2.1.9000 + +- Fixed issue in `consolidate_graph()` which used to modify columns (`from` and `to` in-place). Users in older versions are advised to input a `data.table::copy()` of the graph to retain it. + # flownet 0.2.1 - `angle.max` constraint in `run_assignment()` is now two-sided (angle measured from origin and destination node against the straight line between them), rather than just one-sided (from origin). Also, the implementation is slightly more efficient. diff --git a/R/utils.R b/R/utils.R index 8961715..68775cb 100644 --- a/R/utils.R +++ b/R/utils.R @@ -448,7 +448,7 @@ normalize_graph <- function(graph_df) { #' c(original = nrow(graph), consolidated = nrow(graph_cons)) #' #' @export -#' @importFrom collapse fnrow get_vars anyv setv ss seq_row fduplicated fmatch whichv whichNA allNA ffirst GRP collap %iin% %!in% %!iin% join colorderv funique.default %!=% %==% missing_cases qtab varying radixorderv groupv na_rm +#' @importFrom collapse fnrow get_vars anyv setv copyv ss seq_row fduplicated fmatch whichv whichNA allNA ffirst GRP collap %iin% %!in% %!iin% join colorderv funique.default %!=% %==% missing_cases qtab varying radixorderv groupv na_rm #' @importFrom kit countOccur #' @importFrom stats setNames consolidate_graph <- function(graph_df, directed = FALSE, @@ -541,7 +541,7 @@ consolidate_graph_core <- function(graph_df, directed = FALSE, reci, nam_keep, verbose = TRUE) { keep <- seq_row(graph_df) # Global variable tracking utilized edges - gft <- get_vars(graph_df, c("from", "to", by)) |> unclass() # Local variable representing the current graph worked on + gft <- get_vars(graph_df, c("from", "to", by)) |> unclass() |> copyv(NA, NA) # Local variable representing the current graph worked on if(length(by)) { by_id <- groupv(get_vars(graph_df, by))