Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 50 additions & 22 deletions revdep/examples/README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,81 @@
# Reverse Dependency Problem Examples

This directory contains minimal reproducible examples for packages that have newly broken checks compared to the most recent CRAN version of igraph.
This directory contains minimal reproducible examples for packages flagged as newly broken in the latest `revdepcheck` run against the development version of igraph. See [`../problems-analysis.md`](../problems-analysis.md) for the corresponding analysis and recommended fixes.

## Files

Each issue has two files:
- `*.R` - Runnable R script with the minimal example
- `*.md` - Markdown documentation with example output (reprex-style)
- `*.R` — runnable R script with the minimal reproduction
- `*.md` — markdown documentation with reprex-style output

### Issues

1. **cascade-circulant-issue** - Namespace collision between `igraph::circulant` and `magic::circulant`
2. **diagrammer-neighbors-issue** - `neighbors()` now requires exactly one vertex
3. **jewel-integer-issue** - Strict integer validation in `rewire_impl()`
4. **manynet-scalar-issue** - Scalar integer validation in `sample_last_cit()`
5. **rspectral-modularity-issue** - Automatic weight usage in modularity calculations
6. **sfnetworks-from-issue** - `from` parameter must specify exactly one vertex
#### Group A — `bfs/dfs(father = )` argument defunct (igraph 2.2.0)
1. **tidygraph-bfs-father-issue** — `bfs(father = )` defunct (root of the dci/ggraph/scistreer cascade)
2. **nat-dfs-father-issue** — `dfs(father = )` defunct (direct caller)

#### Group B — Defunct top-level functions
3. **comato-layout-spring-issue** — `layout.spring()` defunct
4. **ecol-hub-score-issue** — `hub.score()` defunct
5. **vkr-get-edge-missing-issue** — `igraph::get.edge` removed

#### Group C — Defunct argument values / behaviors on retained functions
6. **cranly-eigen-centrality-scale-issue** — `eigen_centrality(scale = FALSE)` defunct
7. **qgraph-sample-degseq-method-issue** — `sample_degseq(method = "simple.no.multiple")` defunct
8. **goodfitsbm-get-edge-ids-issue** — `get_edge_ids(vp = <2xn matrix>)` orientation defunct

#### Group D — Deprecation warnings surfacing as NOTE/WARNING
9. **frf2-deprecation-warnings-issue** — multiple deprecation warnings → NOTE
10. **r6causal-attribute-deprecations-issue** — install-time attribute getter/setter warnings
11. **migraph-create-ring-width-issue** — `create_ring(width = )` deprecation warning → test failure

#### Group E — Indirect path through a defunct fallback
12. **degreenet-reedmolloy-issue** — defunct `sample_degseq(method = "simple.no.multiple")` fallback inside `reedmolloy()`'s retry loop

Three packages from the failure set (dci, ggraph, scistreer) are pure cascades through tidygraph and have no separate reproducer — see `tidygraph-bfs-father-issue` for the root cause.

## Running the Examples

Each R script can be run with:

```r
source("revdep/examples/cascade-circulant-issue.R")
source("revdep/examples/tidygraph-bfs-father-issue.R")
```

Or from the command line:

```bash
Rscript revdep/examples/cascade-circulant-issue.R
Rscript revdep/examples/tidygraph-bfs-father-issue.R
```

The scripts are designed to be run against the **development version** of igraph (the version produced by `R CMD INSTALL .` from the repo root). Against the CRAN release of igraph many of them will not yet hard-error — they will only emit deprecation warnings.

## Format

The examples follow a simplified format:
- No `cat()` statements for output (comments instead)
- No `tryCatch()` blocks (commented out error cases)
- No `cat()` statements for output (use comments instead)
- No `tryCatch()` blocks (commented-out error cases)
- Clean, runnable code that can be used with `reprex::reprex()`
- Corresponding `.md` files show the expected output

## Summary of Issues

| Package | Issue | Severity | Type |
|---------|-------|----------|------|
| Cascade | Namespace collision warning | Low | Inadvertent behavior change |
| DiagrammeR | `neighbors()` requires single vertex | High | API tightening |
| jewel | Integer validation error | High | Uncovered downstream bug |
| manynet | Scalar integer validation | High | API tightening |
| rSpectral | Modularity test failures | Medium | Behavior change with workaround |
| sfnetworks | `from` requires single vertex | High | API tightening |

