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: docs/src/conventions.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ The `_todf` suffix provides a concise and immediately recognizable identifier fo
112
112
113
113
## Docstrings
114
114
115
-
The following docstring standards are generally adopted across the codebase. The phrasing in this section is optimized to be passed as `<custom instructions>` to have an LLM doing the heavy lifting.
115
+
The following docstring standards are generally adopted across the codebase.
116
116
117
117
### General Docstring principles
118
118
@@ -145,13 +145,13 @@ All variables corresponding to physical quantities must be annotated with their
145
145
-**Correct:**`\\mu_r`, ```math \\frac{a}{b}```
146
146
-**Incorrect:**`\mu_r`, ```math \frac{a}{b}```
147
147
148
-
### Documentation structure by entity type
148
+
### Documentation templates
149
149
150
-
Adhere strictly to the following structures for different code entities.
150
+
The subsections below contain templates for different types of code elements.
151
151
152
152
#### 1. Structs
153
153
154
-
-**Main docstring:** Use `$(TYPEDEF)` for the signature and `$(TYPEDFIELDS)` to list the fields automatically. Provide a concise description of the struct's purpose.
154
+
-**Main docstring:** Use `$(TYPEDEF)` for the signature and `$(TYPEDFIELDS)` to list the fields automatically. Provide a concise description of the struct purpose.
155
155
156
156
```julia
157
157
"""
@@ -169,11 +169,11 @@ Adhere strictly to the following structures for different code entities.
169
169
-**Field documentation:**
170
170
- Place *directly above* each field definition.
171
171
- Use single-line double quotes:`"Description with units \\[unit\\] or \\[dimensionless\\] if applicable."`
172
-
-**CRITICAL:**Do NOT use `""" """` block quotes or inline comments (`#`) for documenting struct fields.
172
+
- Do NOT use `""" """` block quotes or inline comments (`#`) for documenting struct fields.
173
173
174
174
#### 2. Constructors (inside or outside structs)
175
175
176
-
-**CRITICAL:**ALL constructors MUST be documented using the `@doc`macro placed immediately before the `function` keyword or the compact assignment form (`TypeName(...) = ...`). This applies even to default constructors if explicitly defined.
176
+
- ALL constructors MUST be documented using the `@doc`macro placed immediately before the `function` keyword or the compact assignment form (`TypeName(...) = ...`). This applies even to default constructors if explicitly defined.
177
177
-**Format:** Use `$(TYPEDSIGNATURES)`. Include standard sections (`Arguments`, `Returns`, `Examples`).
178
178
179
179
````julia
@@ -204,7 +204,7 @@ Adhere strictly to the following structures for different code entities.
204
204
205
205
#### 3. Functions / methods
206
206
207
-
- **Format:** Start with `$(TYPEDSIGNATURES)`. Follow the mandatory section order.
207
+
- **Format:** Start with `$(TYPEDSIGNATURES)`. Follow the section order described.
208
208
209
209
````julia
210
210
"""
@@ -248,7 +248,7 @@ Adhere strictly to the following structures for different code entities.
248
248
end
249
249
````
250
250
251
-
- **Section order (MANDATORY):**
251
+
- **Section order:**
252
252
1. Description (no heading)
253
253
2. `# Arguments`
254
254
3. `# Returns`
@@ -289,7 +289,7 @@ Adhere strictly to the following structures for different code entities.
289
289
290
290
#### 5. Constants
291
291
292
-
- **Format:** Use a single-line docstring with double quotes (`"..."`). Include a brief description, the constant's symbol if standard (e.g., `μ₀`), its value, and its units using the `\\[unit\\]` format.
292
+
- **Format:** Use a single-line docstring with double quotes (`"..."`). Include a brief description, the symbol of the constant if standard (e.g., `μ₀`), its value, and its units using the `\\[unit\\]` format.
@@ -298,7 +298,7 @@ Adhere strictly to the following structures for different code entities.
298
298
299
299
#### Common mistakes to avoid
300
300
301
-
Double-check your docstrings to avoid these common errors:
301
+
Double-check the docstrings to avoid these common errors:
302
302
303
303
- **Missing `@doc` for constructors:** ALL constructors require the `@doc` macro before their definition.
304
304
- **Incorrect struct field docstrings:** Use single-line `"..."` *above* the field, not block `"""..."""` quotes or inline `#` comments.
@@ -323,7 +323,7 @@ Double-check your docstrings to avoid these common errors:
323
323
- Main module (`LineCableModels`) reexports from submodules.
324
324
- Submodules (`DataModel`, `Materials`, etc.) handle their own exports.
325
325
- Maximum nesting depth is 3 levels (parent → child → grandchild).
326
-
- Documentation is maintained at all levels using DocStringExtensions.
326
+
- Documentation is maintained at all levels using `DocStringExtensions`.
327
327
328
328
### Code navigation
329
329
@@ -337,19 +337,19 @@ Double-check your docstrings to avoid these common errors:
337
337
338
338
### Core architecture
339
339
340
-
The LineCableModels package implements a consistent framework pattern across all modules, designed to provide maximum flexibility while maintaining type stability and performance. The architecture is built around three key components:
340
+
The `LineCableModels.jl` package implements a consistent framework pattern across all modules, designed to provide flexibility while maintaining type stability and performance. The architecture is built around three key components:
341
341
342
-
1. **Formulation**: Defines the physics/mathematical approach
342
+
1. **Problem definition**: Defines the physics/mathematical approach
343
343
2. **Solver**: Controls execution parameters
344
344
3. **Workspace**: Centralizes all state during computation
345
345
346
-
This pattern separates *what* is being calculated (formulation) from *how* it's calculated (solver) and *where* data is stored (workspace).
346
+
This pattern separates *what* is being calculated (problem definition, formulation) from *how* calculations are executed (engine used, solver) and *where* data is stored (workspace).
347
347
348
348
### The workspace pattern
349
349
350
-
At the core of the framework is the Workspace pattern, exemplified by `FEMWorkspace` in the FEMTools module. This pattern can be replicated across all modules (e.g., `EMTWorkspace`).
350
+
At the core of the framework is the Workspace pattern, exemplified by `FEMWorkspace` in the `FEMTools` module. This pattern can be replicated across other modules (e.g., `EMTWorkspace`).
2. **Creation phase**: Create entities based on system definition.
409
-
3. **Processing phase**: Execute calculations (may include fragments/synchronization steps).
410
-
4. **Assignment phase**: Assign properties to processed entities.
411
-
5. **Result rhase**: Extract and format results.
408
+
2. **Construction phase**: Create entities based on system definition (may include specific preliminary tasks, e.g. fragments/synchronization steps FEM simulations).
409
+
3. **Processing phase**: Execute main computation loops, store raw results in workspace container.
410
+
4. **Post processing phase**: Assign properties to processed entities.
411
+
5. **Result phase**: Extract and format results.
412
412
413
413
This pattern ensures clean separation of concerns, making the code more maintainable.
414
414
@@ -428,7 +428,7 @@ This centralized approach eliminates global state and ensures thread safety.
428
428
429
429
The FEMTools module exemplifies this pattern:
430
430
431
-
- `FEMFormulation`: Physics parameters for FEM simulation.
431
+
- `FEMProblemDefinition`: Physics parameters for FEM simulation.
432
432
- `FEMSolver`: Execution parameters for meshing and solving.
433
433
- `FEMWorkspace`: Central state container for all FEM operations.
434
434
- Entity types: Typed data containers for different geometric elements.
@@ -438,7 +438,7 @@ The FEMTools module exemplifies this pattern:
438
438
439
439
When creating new modules, the following patterns should be followed:
440
440
441
-
1. Define formulation type (physics parameters).
441
+
1. Define problem & formulation type (physics parameters).
0 commit comments