Skip to content

Commit 46f3f2a

Browse files
Refactor documentation approach: use docstrings instead of separate docs
- Remove IntegratorInterface.md and FunctionWrappers.md documentation pages - Add proper docstrings to function wrapper types in src/function_wrappers.jl: * AbstractWrappedFunction, TimeGradientWrapper, UJacobianWrapper * TimeDerivativeWrapper, UDerivativeWrapper, ParamJacobianWrapper * JacobianWrapper - all with comprehensive documentation - Add docstrings to integrator cache functions in src/integrator_interface.jl: * user_cache, u_cache, du_cache, ratenoise_cache, rand_cache - Add docstrings to clock trait functions in src/clock.jl: * isclock, issolverstepclock, iscontinuous, iseventclock * is_discrete_time_domain - Update pages.jl to remove deleted documentation files - Documentation builds successfully with proper docstring integration This follows best practices by documenting the API directly in source code rather than maintaining separate documentation files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent de8e171 commit 46f3f2a

File tree

6 files changed

+193
-315
lines changed

6 files changed

+193
-315
lines changed

docs/pages.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ pages = [
1111
"interfaces/AlgorithmTraits.md",
1212
"interfaces/Solutions.md",
1313
"interfaces/Init_Solve.md",
14-
"interfaces/IntegratorInterface.md",
1514
"interfaces/Ensembles.md",
1615
"interfaces/EnsembleAnalysis.md",
17-
"interfaces/FunctionWrappers.md",
1816
"interfaces/ClockSystem.md",
1917
"interfaces/Common_Keywords.md",
2018
"interfaces/Differentiation.md",

docs/src/interfaces/FunctionWrappers.md

Lines changed: 0 additions & 105 deletions
This file was deleted.

docs/src/interfaces/IntegratorInterface.md

Lines changed: 0 additions & 208 deletions
This file was deleted.

src/clock.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,60 @@ discrete-time systems that assume a fixed sample time, such as PID controllers a
4747
filters.
4848
""" SolverStepClock
4949

50+
"""
51+
isclock(clock)
52+
53+
Returns `true` if the object is a valid clock type (specifically a `PeriodicClock`).
54+
This function is used for type checking in clock-dependent logic.
55+
"""
5056
isclock(c::Clocks.Type) = @match c begin
5157
PeriodicClock() => true
5258
_ => false
5359
end
5460
isclock(::TimeDomain) = false
5561

62+
"""
63+
issolverstepclock(clock)
64+
65+
Returns `true` if the clock is a `SolverStepClock` that triggers at every solver step.
66+
This is useful for monitoring solver progress or implementing step-dependent logic.
67+
"""
5668
issolverstepclock(c::Clocks.Type) = @match c begin
5769
SolverStepClock() => true
5870
_ => false
5971
end
6072
issolverstepclock(::TimeDomain) = false
6173

74+
"""
75+
iscontinuous(clock)
76+
77+
Returns `true` if the clock operates in continuous time (i.e., is a `ContinuousClock`).
78+
Continuous clocks allow events to occur at any real-valued time instant.
79+
"""
6280
iscontinuous(c::Clocks.Type) = @match c begin
6381
ContinuousClock() => true
6482
_ => false
6583
end
6684
iscontinuous(::TimeDomain) = false
6785

86+
"""
87+
iseventclock(clock)
88+
89+
Returns `true` if the clock is an `EventClock` that triggers based on specific events.
90+
Event clocks are used for condition-based triggering in hybrid systems.
91+
"""
6892
iseventclock(c::Clocks.Type) = @match c begin
6993
EventClock() => true
7094
_ => false
7195
end
7296
iseventclock(::TimeDomain) = false
7397

98+
"""
99+
is_discrete_time_domain(clock)
100+
101+
Returns `true` if the clock operates in discrete time (i.e., is not a continuous clock).
102+
Discrete time domains have specific sampling intervals or event-based triggering.
103+
"""
74104
is_discrete_time_domain(c::TimeDomain) = !iscontinuous(c)
75105

76106
# workaround for https://github.com/Roger-luo/Moshi.jl/issues/43

0 commit comments

Comments
 (0)