See `../problems-analysis.md` for detailed analysis and recommendations.
|---|---|---|---|
| tidygraph | `bfs(father=)` defunct | High | API rename (root of cascade) |
| nat | `dfs(father=)` defunct | High | API rename |
| dci | Cascades through tidygraph | High | Cascading |
| ggraph | Cascades through tidygraph | High | Cascading |
| scistreer | Cascades through tidygraph | High | Cascading |
| comato | `layout.spring()` defunct | High | Defunct function |
| ECoL | `hub.score()` defunct | High | Defunct function |
| vkR | `get.edge` removed | Medium | Removed function |
| cranly | `eigen_centrality(scale=)` defunct | High | Defunct argument value |
| qgraph | `sample_degseq(method=)` value defunct | High | Defunct argument value |
| GoodFitSBM | `get_edge_ids()` matrix orientation defunct | High | Defunct call form |
| FrF2 | Deprecation warnings → NOTE | Low | Pre-emptive rename needed |
| R6causal | Install-time deprecation warnings | Medium | Pre-emptive rename needed |
| migraph | `create_ring(width=)` warning → test failure | Low | Deprecated argument |
| degreenet | Defunct fallback `sample_degseq(method=)` value | High | Defunct argument value (indirect) |

See [`../problems-analysis.md`](../problems-analysis.md) for detailed analysis and recommendations.
24 changes: 0 additions & 24 deletions revdep/examples/cascade-circulant-issue.R

This file was deleted.

33 changes: 0 additions & 33 deletions revdep/examples/cascade-circulant-issue.md

This file was deleted.

34 changes: 0 additions & 34 deletions revdep/examples/cascade-issue-draft.md

This file was deleted.

31 changes: 31 additions & 0 deletions revdep/examples/comato-layout-spring-issue.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# comato layout.spring() defunct
# Issue: comato:::plot.conceptmaps() passes layout = "spring", which dispatches
# to igraph::layout.spring() -- defunct since igraph 2.1.0.

library(igraph)

g <- make_ring(10)

# Old call -- now defunct in igraph 2.1.0
# layout.spring(g)
# Error:
# ! `layout.spring()` was deprecated in igraph 2.1.0 and is now defunct.
# i Please use `layout_with_fr()` instead.

# Working replacement
coords <- layout_with_fr(g)
dim(coords)

# Root cause:
# - layout.spring(), layout.svd(), and layout.fruchterman.reingold.grid()
# all advanced from deprecated to defunct in #2634
# - comato hardcodes layout = "spring" in plot.conceptmaps()

# Assessment:
# - Bug in comato -- references a layout function deprecated since 2.1.0

# Recommendation:
# - For comato: switch layout = "spring" to the Fruchterman-Reingold layout,
# either by passing layout = layout_with_fr or by computing coordinates
# beforehand. Also rename graph.union() -> union() to silence the
# remaining deprecation warning.
30 changes: 30 additions & 0 deletions revdep/examples/comato-layout-spring-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# comato layout.spring() defunct

## Issue
`comato:::plot.conceptmaps()` passes `layout = "spring"`, which dispatches to `igraph::layout.spring()` — defunct since igraph 2.1.0. The package also still calls `graph.union()` (currently deprecated but slated to become defunct).

## Reproducible Example

```r
library(igraph)

g <- make_ring(10)

# Old call -- now defunct
layout.spring(g)
#> Error:
#> ! `layout.spring()` was deprecated in igraph 2.1.0 and is now defunct.
#> i Please use `layout_with_fr()` instead.

# Working replacement
coords <- layout_with_fr(g)
```

