Skip to content

Commit bf69334

Browse files
authored
Merge pull request #158 from GeoPressure/dev
v3.5.2
2 parents 093951c + 041f21e commit bf69334

77 files changed

Lines changed: 1077 additions & 520 deletions

Some content is hidden

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

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
^LICENSE\.md$
99
^README\.Rmd$
1010
^\.github$
11+
^\.githooks$
1112
^codecov\.yml$
1213
^GeoPressureR.Rproj$
1314
^doc$

.githooks/pre-commit

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
# Regenerate codemeta when DESCRIPTION is staged.
5+
if git diff --cached --name-only | grep -q '^DESCRIPTION$'; then
6+
if ! command -v Rscript >/dev/null 2>&1; then
7+
echo "pre-commit: Rscript not found; cannot update codemeta.json" >&2
8+
exit 1
9+
fi
10+
11+
Rscript -e 'if (!requireNamespace("codemetar", quietly = TRUE)) stop("Install `codemetar` to auto-sync codemeta.json from DESCRIPTION."); codemetar::write_codemeta()'
12+
git add codemeta.json
13+
echo "pre-commit: updated codemeta.json from DESCRIPTION"
14+
fi

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,3 @@ docs/
4444
inst/geopressureviz/geopressureviz.RData
4545
inst/geopressureviz/rsconnect
4646
inst/extdata/data/interim/18LX.RData
47-
AGENTS.md

AGENTS.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# AGENTS.md
2+
3+
## Scope
4+
- Applies to the whole repository.
5+
- Covers: **code edits, tests, and documentation**.
6+
- Default mode is **minimal, surgical modification** unless explicitly asked otherwise.
7+
8+
9+
## Language and dependencies
10+
- Use **base R (≥ 4.1)**.
11+
- Native pipe `|>` is allowed and preferred.
12+
- **Do not introduce new dependencies**.
13+
- Existing dependencies (e.g. `cli`, `glue`) may be used.
14+
- Use `glue::glue()` for string interpolation.
15+
- Avoid `paste()` unless strictly necessary for performance-critical code.
16+
17+
18+
## General principles
19+
- Assume inputs are **valid and well-formed**.
20+
- Do not add defensive programming or guards unless explicitly requested.
21+
- Prefer the **shortest correct implementation**.
22+
- Avoid unnecessary line breaks and verbosity.
23+
- Avoid introducing new variables unless they:
24+
- prevent recomputation, or
25+
- are required for correctness or performance.
26+
27+
28+
## Performance
29+
- **Performance is a priority**.
30+
- Always prefer:
31+
- vectorized operations
32+
- matrix/array operations
33+
- `rowSums`, `colSums`, `sweep`, `%*%`, `outer`
34+
- Prefer faster primitives over `apply()` when possible.
35+
- `apply()` and `Map()` are allowed when they are efficient and appropriate.
36+
- Avoid:
37+
- unnecessary copies
38+
- repeated computation
39+
- hidden coercions
40+
- Do not optimize memory vs speed unless explicitly requested.
41+
42+
43+
## Code style and structure
44+
45+
### Pipes
46+
- Prefer compact pipe chains:
47+
```r
48+
x |> f() |> g() |> h()
49+
```
50+
- Do not introduce intermediate variables unless justified.
51+
52+
### Comments
53+
- Add minimal comments per logical section.
54+
- Comments describe **intent**, not obvious behavior.
55+
- Use short section headers when needed:
56+
```r
57+
# Compute pressure mismatch
58+
# Normalize likelihood surface
59+
```
60+
61+
### Function edits
62+
- Make the **smallest possible patch**.
63+
- Do not refactor unrelated code.
64+
- Do not reorder code unless required.
65+
66+
67+
## Validation and checks
68+
- Input validation belongs **only at public function entry points**.
69+
- Internal/helper functions should have **no validation**.
70+
- Do not add checks unless there is a **real risk of silent failure or corrupted results**.
71+
72+
73+
## Numerical stability
74+
- Preserve existing numerical behavior by default.
75+
- You may introduce safeguards **only when there is clear instability risk**, such as:
76+
- `log(0)`
77+
- division by zero
78+
- unstable normalization
79+
- When adding such safeguards:
80+
- keep them minimal
81+
- **explicitly explain why they are needed**
82+
83+
84+
## Output invariants (strict)
85+
Edits must preserve:
86+
- class
87+
- dimensions
88+
- ordering
89+
- column names
90+
- attributes
91+
92+
If a change would improve performance or correctness but break these:
93+
- **do not apply it silently**
94+
- explain the tradeoff and ask or clearly flag it
95+
96+
97+
## Error handling
98+
- Do not introduce `tryCatch()` or defensive error handling.
99+
- Errors should occur naturally unless explicitly handled at entry points.
100+
101+
102+
## Matrix and vector behavior
103+
- Prefer matrix/array operations for performance.
104+
- Avoid unnecessary conversion between matrix and data.frame.
105+
- Preserve original data structures.
106+
107+
108+
## Silent failure risks
109+
Only intervene if there is clear risk of:
110+
- unintended recycling
111+
- dimension dropping
112+
- implicit coercion
113+
- invalid numerical operations
114+
115+
Otherwise, assume correct usage.
116+
117+
118+
## Rewriting vs patching
119+
- Default: **minimal patch**
120+
- If code is clearly inconsistent, inefficient, or unclear:
121+
- rewriting the function is allowed
122+
- **must explicitly warn the user**
123+
124+
125+
## Tests and documentation
126+
- Do not add or modify tests unless explicitly requested.
127+
- Do not add documentation (roxygen, README, vignettes) unless requested.
128+
129+
130+
## Hard constraints (never do)
131+
- Do not introduce new dependencies
132+
- Do not add unnecessary validation
133+
- Do not refactor unrelated code
134+
- Do not change output structure silently
135+
- Do not convert data structures unnecessarily
136+
- Do not add helper functions used only once
137+
138+
139+
## Uncertainty
140+
- If requirements are unclear or incomplete, **ask for clarification**.
141+
- Do not guess when behavior may change.

