Skip to content

Commit 780619b

Browse files
Copilotkrlmlr
andcommitted
Merge main and update make_tri_lattice() per updated AGENTS.md
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
1 parent a804fd0 commit 780619b

File tree

138 files changed

+12282
-2604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+12282
-2604
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
ref: ${{ inputs.ref }}
7777

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

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

220220
- name: Update status for rcc (Copilot)
221221
# Update status directly when triggered by Copilot or bots, since they can't dispatch workflows
222-
if: always() && (github.actor == 'github-copilot[bot]')
222+
if: always() && (github.actor == 'Copilot')
223223
env:
224224
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225225
run: |
226-
# Check status of this workflow
227-
state="pending"
226+
# Set status to success if job succeeded, failure otherwise
227+
if [ "${{ job.status }}" == "success" ]; then
228+
state="success"
229+
else
230+
state="failure"
231+
fi
228232
sha=${{ inputs.ref }}
229233
if [ -z "${sha}" ]; then
230234
sha=${{ github.sha }}

.github/workflows/vendor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- "vendor-one.sh"
88
workflow_dispatch:
99
schedule:
10-
- cron: "0 * * * *"
10+
- cron: "* 0 * * *"
1111

1212
concurrency:
1313
group: ${{ github.workflow }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ cran
2222
/rchk
2323
/src/*.d
2424
/src/symbols.rds
25+
/tests/testthat/testthat-problems.rds
2526
/covr
27+
/.vscode/launch.json

AGENTS.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ pak::pak(dependencies = "Config/Needs/build")
3131

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

3636
### Building and Testing
3737

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

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

5960
### R Code Conventions
6061

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

6870
### Documentation
6971

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

7882
- 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)
7983

84+
### New functions
85+
86+
All new functions must include:
87+
88+
- Examples
89+
- Tests
90+
- Proper documentation, including arguments and return values
91+
- A concept so that it exists in the pkgdown reference index
92+
- An "experimental" badge via `r lifecycle::badge("experimental")`
93+
- All arguments in `snake_case`, with documentation and suitable defaults
94+
- An ellipsis guarded with `check_dots_empty()` separating mandatory and optional arguments
95+
- Argument validation using built-in `check_*()` functions or `igraph_arg_match()`
96+
97+
If exporting a new function from the C library:
98+
99+
- Ensure it is autogenerated
100+
- Add tests for the `_impl` function
101+
- Name all arguments in all calls to the `_impl` function
102+
80103
## File Structure and Organization
81104

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

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

121+
### Build Artifacts
122+
123+
Do not commit: `*.d`, `*.o`, `*.so` files in `src/`, and `tests/testthat/testthat-problems.rds`.
124+
These are build artifacts that are regenerated automatically (see `src/README.md` for details on dependency tracking).
125+
126+
Careful with changes to `*.dd`, keep system headers out, only expect changes if new source files are added or their local dependencies change.
127+
98128
## Testing
99129

100130
- Add test cases for all new functionality
101131
- For newly created autogenerated functions, always add a test to `test-aaa-auto.R`
102132
- Test file naming should mirror source file naming
133+
- 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.
134+
- When testing error behavior, prefer snapshot tests.
103135
- Run tests frequently during development and at the end: `testthat::test_local(reporter = "check")`
136+
- Run `devtools::check()` as a final step to ensure all checks pass.

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: igraph
22
Title: Network Analysis and Visualization
3-
Version: 2.2.1.9000
3+
Version: 2.2.1.9003
44
Authors@R: c(
55
person("Gábor", "Csárdi", , "csardi.gabor@gmail.com", role = "aut",
66
comment = c(ORCID = "0000-0001-7098-9676")),

NAMESPACE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export(centralize)
222222
export(centralize.scores)
223223
export(chordal_ring)
224224
export(chung_lu)
225+
export(circulant)
225226
export(cit_cit_types)
226227
export(cit_types)
227228
export(cited.type.game)
@@ -272,9 +273,11 @@ export(count.multiple)
272273
export(count_automorphisms)
273274
export(count_components)
274275
export(count_isomorphisms)
276+
export(count_loops)
275277
export(count_max_cliques)
276278
export(count_motifs)
277279
export(count_multiple)
280+
export(count_reachable)
278281
export(count_subgraph_isomorphisms)
279282
export(count_triangles)
280283
export(create.communities)
@@ -366,6 +369,7 @@ export(from_prufer)
366369
export(full_bipartite_graph)
367370
export(full_citation_graph)
368371
export(full_graph)
372+
export(full_multipartite)
369373
export(get.adjacency)
370374
export(get.adjedgelist)
371375
export(get.adjlist)
@@ -529,6 +533,7 @@ export(induced_subgraph)
529533
export(infomap.community)
530534
export(interconnected.islands.game)
531535
export(intersection)
536+
export(invalidate_cache)
532537
export(is.bipartite)
533538
export(is.chordal)
534539
export(is.connected)
@@ -648,6 +653,7 @@ export(local_scan)
648653
export(make_)
649654
export(make_bipartite_graph)
650655
export(make_chordal_ring)
656+
export(make_circulant)
651657
export(make_clusters)
652658
export(make_de_bruijn_graph)
653659
export(make_directed_graph)
@@ -657,6 +663,7 @@ export(make_from_prufer)
657663
export(make_full_bipartite_graph)
658664
export(make_full_citation_graph)
659665
export(make_full_graph)
666+
export(make_full_multipartite)
660667
export(make_graph)
661668
export(make_kautz_graph)
662669
export(make_lattice)
@@ -666,6 +673,7 @@ export(make_ring)
666673
export(make_star)
667674
export(make_tree)
668675
export(make_tri_lattice)
676+
export(make_turan)
669677
export(make_undirected_graph)
670678
export(match_vertices)
671679
export(max_bipartite_match)
@@ -682,6 +690,7 @@ export(maximal.independent.vertex.sets)
682690
export(maximal_ivs)
683691
export(maximum.bipartite.matching)
684692
export(maximum.cardinality.search)
693+
export(mean_degree)
685694
export(mean_distance)
686695
export(membership)
687696
export(merge_coords)
@@ -866,12 +875,14 @@ export(topo_sort)
866875
export(topological.sort)
867876
export(traits)
868877
export(traits_callaway)
878+
export(transitive_closure)
869879
export(transitivity)
870880
export(tree)
871881
export(tri_lattice)
872882
export(triad.census)
873883
export(triad_census)
874884
export(triangles)
885+
export(turan)
875886
export(undirected_graph)
876887
export(unfold.tree)
877888
export(unfold_tree)

NEWS.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,144 @@
11
<!-- NEWS.md is maintained by https://fledge.cynkra.com, contributors should not edit this file -->
22

3+
# igraph 2.2.1.9003
4+
5+
## Bug fixes
6+
7+
- Fix `alpha_centrality()` crash when `weights` is a custom attribute name (#915, #2403).
8+
9+
## Features
10+
11+
- Add `make_full_multipartite()` and `make_turan()` graph constructors (#1562, #2406).
12+
13+
- Add `count_loops()` to R interface (#1379, #2414).
14+
15+
- Add `make_circulant()` to expose `igraph_circulant()` (#1563, #2407).
16+
17+
- Add `mean_degree()` to R (#1380, #2415).
18+
19+
- `vertices()` errors on duplicate attribute names (#1248, #2430).
20+
21+
- Add `count_reachable()` function to R (#1349, #2412).
22+
23+
## Chore
24+
25+
- Auto-update from GitHub Actions (#2454).
26+
27+
28+
# igraph 2.2.1.9002
29+
30+
## Bug fixes
31+
32+
- Use `LC_ALL=C` instead of `LOCALE=C` in `deps.mk` (#2446, #2447).
33+
34+
## Features
35+
36+
- Add autogeneration for all C functions currently in use (#2424, #2442).
37+
38+
## Chore
39+
40+
- Format.
41+
42+
- Ensure args are named.
43+
44+
## Continuous integration
45+
46+
- Fix final status as set by Copilot \[ci skip\].
47+
48+
## Documentation
49+
50+
- More instructions \[ci skip\].
51+
52+
## Refactoring
53+
54+
- Switch from `.Call()` to autogenerated `_impl` functions (#2434, #2443).
55+
56+
## Testing
57+
58+
- Add structured tests alongside snapshot tests for ALL \_impl functions in test-aaa-auto.R (#2448, #2449).
59+
60+
## Uncategorized
61+
62+
- Merge branch 'cran-2.2.1'.
63+
64+
65+
# igraph 2.2.1.9001
66+
67+
## Bug fixes
68+
69+
- Fix matrix lists for output.
70+
71+
## Features
72+
73+
- Add `invalidate_cache()` to R interface (#1387, #2416).
74+
75+
- All arguments in calls to `_impl()` functions are named (#2423).
76+
77+
## Chore
78+
79+
- Use `Rx_` prefix for manually generated functions.
80+
81+
- Clarify error testing preference \[ci skip\].
82+
83+
- Ignore \[ci skip\].
84+
85+
- Use `_impl` variants instead of inline `.Call()` for five functions with changed C signatures (#2428, #2429).
86+
87+
- Format \[ci skip\].
88+
89+
- Expand remaining `_impl` aliases (#2422).
90+
91+
- Remove unused `NTIMER` and `NPRINT` macro definitions (#1095, #2405).
92+
93+
- Cleanup.
94+
95+
- Request math notation.
96+
97+
### deps
98+
99+
- Bump jinja2 from 3.1.2 to 3.1.6 in /tools/py-stimulus (#2401).
100+
101+
- Replace `_impl` aliases in `R/flow.R` (#2347, #2379).
102+
103+
- Autogenerated file looks more like as if it was formatted with `air` (#2395).
104+
105+
## Continuous integration
106+
107+
- Run daily vendoring to avoid noise \[ci skip\].
108+
109+
- Snapshots \[ci skip\].
110+
111+
- Use proper actor name \[ci skip\].
112+
113+
- Reduce contention by running big matrices overnight.
114+
115+
- Add workflow to auto-assign to Copilot.
116+
117+
- Run running sanitizer only on cran branches to avoid pipeline contention.
118+
119+
## Documentation
120+
121+
- More instructions \[ci skip\].
122+
123+
- More instructions \[ci skip\].
124+
125+
- More instructions \[ci skip\].
126+
127+
- More instructions \[ci skip\].
128+
129+
- Experimental.
130+
131+
- New code \[ci skip\].
132+
133+
- Add GitHub Copilot instructions and expand AGENTS.md (#2397, #2400).
134+
135+
## Refactoring
136+
137+
- Replace `_impl` aliases with explicit wrapper functions in `R/topology.R` (#2366, #2398).
138+
139+
- Replace \_impl aliases in R/other.R (#2355, #2388).
140+
141+
3142
# igraph 2.2.1.9000
4143

5144
## Chore

0 commit comments

Comments
 (0)