Skip to content

Commit 671558d

Browse files
Merge pull request #1585 from PrincetonUniversity/devel
Release Candidate 0.5.0
2 parents 0bb466c + 3cbd37d commit 671558d

File tree

4,506 files changed

+1503168
-166780
lines changed

Some content is hidden

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

4,506 files changed

+1503168
-166780
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
description: "Generate inline Doxygen block comments for C++ classes and functions using code context, references, and git history."
3+
tools: ['edit', 'search', 'runCommands', 'usages', 'changes', 'githubRepo']
4+
model: Claude Sonnet 4
5+
---
6+
7+
# C++ Inline Documentation Agent
8+
9+
You are a **C++ documentation assistant**.
10+
Your role is to produce **inline Doxygen block comments** for classes, functions, and members in this codebase.
11+
12+
## Goals
13+
- Read and parse C++ class definitions
14+
- Identify and categorize members (constructors, methods, operators, fields)
15+
- Search for code references where the class is instantiated or methods are called
16+
- Access recent git commit history for context
17+
- Generate Doxygen-style doc comments for:
18+
- The **class itself**
19+
- Each **constructor/destructor**
20+
- Public and protected member functions
21+
- Template parameters
22+
- Suggest relationships to other classes, namespaces, or design patterns
23+
- Provide usage examples in `@code ... @endcode` blocks
24+
- Ensure comments are clear, concise, and informative
25+
26+
## Best Practices
27+
- Always use **Doxygen block comments** in the form `/** ... */`.
28+
- Collect surrounding code context and member declarations.
29+
- Scan the repository for instantiations and method calls.
30+
- Fetch relevant git commits introducing or modifying the class/members.
31+
- Generate Doxygen comments for:
32+
- **Class-level docstring** with `@brief`, description, template parameters, inheritance notes, related classes.
33+
- **Constructor/destructor docs** describing object lifecycle.
34+
- **Method docs** using `@param`, `@return`, `@throws` (if applicable).
35+
- **Examples** (`@code` blocks) showing usage of the class and key methods.
36+
- **Mathematical notation** Use `\f$ ... \f$` for inline math.
37+
- Avoid speculation — rely only on available code, usage, and git history.
38+
39+
## Output Format
40+
- Place block comments **immediately above** the class or function.
41+
- Use consistent, structured phrasing.
42+
- Keep explanations informative but not verbose.
43+
- Include recent commit information if available.
44+
45+
---
46+
47+
### Example
48+
49+
```cpp
50+
/**
51+
* @brief A utility class for processing datasets.
52+
*
53+
* The DataProcessor class provides functionality to clean, normalize,
54+
* and validate datasets. It is commonly used in preprocessing pipelines
55+
* before machine learning tasks.
56+
*
57+
* @tparam T The record type stored in the dataset.
58+
*
59+
*
60+
* @code
61+
* std::vector<Record> raw = loadData("input.csv");
62+
* DataProcessor<Record> dp;
63+
* auto clean = dp.process(raw);
64+
* @endcode
65+
*/
66+
template <typename T>
67+
class DataProcessor {
68+
public:
69+
/**
70+
* @brief Default constructor.
71+
*
72+
* Initializes internal state for dataset processing.
73+
*/
74+
DataProcessor();
75+
76+
/**
77+
* @brief Process a dataset by cleaning and normalizing values.
78+
*
79+
* Removes invalid entries and applies optional z-score normalization.
80+
*
81+
* @param input The input dataset as a vector of records.
82+
* @param normalize If true, applies normalization (default: true).
83+
* @return A new dataset with cleaned and optionally normalized values.
84+
*
85+
* @code
86+
* DataProcessor<Record> dp;
87+
* auto clean = dp.process(raw, false);
88+
* @endcode
89+
*/
90+
std::vector<T> process(const std::vector<T>& input, bool normalize = true);
91+
92+
/**
93+
* @brief Destructor.
94+
*
95+
* Cleans up resources associated with the processor.
96+
*/
97+
~DataProcessor();
98+
};
99+
```

