You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aeb44cc
Browse filesBrowse the repository at this point in the historyBrowse files
Brings the 2.3.4 hotfix to `main` once this branch is merged with a merge commit,
which makes the `v2.3.4` tag reachable from `main`.
Conflicts resolved:
- `.github/`, `.Rbuildignore`, `.gitignore`, `DESCRIPTION` and `tests/testthat/test-other.R` from `main`.
`main` keeps its development version, and its `test-other.R` fixture lives in a helper
and already uses `names =` in `structure()`.
- Rd files from `main`, which has the newer roxygen2.
`man/pipe.Rd` merges cleanly and keeps `\usage` from the hotfix.
- `CITATION.cff` from the hotfix, which names the released 2.3.4.
- `NEWS.md` with `main`'s development sections on top,
then the 2.3.4 section as in the tag message, then 2.3.3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iwyUfQ6pFAhL3jUUocHFm
- Document internal functions using devtag (work in progress)
80
80
- Link to C documentation using `@cdocs` tag: `#' @cdocs igraph_function_name`
81
+
- Write "ID"/"IDs" (not "id"/"ids") when referring to vertex/edge IDs in documentation *prose*. Lowercase stays only where the token is code: argument names, runnable `@examples`, and spans in `` `...` `` or `\code{}`. Run `Rscript tools/check-id-casing.R` to find violations in roxygen prose.
81
82
- Always run `devtools::document()` after updating documentation
82
83
83
84
### Naming Conventions
84
85
85
86
- 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)
87
+
- Use `make_xxx()` for functions creating graphs in a deterministic way, and `sample_xxx()` for functions sampling graphs from some ensemble
86
88
87
89
### New functions
88
90
@@ -94,7 +96,7 @@ All new functions must include:
94
96
- A concept so that it exists in the pkgdown reference index
95
97
- An "experimental" badge via `r lifecycle::badge("experimental")`
96
98
- All arguments in `snake_case`, with documentation and suitable defaults
97
-
- An ellipsis guarded with `check_dots_empty()` separating mandatory and optional arguments
99
+
- An ellipsis guarded with `check_dots_empty()` separating the head (required and defining arguments) from keyword-only options, following the zoning rules in [CONTRIBUTING.md](CONTRIBUTING.md#argument-order-and-the-ellipsis)
98
100
- Argument validation using built-in `check_*()` functions or `igraph_arg_match()`
[required args have no defaults](https://design.tidyverse.org/required-no-defaults.html))
191
+
with one deliberate deviation:
192
+
the tidyverse places `...` directly after the *required* arguments,
193
+
whereas we allow a small number of *defining optional* arguments
194
+
to stay ahead of it (rule 2 above).
195
+
igraph's API predates these conventions by two decades,
196
+
and idiomatic calls like `degree(g, 1:3)` or `sample_pa(100, 1.5)`
197
+
are pervasive in scripts, books, and teaching material.
198
+
Deprecating the idiomatic form of a function
199
+
would generate warning noise without a safety benefit;
200
+
the value of keyword-only arguments lies in the long tail of options,
201
+
not in the one or two arguments everyone knows by heart.
202
+
203
+
Defaults on either side of the ellipsis
204
+
must be *constant expressions* --
205
+
literals, `NULL`/`TRUE`/`FALSE`/`NA`,
206
+
`c()` or `list()` of constants,
207
+
or the `deprecated()` sentinel.
208
+
A complex default -- an option lookup, `V(graph)`,
209
+
a reference to another argument, a random draw --
210
+
is evaluated lazily at an unpredictable time
211
+
and hides the real behavior from the signature:
212
+
declare the formal as `NULL`
213
+
and resolve it in the body
214
+
after all arguments are available.
215
+
The migration generator enforces this rule for migrated signatures.
216
+
217
+
New functions follow the same zoning,
218
+
with `rlang::check_dots_empty()` guarding the ellipsis
219
+
(no migration machinery needed);
220
+
document the ellipsis with `@inheritParams rlang::args_dots_empty`.
221
+
222
+
For existing functions, the signature change is *migrated*:
223
+
a generated block recovers legacy positional or abbreviated calls
224
+
and emits a single soft deprecation,
225
+
so old code keeps working during a transition period.
226
+
See [Argument-migration blocks](tools/README.md#argument-migration-blocks)
227
+
for the mechanics,
228
+
and declare migrations in a per-topic registry file
229
+
under `tools/migrations/`.
230
+
144
231
### Documentation
145
232
146
233
- Install roxygen2 but also [igraph.r2cdocs](https://github.com/igraph/igraph.r2cdocs).
@@ -156,6 +243,15 @@ igraph` to update the `.Rd` files.
156
243
157
244
- Links to C docs are added automatically thanks to the igraph.r2cdocs's roclet.
158
245
246
+
- Write "ID"/"IDs" (not "id"/"ids") when referring to vertex or edge IDs in
247
+
documentation prose. Lowercase stays only where the token is code: argument
248
+
names, runnable `@examples`, and spans wrapped in `` `...` `` or `\code{}`. You
249
+
can check roxygen prose for stray lowercase forms with:
250
+
251
+
```sh
252
+
Rscript tools/check-id-casing.R
253
+
```
254
+
159
255
### Maintaining igraph.r2cdocs
160
256
161
257
To update the data (when the C docs index has changed after a release) in https://github.com/igraph/igraph.r2cdocs/, run the script that is `data-raw`, commit the csv file and push.
0 commit comments