Skip to content
Draft
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
14 changes: 9 additions & 5 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
ref: ${{ inputs.ref }}

- name: Update status for rcc
if: github.actor != 'github-copilot[bot]'
if: github.actor != 'Copilot'
# FIXME: Wrap into action
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:

- name: Update status for rcc
# FIXME: Wrap into action
if: always() && (github.actor != 'github-copilot[bot]')
if: always() && (github.actor != 'Copilot')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down Expand Up @@ -219,12 +219,16 @@ jobs:

- name: Update status for rcc (Copilot)
# Update status directly when triggered by Copilot or bots, since they can't dispatch workflows
if: always() && (github.actor == 'github-copilot[bot]')
if: always() && (github.actor == 'Copilot')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Check status of this workflow
state="pending"
# Set status to success if job succeeded, failure otherwise
if [ "${{ job.status }}" == "success" ]; then
state="success"
else
state="failure"
fi
sha=${{ inputs.ref }}
if [ -z "${sha}" ]; then
sha=${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vendor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "vendor-one.sh"
workflow_dispatch:
schedule:
- cron: "0 * * * *"
- cron: "* 0 * * *"

concurrency:
group: ${{ github.workflow }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ cran
/rchk
/src/*.d
/src/symbols.rds
/tests/testthat/testthat-problems.rds
/covr
/.vscode/launch.json
41 changes: 37 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ pak::pak(dependencies = "Config/Needs/build")

- When run on GitHub Actions, assume that R, the package in its current state and all dependencies are installed.
- Only install new packages when needed for implementing new features or tests.
- Run `R -q -e 'testthat::test_local(reporter = "check")'` to execute tests as a final step.
- Run `R -q -e 'devtools::check()'` to execute all checks as a final step.

### Building and Testing

- Load package for development: `pkgload::load_all()`
- Run tests: `testthat::test_local(reporter = "check")`
- Run tests for a single file `test-foo.R`: `testthat::test_local(filter = "foo", reporter = "check")`
- Build package: `devtools::build()`
- Check package: `devtools::check()`
- Update documentation: `devtools::document()`
- Update `.Rd` documentation: `devtools::document()`
- Format code: `air format .`

## Code Style and Documentation
Expand All @@ -54,21 +55,24 @@ pak::pak(dependencies = "Config/Needs/build")
- Prefer expressive code over comments where possible
- Add comments to utility functions that cannot be made immediately obvious
- Focus comments on explaining the "why" and "how", the "what" should be clear from the code itself
- Use line breaks after each sentence in multi-sentence comments
- Use line breaks after each sentence

### R Code Conventions

- Follow the [tidyverse style guide](https://style.tidyverse.org)
- Follow the [tidyverse style guide](https://style.tidyverse.org) and the [tidyverse design guide](https://design.tidyverse.org)
- Use `snake_case` for new functions
- Use explicit package prefixes (e.g., `withr::local_db_connection()`) for clarity
- Maintain consistent indentation (2 spaces) and spacing patterns
- Use meaningful variable names that reflect context
- Run `air format .` before committing changes to ensure consistent formatting
- Never change deprecated functions

### Documentation

- Use roxygen2 with Markdown syntax for all function documentation
- Use math notation for formulas: `\eqn{...}` for inline, `\deqn{...}` for display equations
- Keep each sentence on its own line in roxygen2 comments for better readability
- Document all arguments and return values
- Document internal functions using devtag (work in progress)
- Link to C documentation using `@cdocs` tag: `#' @cdocs igraph_function_name`
- Always run `devtools::document()` after updating documentation
Expand All @@ -77,6 +81,25 @@ pak::pak(dependencies = "Config/Needs/build")

- Use `max` for maximal (graph theory term: a vertex is maximal if no other vertex dominates it) and `largest` for maximum (the biggest value in a set)

### New functions

All new functions must include:

- Examples
- Tests
- Proper documentation, including arguments and return values
- A concept so that it exists in the pkgdown reference index
- An "experimental" badge via `r lifecycle::badge("experimental")`
- All arguments in `snake_case`, with documentation and suitable defaults
- An ellipsis guarded with `check_dots_empty()` separating mandatory and optional arguments
- Argument validation using built-in `check_*()` functions or `igraph_arg_match()`

If exporting a new function from the C library:

- Ensure it is autogenerated
- Add tests for the `_impl` function
- Name all arguments in all calls to the `_impl` function

## File Structure and Organization

### Test Files
Expand All @@ -95,9 +118,19 @@ Update them using: `make -f Makefile-cigraph src/rinterface.c R/aaa-auto.R`

See `tools/README.md` for guidelines on code generation using the Stimulus framework.

### Build Artifacts

Do not commit: `*.d`, `*.o`, `*.so` files in `src/`, and `tests/testthat/testthat-problems.rds`.
These are build artifacts that are regenerated automatically (see `src/README.md` for details on dependency tracking).

Careful with changes to `*.dd`, keep system headers out, only expect changes if new source files are added or their local dependencies change.

## Testing

- Add test cases for all new functionality
- For newly created autogenerated functions, always add a test to `test-aaa-auto.R`
- Test file naming should mirror source file naming
- Implement both structured and snapshot tests. For the latter, ensure stability by setting a random seed and calling `local_igraph_options(print.id = FALSE)` if graph IDs are involved.
- When testing error behavior, prefer snapshot tests.
- Run tests frequently during development and at the end: `testthat::test_local(reporter = "check")`
- Run `devtools::check()` as a final step to ensure all checks pass.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: igraph
Title: Network Analysis and Visualization
Version: 2.2.1.9000
Version: 2.2.1.9003
Authors@R: c(
person("Gábor", "Csárdi", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-7098-9676")),
Expand Down
13 changes: 13 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export(centralize)
export(centralize.scores)
export(chordal_ring)
export(chung_lu)
export(circulant)
export(cit_cit_types)
export(cit_types)
export(cited.type.game)
Expand Down Expand Up @@ -272,9 +273,11 @@ export(count.multiple)
export(count_automorphisms)
export(count_components)
export(count_isomorphisms)
export(count_loops)
export(count_max_cliques)
export(count_motifs)
export(count_multiple)
export(count_reachable)
export(count_subgraph_isomorphisms)
export(count_triangles)
export(create.communities)
Expand Down Expand Up @@ -366,6 +369,7 @@ export(from_prufer)
export(full_bipartite_graph)
export(full_citation_graph)
export(full_graph)
export(full_multipartite)
export(get.adjacency)
export(get.adjedgelist)
export(get.adjlist)
Expand Down Expand Up @@ -529,6 +533,7 @@ export(induced_subgraph)
export(infomap.community)
export(interconnected.islands.game)
export(intersection)
export(invalidate_cache)
export(is.bipartite)
export(is.chordal)
export(is.connected)
Expand Down Expand Up @@ -648,6 +653,7 @@ export(local_scan)
export(make_)
export(make_bipartite_graph)
export(make_chordal_ring)
export(make_circulant)
export(make_clusters)
export(make_de_bruijn_graph)
export(make_directed_graph)
Expand All @@ -657,6 +663,7 @@ export(make_from_prufer)
export(make_full_bipartite_graph)
export(make_full_citation_graph)
export(make_full_graph)
export(make_full_multipartite)
export(make_graph)
export(make_kautz_graph)
export(make_lattice)
Expand All @@ -665,6 +672,8 @@ export(make_neighborhood_graph)
export(make_ring)
export(make_star)
export(make_tree)
export(make_tri_lattice)
export(make_turan)
export(make_undirected_graph)
export(match_vertices)
export(max_bipartite_match)
Expand All @@ -681,6 +690,7 @@ export(maximal.independent.vertex.sets)
export(maximal_ivs)
export(maximum.bipartite.matching)
export(maximum.cardinality.search)
export(mean_degree)
export(mean_distance)
export(membership)
export(merge_coords)
Expand Down Expand Up @@ -865,11 +875,14 @@ export(topo_sort)
export(topological.sort)
export(traits)
export(traits_callaway)
export(transitive_closure)
export(transitivity)
export(tree)
export(tri_lattice)
export(triad.census)
export(triad_census)
export(triangles)
export(turan)
export(undirected_graph)
export(unfold.tree)
export(unfold_tree)
Expand Down
139 changes: 139 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,144 @@
<!-- NEWS.md is maintained by https://fledge.cynkra.com, contributors should not edit this file -->

# igraph 2.2.1.9003

## Bug fixes

- Fix `alpha_centrality()` crash when `weights` is a custom attribute name (#915, #2403).

## Features

- Add `make_full_multipartite()` and `make_turan()` graph constructors (#1562, #2406).

- Add `count_loops()` to R interface (#1379, #2414).

- Add `make_circulant()` to expose `igraph_circulant()` (#1563, #2407).

- Add `mean_degree()` to R (#1380, #2415).

- `vertices()` errors on duplicate attribute names (#1248, #2430).

- Add `count_reachable()` function to R (#1349, #2412).

## Chore

- Auto-update from GitHub Actions (#2454).


# igraph 2.2.1.9002

## Bug fixes

- Use `LC_ALL=C` instead of `LOCALE=C` in `deps.mk` (#2446, #2447).

## Features

- Add autogeneration for all C functions currently in use (#2424, #2442).

## Chore

- Format.

- Ensure args are named.

## Continuous integration

- Fix final status as set by Copilot \[ci skip\].

## Documentation

- More instructions \[ci skip\].

## Refactoring

- Switch from `.Call()` to autogenerated `_impl` functions (#2434, #2443).

## Testing

- Add structured tests alongside snapshot tests for ALL \_impl functions in test-aaa-auto.R (#2448, #2449).

## Uncategorized

- Merge branch 'cran-2.2.1'.


# igraph 2.2.1.9001

## Bug fixes

- Fix matrix lists for output.

## Features

- Add `invalidate_cache()` to R interface (#1387, #2416).

- All arguments in calls to `_impl()` functions are named (#2423).

## Chore

- Use `Rx_` prefix for manually generated functions.

- Clarify error testing preference \[ci skip\].

- Ignore \[ci skip\].

- Use `_impl` variants instead of inline `.Call()` for five functions with changed C signatures (#2428, #2429).

- Format \[ci skip\].

- Expand remaining `_impl` aliases (#2422).

- Remove unused `NTIMER` and `NPRINT` macro definitions (#1095, #2405).

- Cleanup.

- Request math notation.

### deps

- Bump jinja2 from 3.1.2 to 3.1.6 in /tools/py-stimulus (#2401).

- Replace `_impl` aliases in `R/flow.R` (#2347, #2379).

- Autogenerated file looks more like as if it was formatted with `air` (#2395).

## Continuous integration

- Run daily vendoring to avoid noise \[ci skip\].

- Snapshots \[ci skip\].

- Use proper actor name \[ci skip\].

- Reduce contention by running big matrices overnight.

- Add workflow to auto-assign to Copilot.

- Run running sanitizer only on cran branches to avoid pipeline contention.

## Documentation

- More instructions \[ci skip\].

- More instructions \[ci skip\].

- More instructions \[ci skip\].

- More instructions \[ci skip\].

- Experimental.

- New code \[ci skip\].

- Add GitHub Copilot instructions and expand AGENTS.md (#2397, #2400).

## Refactoring

- Replace `_impl` aliases with explicit wrapper functions in `R/topology.R` (#2366, #2398).

- Replace \_impl aliases in R/other.R (#2355, #2388).


# igraph 2.2.1.9000

## Chore
Expand Down
Loading