.github/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ changelog:
1111
- title: 🎉 New Feature
1212
labels:
1313
- feature
14-
- title: 👨‍🔬 New physics
14+
- title: 👨‍🔬 New physics
1515
labels:
1616
- new physics
1717
- title: 🚀 Performance enhancement
@@ -30,7 +30,7 @@ changelog:
3030
- title: Fortran Meshfem2D/3D updates
3131
labels:
3232
- fortran
33-
- title: Refactor
33+
- title: Refactor
3434
labels:
3535
- refactor
3636
- title: 🐛 Bug Fixes

.github/workflows/compilation.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,26 @@ on:
1010
- '*' # All branches
1111

1212
jobs:
13-
build-serial:
13+
build-debug:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Check GNU and Cmake versions
1717
run: gcc --version && cmake --version
1818
- name: Checkout repository
1919
uses: actions/checkout@v1
2020
- name: Configure Serial build
21-
run: cmake -S . -B build
21+
run: cmake --preset debug
2222
- name: Build
23-
run: cmake --build build
23+
run: cmake --build --preset debug -j 2
24+
25+
build-release:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Check GNU and Cmake versions
29+
run: gcc --version && cmake --version
30+
- name: Checkout repository
31+
uses: actions/checkout@v1
32+
- name: Configure Serial build
33+
run: cmake --preset release
34+
- name: Build
35+
run: cmake --build --preset release -j 2
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
name: Automate Project Dates
2+
3+
on:
4+
issues:
5+
types: [opened, edited, closed, reopened]
6+
# Note: project_card is for legacy projects. For Projects V2, we need to use other triggers
7+
# The workflow will run when issues/PRs change, then check if project status changed
8+
9+
jobs:
10+
update-project-dates:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Get Project Item
14+
id: get_item
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
// Get the project item details
19+
const query = `
20+
query($owner: String!, $repo: String!, $issueNumber: Int!) {
21+
repository(owner: $owner, name: $repo) {
22+
issue(number: $issueNumber) {
23+
projectItems(first: 10) {
24+
nodes {
25+
id
26+
project {
27+
id
28+
number
29+
}
30+
fieldValues(first: 20) {
31+
nodes {
32+
... on ProjectV2ItemFieldSingleSelectValue {
33+
name
34+
field {
35+
... on ProjectV2SingleSelectField {
36+
name
37+
}
38+
}
39+
}
40+
... on ProjectV2ItemFieldDateValue {
41+
date
42+
field {
43+
... on ProjectV2Field {
44+
name
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
51+
}
52+
}
53+
}
54+
}
55+
`;
56+
57+
const variables = {
58+
owner: context.repo.owner,
59+
repo: context.repo.repo,
60+
issueNumber: context.issue?.number || context.payload.pull_request?.number
61+
};
62+
63+
if (!variables.issueNumber) {
64+
console.log('No issue or PR number found');
65+
return;
66+
}
67+
68+
const result = await github.graphql(query, variables);
69+
const projectItems = result.repository.issue.projectItems.nodes;
70+
71+
for (const item of projectItems) {
72+
console.log(`Processing project item: ${item.id}`);
73+
74+
// Find status field value
75+
let currentStatus = null;
76+
let startDate = null;
77+
let endDate = null;
78+
let statusFieldId = null;
79+
let startDateFieldId = null;
80+
let endDateFieldId = null;
81+
82+
// First, get field IDs from the project
83+
const projectQuery = `
84+
query($projectId: ID!) {
85+
node(id: $projectId) {
86+
... on ProjectV2 {
87+
fields(first: 20) {
88+
nodes {
89+
... on ProjectV2Field {
90+
id
91+
name
92+
}
93+
... on ProjectV2SingleSelectField {
94+
id
95+
name
96+
}
97+
}
98+
}
99+
}
100+
}
101+
}
102+
`;
103+
104+
const projectResult = await github.graphql(projectQuery, {
105+
projectId: item.project.id
106+
});
107+
108+
const fields = projectResult.node.fields.nodes;
109+
110+
// Map field names to IDs (using exact field names)
111+
for (const field of fields) {
112+
if (field.name.toLowerCase() === 'status') {
113+
statusFieldId = field.id;
114+
} else if (field.name === 'Start Date') {
115+
startDateFieldId = field.id;
116+
} else if (field.name === 'End Date') {
117+
endDateFieldId = field.id;
118+
}
119+
}
120+
121+
// Get current field values
122+
for (const fieldValue of item.fieldValues.nodes) {
123+
if (fieldValue.field?.name?.toLowerCase() === 'status') {
124+
currentStatus = fieldValue.name;
125+
} else if (fieldValue.field?.name === 'Start Date') {
126+
startDate = fieldValue.date;
127+
} else if (fieldValue.field?.name === 'End Date') {
128+
endDate = fieldValue.date;
129+
}
130+
}
131+
132+
console.log(`Current status: ${currentStatus}`);
133+
console.log(`Start date: ${startDate}`);
134+
console.log(`End date: ${endDate}`);
135+
136+
const today = new Date().toISOString().split('T')[0];
137+
138+
// Only update dates if they don't already exist (this prevents overwriting existing dates)
139+
// Update start date if status is "In progress 🧑‍💻" and no start date exists
140+
if (currentStatus === 'In progress 🧑‍💻' && !startDate && startDateFieldId) {
141+
console.log('Setting start date to today');
142+
await github.graphql(`
143+
mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $value: Date!) {
144+
updateProjectV2ItemFieldValue(input: {
145+
projectId: $projectId
146+
itemId: $itemId
147+
fieldId: $fieldId
148+
value: { date: $value }
149+
}) {
150+
projectV2Item {
151+
id
152+
}
153+
}
154+
}
155+
`, {
156+
projectId: item.project.id,
157+
itemId: item.id,
158+
fieldId: startDateFieldId,
159+
value: today
160+
});
161+
}
162+
163+
// Update end date if status is "Done ✅" and no end date exists
164+
if (currentStatus === 'Done ✅' && !endDate && endDateFieldId) {
165+
console.log('Setting end date to today');
166+
await github.graphql(`
167+
mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $value: Date!) {
168+
updateProjectV2ItemFieldValue(input: {
169+
projectId: $projectId
170+
itemId: $itemId
171+
fieldId: $fieldId
172+
value: { date: $value }
173+
}) {
174+
projectV2Item {
175+
id
176+
}
177+
}
178+
}
179+
`, {
180+
projectId: item.project.id,
181+
itemId: item.id,
182+
fieldId: endDateFieldId,
183+
value: today
184+
});
185+
}
186+
}
187+
env:
188+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/unittests.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,24 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@v1
2121
- name: Configure
22-
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=ON
22+
run: cmake --preset release
2323
- name: Build
24-
run: cmake --build build
24+
run: cmake --build --preset release -j 2
2525
- name: Run all tests
26-
run: cd build/tests/unit-tests
26+
run: cd build/release/tests/unit-tests
27+
&& ctest --verbose
28+
# This job is for building and testing with IO dependencies like HDF5 and ADIOS2
29+
build-and-test-with-io-dependencies:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Check GNU and Cmake versions
33+
run: gcc --version && cmake --version
34+
- name: Checkout repository
35+
uses: actions/checkout@v1
36+
- name: Configure
37+
run: cmake --preset release-io
38+
- name: Build
39+
run: cmake --build --preset release-io -j 2
40+
- name: Run all tests
41+
run: cd build/release-io/tests/unit-tests
2742
&& ctest --verbose

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ CMakeUserPresets.json
22
.vscode/
33
.DS_Store
44
build*/*
5+
build
56
_build/
67
_templates/
78
public/
@@ -35,3 +36,7 @@ test*.hpp
3536
include/specfem_setup.hpp
3637
install
3738
bin
39+
40+
41+
**/__pycache__
42+
.github/prompts/ConciseDocument.prompt.md

0 commit comments

Comments
 (0)