@@ -535,7 +535,7 @@ get_initconstraints(nw::Network, idx::ECIndex) = get_initconstraints(getcomp(nw,
535
535
Sets the initialization constraint(s) for the component. Overwrites any existing constraints.
536
536
`constraint` can be a single `InitConstraint` or a tuple of `InitConstraint` objects.
537
537
538
- See also: [`add_initconstraint!`](@ref), [`get_initconstraints`](@ref), [`delete_initconstraint !`](@ref).
538
+ See also: [`add_initconstraint!`](@ref), [`get_initconstraints`](@ref), [`delete_initconstraints !`](@ref).
539
539
"""
540
540
function set_initconstraint! (c:: ComponentModel , constraint; check= true )
541
541
if ! (constraint isa InitConstraint) && ! (constraint isa Tuple && all (c -> c isa InitConstraint, constraint))
@@ -586,18 +586,18 @@ add_initconstraint!(nw::Network, idx::VCIndex, constraint; kw...) = add_initcons
586
586
add_initconstraint! (nw:: Network , idx:: ECIndex , constraint; kw... ) = add_initconstraint! (getcomp (nw, idx), constraint; kw... )
587
587
588
588
"""
589
- delete_initconstraint !(c::ComponentModel)
590
- delete_initconstraint !(nw::Network, idx::Union{VIndex,EIndex})
589
+ delete_initconstraints !(c::ComponentModel)
590
+ delete_initconstraints !(nw::Network, idx::Union{VIndex,EIndex})
591
591
592
592
Removes the initialization constraint from the component model,
593
593
or from a component referenced by `idx` in a network.
594
594
Returns `true` if the constraint existed and was removed, `false` otherwise.
595
595
596
596
See also: [`set_initconstraint!`](@ref).
597
597
"""
598
- delete_initconstraint ! (c:: ComponentModel ) = delete_metadata! (c, :initconstraint )
599
- delete_initconstraint ! (nw:: Network , idx:: VCIndex ) = delete_initconstraint ! (getcomp (nw, idx))
600
- delete_initconstraint ! (nw:: Network , idx:: ECIndex ) = delete_initconstraint ! (getcomp (nw, idx))
598
+ delete_initconstraints ! (c:: ComponentModel ) = delete_metadata! (c, :initconstraint )
599
+ delete_initconstraints ! (nw:: Network , idx:: VCIndex ) = delete_initconstraints ! (getcomp (nw, idx))
600
+ delete_initconstraints ! (nw:: Network , idx:: ECIndex ) = delete_initconstraints ! (getcomp (nw, idx))
601
601
602
602
# ###
603
603
# ### Init formulas
@@ -637,7 +637,7 @@ get_initformulas(nw::Network, idx::ECIndex) = get_initformulas(getcomp(nw, idx))
637
637
Sets the initialization formula(s) for the component. Overwrites any existing formulas.
638
638
`formula` can be a single `InitFormula` or a tuple of `InitFormula` objects.
639
639
640
- See also: [`add_initformula!`](@ref), [`get_initformulas`](@ref), [`delete_initformula !`](@ref).
640
+ See also: [`add_initformula!`](@ref), [`get_initformulas`](@ref), [`delete_initformulas !`](@ref).
641
641
"""
642
642
function set_initformula! (c:: ComponentModel , formula; check= true )
643
643
if ! (formula isa InitFormula) && ! (formula isa Tuple && all (f -> f isa InitFormula, formula))
@@ -688,18 +688,22 @@ add_initformula!(nw::Network, idx::VCIndex, formula; kw...) = add_initformula!(g
688
688
add_initformula! (nw:: Network , idx:: ECIndex , formula; kw... ) = add_initformula! (getcomp (nw, idx), formula; kw... )
689
689
690
690
"""
691
- delete_initformula !(c::ComponentModel)
692
- delete_initformula !(nw::Network, idx::Union{VIndex,EIndex})
691
+ delete_initformulas !(c::ComponentModel)
692
+ delete_initformulas !(nw::Network, idx::Union{VIndex,EIndex})
693
693
694
694
Removes all initialization formulas from the component model,
695
695
or from a component referenced by `idx` in a network.
696
696
Returns `true` if formulas existed and were removed, `false` otherwise.
697
697
698
698
See also: [`set_initformula!`](@ref), [`add_initformula!`](@ref).
699
699
"""
700
- delete_initformula! (c:: ComponentModel ) = delete_metadata! (c, :initformula )
701
- delete_initformula! (nw:: Network , idx:: VCIndex ) = delete_initformula! (getcomp (nw, idx))
702
- delete_initformula! (nw:: Network , idx:: ECIndex ) = delete_initformula! (getcomp (nw, idx))
700
+ delete_initformulas! (c:: ComponentModel ) = delete_metadata! (c, :initformula )
701
+ delete_initformulas! (nw:: Network , idx:: VCIndex ) = delete_initformulas! (getcomp (nw, idx))
702
+ delete_initformulas! (nw:: Network , idx:: ECIndex ) = delete_initformulas! (getcomp (nw, idx))
703
+
704
+ # Deprecated backward compatibility
705
+ @deprecate delete_initconstraint! (args... ; kwargs... ) delete_initconstraints! (args... ; kwargs... )
706
+ @deprecate delete_initformula! (args... ; kwargs... ) delete_initformulas! (args... ; kwargs... )
703
707
704
708
705
709
# generate methods and docstrings for position and marker
0 commit comments