CITATION.cff

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ message: 'To cite package "GeoPressureR" in publications use:'
88
type: software
99
license: GPL-3.0-or-later
1010
title: 'GeoPressureR: Global Positioning by Atmospheric Pressure'
11-
version: 3.5.1
11+
version: 3.5.2
1212
doi: 10.5281/zenodo.7754457
1313
abstract: R package to determine the position and trajectory of a bird based on light-weight
1414
data-logger measuring at lease atmospheric pressure.
@@ -35,9 +35,9 @@ preferred-citation:
3535
orcid: https://orcid.org/0000-0002-0871-1507
3636
year: '2022'
3737
doi: 10.5281/zenodo.7754457
38-
url: https://github.com/Rafnuss/GeoPressureR
39-
repository-code: https://github.com/Rafnuss/GeoPressureR
40-
url: https://raphaelnussbaumer.com/GeoPressureR/
38+
url: https://github.com/GeoPressure/GeoPressureR
39+
repository-code: https://github.com/GeoPressure/GeoPressureR
40+
url: https://geopressure.org/GeoPressureR/
4141
contact:
4242
- family-names: Nussbaumer
4343
given-names: Raphaël
@@ -51,7 +51,6 @@ keywords:
5151
- migration
5252
- pressure-sensor
5353
- r
54-
- tracker
5554
- windspeed
5655
references:
5756
- type: article
@@ -121,7 +120,7 @@ references:
121120
orcid: https://orcid.org/0000-0003-1308-4154
122121
year: '2024'
123122
doi: 10.5281/zenodo.10799355
124-
url: https://github.com/Rafnuss/GeoPressureManual
123+
url: https://github.com/GeoPressure/GeoPressureManual
125124
- type: software
126125
title: 'R: A Language and Environment for Statistical Computing'
127126
notes: Depends

DESCRIPTION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: GeoPressureR
22
Title: Global Positioning by Atmospheric Pressure
3-
Version: 3.5.1
3+
Version: 3.5.2
44
Authors@R: c(
55
person("Raphaël", "Nussbaumer", , "rafnuss@gmail.com", role = c("aut", "cre", "cph"),
66
comment = c(ORCID = "0000-0002-8185-1020")),
@@ -9,9 +9,9 @@ Authors@R: c(
99
)
1010
Description: R package to determine the position and trajectory of a bird based on light-weight data-logger measuring at lease atmospheric pressure.
1111
License: GPL (>= 3)
12-
URL: https://github.com/Rafnuss/GeoPressureR,
13-
https://raphaelnussbaumer.com/GeoPressureR/
14-
BugReports: https://github.com/Rafnuss/GeoPressureR/issues
12+
URL: https://github.com/GeoPressure/GeoPressureR,
13+
https://geopressure.org/GeoPressureR/
14+
BugReports: https://github.com/GeoPressure/GeoPressureR/issues
1515
Depends:
1616
R (>= 4.1.0)
1717
Imports:

0 commit comments

Comments
 (0)