Skip to content

Commit ff9ed51

Browse files
chore: mark unexported public functions with @public
1 parent 22e1cb0 commit ff9ed51

File tree

2 files changed

+53
-43
lines changed

2 files changed

+53
-43
lines changed

src/ModelingToolkit.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,15 @@ export AbstractCollocation, JuMPCollocation, InfiniteOptCollocation,
361361
CasADiCollocation, PyomoCollocation
362362
export DynamicOptSolution
363363

364-
@public apply_to_variables
364+
@public apply_to_variables, equations_toplevel, unknowns_toplevel, parameters_toplevel
365+
@public continuous_events_toplevel, discrete_events_toplevel, assertions, is_alg_equation
366+
@public is_diff_equation, Equality, linearize_symbolic, reorder_unknowns
367+
@public similarity_transform
368+
369+
for prop in [SYS_PROPS; [:continuous_events, :discrete_events]]
370+
getter = Symbol(:get_, prop)
371+
hasfn = Symbol(:has_, prop)
372+
@eval @public $getter, $hasfn
373+
end
365374

366375
end # module

src/systems/abstractsystem.jl

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -730,47 +730,49 @@ function unflatten_parameters!(buffer, params, all_ps)
730730
end
731731
end
732732

733-
for prop in [:eqs
734-
:tag
735-
:noise_eqs
736-
:iv
737-
:unknowns
738-
:ps
739-
:tspan
740-
:brownians
741-
:jumps
742-
:name
743-
:description
744-
:var_to_name
745-
:defaults
746-
:guesses
747-
:observed
748-
:systems
749-
:constraints
750-
:bcs
751-
:domain
752-
:ivs
753-
:dvs
754-
:connector_type
755-
:preface
756-
:initializesystem
757-
:initialization_eqs
758-
:schedule
759-
:tearing_state
760-
:metadata
761-
:gui_metadata
762-
:is_initializesystem
763-
:is_discrete
764-
:parameter_dependencies
765-
:assertions
766-
:ignored_connections
767-
:parent
768-
:is_dde
769-
:tstops
770-
:index_cache
771-
:isscheduled
772-
:costs
773-
:consolidate]
733+
const SYS_PROPS = [:eqs
734+
:tag
735+
:noise_eqs
736+
:iv
737+
:unknowns
738+
:ps
739+
:tspan
740+
:brownians
741+
:jumps
742+
:name
743+
:description
744+
:var_to_name
745+
:defaults
746+
:guesses
747+
:observed
748+
:systems
749+
:constraints
750+
:bcs
751+
:domain
752+
:ivs
753+
:dvs
754+
:connector_type
755+
:preface
756+
:initializesystem
757+
:initialization_eqs
758+
:schedule
759+
:tearing_state
760+
:metadata
761+
:gui_metadata
762+
:is_initializesystem
763+
:is_discrete
764+
:parameter_dependencies
765+
:assertions
766+
:ignored_connections
767+
:parent
768+
:is_dde
769+
:tstops
770+
:index_cache
771+
:isscheduled
772+
:costs
773+
:consolidate]
774+
775+
for prop in SYS_PROPS
774776
fname_get = Symbol(:get_, prop)
775777
fname_has = Symbol(:has_, prop)
776778
@eval begin
@@ -780,7 +782,6 @@ for prop in [:eqs
780782
Get the internal field `$($(QuoteNode(prop)))` of a system `sys`.
781783
It only includes `$($(QuoteNode(prop)))` local to `sys`; not those of its subsystems,
782784
like `unknowns(sys)`, `parameters(sys)` and `equations(sys)` does.
783-
This is equivalent to, but preferred over `sys.$($(QuoteNode(prop)))`.
784785
785786
See also [`has_$($(QuoteNode(prop)))`](@ref).
786787
"""

0 commit comments

Comments
 (0)