Skip to content

Commit

Permalink
fix docs more
Browse files Browse the repository at this point in the history
  • Loading branch information
stelmo committed Aug 11, 2024
1 parent c2d31b8 commit cfb8635
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
Changes from copied code are indicated.
=#

using Documenter, Literate, DifferentiableMetabolism
using Documenter, Literate, DifferentiableMetabolism, ConstraintTrees, Symbolics, COBREXA

examples =
sort(filter(x -> endswith(x, ".jl"), readdir(joinpath(@__DIR__, "src"), join = true)))
Expand Down
25 changes: 25 additions & 0 deletions src/get_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ See the License for the specific language governing permissions and
limitations under the License.
=#

"""
$(TYPEDSIGNATURES)
TODO
"""
constrained(x) = begin
y = Symbolics.value(x)
y isa Float64 && isinf(y) && return false
Expand All @@ -36,10 +41,20 @@ function equality_constraints(m::ConstraintTrees.ConstraintTree)
sink
end

"""
$(TYPEDSIGNATURES)
TODO
"""
function get_equality_constraints(m::ConstraintTrees.ConstraintTree, sink)
get_equality_constraints.(values(m), Ref(sink))
end

"""
$(TYPEDSIGNATURES)
TODO
"""
function get_equality_constraints(c::ConstraintTrees.Constraint, sink)
if c.bound isa ConstraintTrees.EqualTo || c.bound isa ParameterEqualTo
push!(sink, (ConstraintTrees.value(c), Symbolics.Num(c.bound.equal_to)))
Expand Down Expand Up @@ -73,10 +88,20 @@ function inequality_constraints(m::ConstraintTrees.ConstraintTree)
]
end

"""
$(TYPEDSIGNATURES)
TODO
"""
function get_inequality_constraints(m::ConstraintTrees.ConstraintTree, sink)
get_inequality_constraints.(values(m), Ref(sink))
end

"""
$(TYPEDSIGNATURES)
TODO
"""
function get_inequality_constraints(c::ConstraintTrees.Constraint, sink)
if c.bound isa ConstraintTrees.Between || c.bound isa ParameterBetween
push!(
Expand Down

0 comments on commit cfb8635

Please sign in to comment.