Skip to content

Commit f265dae

Browse files
docs(validation): update trait and docstring details in Validation.jl
1 parent 7c1aebb commit f265dae

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/Validation.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The [`Validation`](@ref) module implements a trait‑driven, two‑stage input c
66
# Overview
77
88
- Centralized constructor input handling: `sanitize` → `parse` → rule application.
9-
- Trait hooks configure per‑type behavior (`has_radii`, `required_fields`, `keyword_fields`, etc.).
9+
- Trait hooks configure per‑type behavior (`has_radii`, `has_temperature`, `required_fields`, `keyword_fields`, `coercive_fields`, etc.).
1010
- Rules are small value objects (`Rule` subtypes) applied to a normalized `NamedTuple`.
1111
1212
# Dependencies
@@ -417,7 +417,7 @@ end
417417
"""
418418
$(TYPEDSIGNATURES)
419419
420-
Trait hook enabling the annular radii rule bundle on fields `:radius_in` and `:radius_ext` (normalized numbers required, finiteness, non-negativity, and the ordering constraint `:radius_in` < `:radius_ext`). It does not indicate the mere existence of radii; it opts in to the annular/coaxial shell geometry checks.
420+
Trait hook enabling the annular radii rule bundle on fields `:radius_in` and `:radius_ext` (normalized numbers required, finiteness, nonnegativity, and the ordering constraint `:radius_in` < `:radius_ext`). It does **not** indicate the mere existence of radii; it opts in to the annular/coaxial shell geometry checks.
421421
422422
# Arguments
423423
@@ -430,7 +430,7 @@ Trait hook enabling the annular radii rule bundle on fields `:radius_in` and `:r
430430
# Examples
431431
432432
```julia
433-
Validation.has_radii(Tubular) # true/false
433+
Validation.has_radii(Tubular)
434434
```
435435
"""
436436
has_radii(::Type) = false # Default = false/empty. Components extend these.
@@ -483,30 +483,30 @@ required_fields(::Type) = ()
483483
"""
484484
$(TYPEDSIGNATURES)
485485
486-
Trait hook listing optional keyword fields to be merged to positionals in `sanitize`.
486+
Trait hook listing optional keyword fields considered by `sanitize`.
487487
488488
# Arguments
489489
490490
- `::Type{T}`: Component type \\[dimensionless\\].
491491
492492
# Returns
493493
494-
- Tuple of field names that are optional.
494+
- Tuple of optional keyword field names.
495495
"""
496496
keyword_fields(::Type) = ()
497497

498498
"""
499499
$(TYPEDSIGNATURES)
500500
501-
Trait hook listing coercive fields (`<:AbstractFloat`) that must be converted to the target type during [`validate!`])(@ref). Defaults to all fields (required and keyword optionals). Overrides should be implemented per type.
501+
Trait hook listing **coercive** fields: values that participate in numeric promotion and will be converted to the promoted type by the convenience constructor. Defaults to all fields (`required_fields ∪ keyword_fields`). Types may override to exclude integers or categorical fields.
502502
503503
# Arguments
504504
505505
- `::Type{T}`: Component type \\[dimensionless\\].
506506
507507
# Returns
508508
509-
- Tuple of field names that are coercive.
509+
- Tuple of field names that are coerced.
510510
"""
511511
coercive_fields(::Type{T}) where {T} = (required_fields(T)..., keyword_fields(T)...)
512512

@@ -540,7 +540,7 @@ is_radius_input(::Type{T}, x) where {T} = (x isa Number) && !(x isa Complex)
540540
"""
541541
$(TYPEDSIGNATURES)
542542
543-
Field‑aware acceptance predicate used by `sanitize` to distinguish inner vs. outer radius policies. The default forwards to the scalar predicate [`is_radius_input(::Type{T}, x)`](@ref) when no field‑specific method is defined.
543+
Field‑aware acceptance predicate used by `sanitize` to distinguish inner vs. outer radius policies. The default forwards to [`is_radius_input(::Type{T}, x)`](@ref) when no field‑specific method is defined.
544544
545545
# Arguments
546546

0 commit comments

Comments
 (0)