## Root Cause
`layout.spring()`, `layout.svd()`, and `layout.fruchterman.reingold.grid()` all advanced from deprecated to defunct in [#2634](https://github.com/igraph/rigraph/pull/2634). comato hardcodes `layout = "spring"`.

## Assessment
Bug in comato — references a layout function deprecated since igraph 2.1.0.

## Recommendation
**For comato**: switch `layout = "spring"` to a Fruchterman–Reingold layout (e.g. `layout = layout_with_fr` or precompute coordinates). Also rename `graph.union()` → `union()` to silence the remaining deprecation warning.
33 changes: 33 additions & 0 deletions revdep/examples/cranly-eigen-centrality-scale-issue.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# cranly eigen_centrality(scale = ) defunct
# Issue: cranly:::summary.cranly_network() calls
# igraph::eigen_centrality(cranly_graph, scale = FALSE), defunct since 2.1.1.

library(igraph)

g <- sample_gnp(20, 0.3)

# Old call -- now defunct in igraph 2.1.1
# eigen_centrality(g, scale = FALSE)
# Error:
# ! The `scale` argument of `eigen_centrality()` always as if TRUE as of
# igraph 2.1.1.
# i Normalization is always performed

# Working replacement
res <- eigen_centrality(g)
str(res$vector)

# If raw (un-normalized) values are needed, rescale manually after the call
# (e.g. multiply by some reference value)

# Root cause:
# - eigen_centrality(scale = ) was deprecated in 2.1.1 (#1543); normalization
# is now mandatory
# - Advanced from deprecate_warn to deprecate_stop in #2634

# Assessment:
# - Bug in cranly -- relies on an argument whose effect has been removed

# Recommendation:
# - For cranly: drop the `scale = FALSE` argument. If un-normalized values
# are genuinely needed downstream, scale them manually afterwards.
31 changes: 31 additions & 0 deletions revdep/examples/cranly-eigen-centrality-scale-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# cranly eigen_centrality(scale = ) defunct

## Issue
`cranly:::summary.cranly_network()` calls `igraph::eigen_centrality(cranly_graph, scale = FALSE)`. Defunct since igraph 2.1.1. Breaks the `cranly.Rmd` vignette re-build.

## Reproducible Example

```r
library(igraph)

g <- sample_gnp(20, 0.3)

eigen_centrality(g, scale = FALSE)
#> Error:
#> ! The `scale` argument of `eigen_centrality()` always as if TRUE as of
#> igraph 2.1.1.
#> i Normalization is always performed

# Working replacement
res <- eigen_centrality(g)
res$vector
```

## Root Cause
`eigen_centrality(scale = )` was deprecated in igraph 2.1.1 ([#1543](https://github.com/igraph/rigraph/pull/1543)); normalization is now mandatory. Advanced from `deprecate_warn` to `deprecate_stop` in [#2634](https://github.com/igraph/rigraph/pull/2634).

## Assessment
Bug in cranly — relies on an argument whose effect has been removed.

## Recommendation
**For cranly**: drop the `scale = FALSE` argument. If un-normalized values are needed downstream, rescale manually afterwards.
49 changes: 49 additions & 0 deletions revdep/examples/degreenet-reedmolloy-issue.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# degreenet reedmolloy() fails through a defunct fallback method
# Issue: reedmolloy() retries via igraph::degree.sequence.game(method =
# "simple.no.multiple") whenever its first attempt with method = "vl" fails.
# That fallback value is defunct in dev igraph, so the retry loop never
# succeeds and reedmolloy reports its own error.

library(degreenet)
library(igraph)

set.seed(2)
s4 <- simpln(n = 100, v = c(-1, 1))
table(s4)
#> 1 2 3 4 5 6
#> 65 18 7 4 4 2

# Step 1: confirm the VL call deterministically fails on this sequence (this
# is NOT a regression -- VL only produces connected graphs, and s4's 65
# degree-1 vertices preclude a connected configuration in practice).
# Verified against CRAN igraph 2.3.1: 50/50 VL attempts errored.
res_vl <- try(sample_degseq(s4, method = "vl"), silent = TRUE)
cat("VL succeeded:", !inherits(res_vl, "try-error"), "\n")

# Step 2: the fallback path -- works on CRAN 2.3.1 (with a deprecation
# warning), but hard-errors on dev igraph.
# sample_degseq(s4, method = "simple.no.multiple")
# Error on dev:
# ! The `method` argument of `sample_degseq()` must be fast.heur.simple
# instead of simple.no.multiple as of igraph 2.1.0.

# Step 3: proper replacement -- works on every igraph 2.x version.
g_new <- sample_degseq(s4, method = "fast.heur.simple")
vcount(g_new); ecount(g_new)

# Putting it together: reedmolloy(s4) succeeds on CRAN 2.3.1 because the
# fallback path produces a (warned) graph; it fails on dev igraph because
# the fallback is now defunct and .catchToList() converts the error into a
# retry, exhausting maxit and triggering reedmolloy's own error message.

# Root cause:
# - The lifecycle promotion of sample_degseq(method = "simple.no.multiple")
# from deprecate_warn to deprecate_stop in #2634.

# Assessment:
# - Bug in degreenet -- depends on the obsolete fallback method name.

# Recommendation:
# - For degreenet: replace the fallback method with "fast.heur.simple".
# Also rename degree.sequence.game() -> sample_degseq() and
# get.edgelist() -> as_edgelist().
Loading
Loading