cmu-lib / konigsbergr

Compare 4b91482 ... +12 ... a03dde6

Coverage Reach

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -53,7 +53,7 @@
Loading
53 53
  graph %>%
54 54
    tidygraph::activate(edges) %>%
55 55
    dplyr::filter(
56 -
      (.data$highway %in% c("footway", "pedestrian", "path", "primary", "secondary", "tertiary", "primary_link")),
56 +
      (.data$highway %in% c("footway", "pedestrian", "path", "primary", "secondary", "tertiary", "primary_link", "steps")),
57 57
      (is.na(.data$foot) | .data$foot != "no")
58 58
    ) %>%
59 59
    select_main_component()

@@ -19,12 +19,7 @@
Loading
19 19
  stopifnot(inherits(graph, "konigsberg_graph"))
20 20
  bridge_bundles <- collect_edge_bundles(graph)
21 21
  starting_point <- calculate_starting_node(graph, starting_node)
22 -
23 -
  res <- pathfinder::greedy_search(graph,
24 -
                edge_bundles = bridge_bundles,
25 -
                distances = E(graph)$distance,
26 -
                starting_point = starting_point,
27 -
                ...)
22 +
  res <- pathfinder::greedy_search(graph, bridge_bundles, E(graph)$distance, starting_point = starting_point, cheat = TRUE, quiet = FALSE, ...)
28 23
  class(res) <- c(class(res), "konigsberg_path")
29 24
  res
30 25
}

@@ -85,23 +85,23 @@
Loading
85 85
      )
86 86
    )
87 87
88 -
  augmented_pathway <- pathfinder::augment(pathway) %>%
88 +
  augmented_pathway <- pathfinder::augment_path(pathway) %>%
89 89
    group_by(.data$bundle_id) %>%
90 90
    mutate(total_times_bridge_crossed = max(.data$times_bundle_crossed)) %>%
91 91
    ungroup()
92 92
93 93
  pathway_sf <- bind_cols(edges_sf[augmented_pathway$edge_id,], augmented_pathway)
94 94
95 95
  # Get start and end point and add to map
96 -
  start_point <- head(head(pathway$vpath, 1)[[1]], 1)
97 -
  end_point <- tail(tail(pathway$vpath, 1)[[1]], 1)
96 +
  start_point <- pathway[["starting_point"]]
97 +
  end_point <- pathway[["ending_point"]]
98 98
99 -
  nodes_sf <- nodes_to_sf(graph)[c(start_point, end_point),]
100 -
  nodes_sf$start <- c("Beginning", "End")
99 +
  endpoints_sf <- nodes_to_sf(graph)[c(start_point, end_point),]
100 +
  endpoints_sf$start <- c("Beginning", "End")
101 101
102 102
  structure(list(
103 103
    pathway = pathway_sf,
104 -
    terminals = nodes_sf),
104 +
    terminals = endpoints_sf),
105 105
    class = c("list", "konigsberg_sf"))
106 106
}
107 107
@@ -119,7 +119,7 @@
Loading
119 119
view_konigsberg_path <- function(graph, pathway) {
120 120
  path_sf <- pathway_to_sf(graph, pathway)
121 121
122 -
  cross_pal <- colorFactor(c("#2B83BA", "#ABDDA4", "#FDAE61"),
122 +
  cross_pal <- colorFactor(c("#2B83BA", "#ABDDA4", "#FDAE61", "red"),
123 123
                           path_sf$pathway$total_times_bridge_crossed)
124 124
125 125
  lf <- leaflet(path_sf$pathway, width = "100%", height = "600px") %>%
@@ -132,3 +132,18 @@
Loading
132 132
133 133
  lf
134 134
}
135 +
136 +
#' Plot a static visual of the Konigsberg pathway
137 +
#'
138 +
#' @inheritParams view_konigsberg_path
139 +
#' @importFrom graphics plot
140 +
#' @return An `sf` plot
141 +
#' @export
142 +
plot_konigsberg_path <- function(graph, pathway) {
143 +
  graph_sf <- graph_to_sf(graph)
144 +
  path_sf <- pathway_to_sf(graph, pathway)
145 +
146 +
  plot(graph_sf$edges["geometry"], col = "gray30", reset = FALSE)
147 +
  plot(path_sf$pathway["total_times_bridge_crossed"], alpha = 0.5, lwd = 3, add = TRUE)
148 +
  plot(path_sf$terminals["geometry"], col = "blue", pch = 16, cex = 3, add = TRUE)
149 +
c}

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -2.36% 93.62%
Project Totals (6 files) 93.62%
Loading