Skip to content

Commit 0a43a03

Browse files
checkpoint reached: physical group assignment complete, skip ci
1 parent 63ce80c commit 0a43a03

20 files changed

Lines changed: 210540 additions & 50235 deletions

docs/src/conventions.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The `_todf` suffix provides a concise and immediately recognizable identifier fo
112112

113113
## Docstrings
114114

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.
116116

117117
### General Docstring principles
118118

@@ -145,13 +145,13 @@ All variables corresponding to physical quantities must be annotated with their
145145
- **Correct:** `\\mu_r`, ```math \\frac{a}{b}```
146146
- **Incorrect:** `\mu_r`, ```math \frac{a}{b}```
147147

148-
### Documentation structure by entity type
148+
### Documentation templates
149149

150-
Adhere strictly to the following structures for different code entities.
150+
The subsections below contain templates for different types of code elements.
151151

152152
#### 1. Structs
153153

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.
155155

156156
```julia
157157
"""
@@ -169,11 +169,11 @@ Adhere strictly to the following structures for different code entities.
169169
- **Field documentation:**
170170
- Place *directly above* each field definition.
171171
- 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.
173173

174174
#### 2. Constructors (inside or outside structs)
175175

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.
177177
- **Format:** Use `$(TYPEDSIGNATURES)`. Include standard sections (`Arguments`, `Returns`, `Examples`).
178178

179179
````julia
@@ -204,7 +204,7 @@ Adhere strictly to the following structures for different code entities.
204204
205205
#### 3. Functions / methods
206206
207-
- **Format:** Start with `$(TYPEDSIGNATURES)`. Follow the mandatory section order.
207+
- **Format:** Start with `$(TYPEDSIGNATURES)`. Follow the section order described.
208208
209209
````julia
210210
"""
@@ -248,7 +248,7 @@ Adhere strictly to the following structures for different code entities.
248248
end
249249
````
250250
251-
- **Section order (MANDATORY):**
251+
- **Section order:**
252252
1. Description (no heading)
253253
2. `# Arguments`
254254
3. `# Returns`
@@ -289,7 +289,7 @@ Adhere strictly to the following structures for different code entities.
289289
290290
#### 5. Constants
291291
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.
293293
294294
```julia
295295
"Magnetic constant (vacuum permeability), μ₀ = 4π * 1e-7 \\[H/m\\]]."
@@ -298,7 +298,7 @@ Adhere strictly to the following structures for different code entities.
298298
299299
#### Common mistakes to avoid
300300
301-
Double-check your docstrings to avoid these common errors:
301+
Double-check the docstrings to avoid these common errors:
302302
303303
- **Missing `@doc` for constructors:** ALL constructors require the `@doc` macro before their definition.
304304
- **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:
323323
- Main module (`LineCableModels`) reexports from submodules.
324324
- Submodules (`DataModel`, `Materials`, etc.) handle their own exports.
325325
- 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`.
327327
328328
### Code navigation
329329
@@ -337,19 +337,19 @@ Double-check your docstrings to avoid these common errors:
337337
338338
### Core architecture
339339
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:
341341
342-
1. **Formulation**: Defines the physics/mathematical approach
342+
1. **Problem definition**: Defines the physics/mathematical approach
343343
2. **Solver**: Controls execution parameters
344344
3. **Workspace**: Centralizes all state during computation
345345
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).
347347
348348
### The workspace pattern
349349
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`).
351351
352-
A Workspace:
352+
A workspace:
353353
354354
- Acts as a centralized state container.
355355
- Stores all intermediate computation data.
@@ -362,8 +362,8 @@ A Workspace:
362362
Each module follows a consistent type hierarchy:
363363
364364
```julia
365-
AbstractFormulation
366-
├── FEMFormulation
365+
AbstractProblemDefinition
366+
├── FEMProblemDefinition
367367
├── AbstractFDEMFormulation :> {CPEarth, CIGRE, ...}
368368
├── AbstractEHEMFormulation :> {EnforceLayer, EquivalentSigma, ...}
369369
├── ...
@@ -392,7 +392,7 @@ This hierarchy enables both specialization and shared interfaces.
392392
Data flows through the system in a consistent pattern:
393393
394394
1. System definition (LineCableSystem instance).
395-
2. Formulation selection (physics parameters).
395+
2. Problem definition (physics parameters, formulations to employ).
396396
3. Solver configuration (execution parameters).
397397
4. Workspace initialization (state container).
398398
5. Execution (multi-phase processing).
@@ -402,13 +402,13 @@ This pattern applies regardless of the specific module or calculation type.
402402
403403
### Multi-phase processing
404404
405-
All modules implement a multi-phase execution pattern with clear separation between phases:
405+
All modules implement a multi-phase execution pattern with clear separation between phases. For example, the `FEMTools` module follows this pattern:
406406
407407
1. **Initialization phase**: Setup workspace, load configurations.
408-
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.
412412
413413
This pattern ensures clean separation of concerns, making the code more maintainable.
414414
@@ -428,7 +428,7 @@ This centralized approach eliminates global state and ensures thread safety.
428428
429429
The FEMTools module exemplifies this pattern:
430430
431-
- `FEMFormulation`: Physics parameters for FEM simulation.
431+
- `FEMProblemDefinition`: Physics parameters for FEM simulation.
432432
- `FEMSolver`: Execution parameters for meshing and solving.
433433
- `FEMWorkspace`: Central state container for all FEM operations.
434434
- Entity types: Typed data containers for different geometric elements.
@@ -438,7 +438,7 @@ The FEMTools module exemplifies this pattern:
438438
439439
When creating new modules, the following patterns should be followed:
440440
441-
1. Define formulation type (physics parameters).
441+
1. Define problem & formulation type (physics parameters).
442442
2. Define solver type (execution parameters).
443443
3. Define workspace type (state container).
444444
4. Implement entity types specific to the domain.

examples/cables_library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"__julia_type__": "LineCableModels.DataModel.CablesLibrary",
33
"cable_designs": {
4-
"tutorial2": {
5-
"cable_id": "tutorial2",
4+
"tutorial": {
5+
"cable_id": "tutorial",
66
"nominal_data": {
77
"U": 30,
88
"screen_cross_section": 35,

0 commit comments

Comments
 (0)