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
Copy file name to clipboardExpand all lines: AGENTS.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,33 @@ Keep ROS-related changes confined to `ros2/` plus the documented root helpers, d
11
11
<!-- ros2-overlay-end -->
12
12
For python: Use python standard >= 3.12, matplotlib is the backend for most plots, but for images PIL and opencv are also used. For any statistics-like plot prefer seaborn, my default choice. Use pytorch for machine learning applications, supported by sklearn. Function names beings with Capital letter, snake case, methods not. Classes Similarly. Internal methods (not public API) must start with _, local scope variables end with _. All methods of classes shall start with small letter. Prefer dataclasses instead of dicts and enums instead of Literals if more than two entries. Type Hints Must Always Be Present. Onnx Export Compatibility Is Generally Required. When Writing New Classes Or Functions, A Runnable Example Should Always Be Present With Output To Show Results.
13
13
For C++/CUDA: C++17 and C++20 are the core standards. CUDA mainly >12.6. Answers should be on point without too many digressions, technical (for intermediate and advanced users) but simple enough to explain the concepts. Prefer using concepts over SFINAE. Unit tests using Catch2. Check files to see convention of names. Prefer Classes over structs.
14
+
15
+
### CMake and derived-project test policy
16
+
17
+
Do not copy template-conformance CMake verifiers into a derived project merely
18
+
because the donor template has them. In particular, do not register tests that
19
+
recursively configure and rebuild the same derived project inside its ordinary
20
+
CTest suite when a fresh configure/build/install/consumer command or CI job
21
+
already proves the contract.
22
+
23
+
For a derived project:
24
+
25
+
- prefer Catch2 or pytest for project runtime behavior;
packaging, and external consumers through explicit fresh out-of-tree
28
+
acceptance commands owned by local CI;
29
+
- use disposable consumer projects outside the normal test build when nested or
30
+
installed consumption must be proven;
31
+
- add a permanent CMake-script test only when it is lightweight, target-owned,
32
+
isolates behavior unavailable through an existing target/test, and does not
33
+
recursively rebuild the project;
34
+
- never import `VerifyTemplateProject*` or other donor self-validation tests as
35
+
product tests.
36
+
37
+
The template repository may retain broader conformance tests because it owns
38
+
generic generation and tailoring behavior. That exception does not make those
39
+
tests part of the derived-project contract.
40
+
14
41
For MATLAB: Use classes a lot also in MATLAB, with a python style, but do it only when it makes sense. Functions in MATLAB are often more efficient. Evaluate whether it makes sense to have stateful implementation. Use "self" instead of "obj". All variables names must specify the datatype of the variable since MATLAB does not (hungarian notation). The following list applies: d for double, f for float, b for bool, str for struct and not for strings, char for strings and chars, ui8 for uint8, i8 for int8. All the other integers are similar to the latter. Specify "obj" as prefix if an object, cell if a cell, table if a table; "bus_" if a Simulink bus. The names are always in Pascal case including the prefix, for instance ui8MyVariable. Never nest functions definitions within other functions, always do them separate or at most in the same file (after the main function implementation). Add them as local in the same function file only when not re-used elsewhere, otherwise prefer a single implementation. Function names and static methods of classes starts with Capital letter. Local functions names ends with underscore meaning "private". Names of variables must be explicative and tell what the variable does. Short names are not allowed unless "very local in scope". Use underscore for those variables and preferably Tmp within the name. For codes that are intended to be algorithms of some kind (e.g. not plots or things to run on the host PC), make them always MATLAB codegen safe (especially if codegen directive is used). In that case names should be limited to 31 chars. Add the same template of doc to functions as below and always specify arguments-end block for input and output:
Copy file name to clipboardExpand all lines: doc/template_usage.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,7 +134,21 @@ Only the main project configures documentation, tests, examples, wrappers, and g
134
134
135
135
## Tests
136
136
137
-
Use Catch2 for compiled tests, pytest for Python tests, and CTest as the common runner. Put compiled tests in `test*.cpp` or `test*.cu` files and Python tests in `test*.py` files. Add narrow CMake-script tests under `tests/cmake/` when the behavior is about configuration, installation, generated files, CI YAML, or documentation output rather than runtime C++ behavior.
137
+
Use Catch2 for compiled tests, pytest for Python tests, and CTest as the common
138
+
runner. Put compiled tests in `test*.cpp` or `test*.cu` files and Python tests in
139
+
`test*.py` files.
140
+
141
+
The template repository uses `tests/cmake/` for template-owned conformance,
142
+
tailoring, and generation checks. Do not copy those verifiers into a tailored
143
+
project. A derived project should prove configuration, feature matrices,
144
+
installation, packaging, and external consumption with explicit fresh
145
+
out-of-tree commands in its acceptance/CI matrix. Do not make ordinary CTest
146
+
recursively configure and rebuild the same project when CI already owns that
147
+
behavioral gate.
148
+
149
+
A permanent derived-project CMake-script test is justified only when it is
150
+
lightweight, project-specific, cannot be covered by an existing runtime target
151
+
or acceptance command, and does not recursively rebuild the project.
138
152
139
153
Run focused checks during development. Prefer `ctest --test-dir <build>` so the
140
154
same command works from the repository root, local scripts, and CI jobs:
@@ -202,6 +216,9 @@ The script replaces `template_project::logging` with the required project namesp
202
216
203
217
It also removes the root CMake hook for the template MATLAB regression helper and rewrites `tests/CMakeLists.txt` so only starter project unit tests remain registered.
204
218
219
+
This cleanup boundary is intentional: template CMake conformance tests remain
220
+
owned by the donor/testfield validation harness, not by the tailored product.
221
+
205
222
### Workflow materialization
206
223
207
224
The runnable `.github/workflows/*.yml` files in this repository validate the
0 commit comments