Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/src/ref/ref_structures_definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Composite components are defined using the `@defcomposite` macro which generates
# CompositeComponentDef <: ComponentDef
internal_param_conns::Vector{InternalParameterConnection}
backups::Vector{Symbol}
sorted_comps::Union{Nothing, Vector{Symbol}}
```
The namespace of a composite component can hold `CompositeParameterDef`s and`CompositeVariableDef`s, as well as `AbstractComponentDef`s (which can be other leaf or composite component definitions).

Expand Down
1 change: 0 additions & 1 deletion src/Mimi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ include("mcs/mcs.jl") # need mcs types for explorer and utils
include("explorer/explore.jl")
include("utils/getdataframe.jl")
include("utils/graph.jl")
include("utils/lint_helper.jl")
include("utils/misc.jl")

# Load built-in components
Expand Down
18 changes: 0 additions & 18 deletions src/core/defs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ compname(obj::AbstractComponentDef) = compname(obj.comp_id)

compnames() = map(compname, compdefs())

"""
is_detached(obj::AbstractComponentDef)

Return true if `obj` is not a ModelDef and it has no parent.
"""
is_detached(obj::AbstractComponentDef) = (obj.parent === nothing)
is_detached(obj::ModelDef) = false # by definition

dirty(md::ModelDef) = md.dirty

function dirty!(obj::AbstractComponentDef)
Expand Down Expand Up @@ -792,16 +784,6 @@ function _insert_comp!(obj::AbstractCompositeComponentDef, comp_def::AbstractCom
nothing
end

"""
Return True if time Dimension `outer` contains `inner`.
"""
function time_contains(outer::Dimension, inner::Dimension)
outer_idx = keys(outer)
inner_idx = keys(inner)

return outer_idx[1] <= inner_idx[1] && outer_idx[end] >= inner_idx[end]
end

"""
propagate_time!(obj::AbstractComponentDef, t::Dimension)

Expand Down
4 changes: 0 additions & 4 deletions src/core/types/defs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ global const NamespaceElement = Union{LeafNamespaceElement, CompositeNa
# Names of external params that the ConnectorComps will use as their :input2 parameters.
backups::Vector{Symbol}


sorted_comps::Union{Nothing, Vector{Symbol}}

function CompositeComponentDef(comp_id::Union{Nothing, ComponentId}=nothing)
self = new()
CompositeComponentDef(self, comp_id)
Expand All @@ -174,7 +171,6 @@ global const NamespaceElement = Union{LeafNamespaceElement, CompositeNa
self.comp_path = ComponentPath(self.name)
self.internal_param_conns = Vector{InternalParameterConnection}()
self.backups = Vector{Symbol}()
self.sorted_comps = nothing
end
end

Expand Down
32 changes: 0 additions & 32 deletions src/utils/graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,6 @@
# Graph Functionality
#

function _show_conns(io, m, comp_name, which::Symbol)
datumtype = which == :incoming ? "parameters" : "variables"
println(io, " $which $datumtype:")

conns = get_connections(m, comp_name, which)

if length(conns) == 0
println(io, " none")
else
for conn in conns
if which == :incoming
println(io, " - $(conn.src_comp_path).$(conn.dst_par_name)")
else
println(io, " - $(conn.dst_comp_path).$(conn.src_var_name)")
end
end
end
end

show_conns(m::Model) = show_conns(stdout, m)

function show_conns(io::IO, m::Model)
println(io, "Model component connections:")

for (i, comp_name) in enumerate(compkeys(m.md))
comp_def = compdef(m.md, comp_name)
println(io, "$i. $(comp_def.comp_id) as :$(nameof(comp_def))")
_show_conns(io, m, comp_name, :incoming)
_show_conns(io, m, comp_name, :outgoing)
end
end

function _filter_connections(conns::Vector{InternalParameterConnection}, comp_path::ComponentPath, which::Symbol)
if which == :all
f = obj -> (obj.src_comp_path == comp_path || obj.dst_comp_path == comp_path)
Expand Down
9 changes: 0 additions & 9 deletions src/utils/lint_helper.jl

This file was deleted.

1 change: 0 additions & 1 deletion test/test_show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ Model
...
6: 0.0
1: time
sorted_comps: nothing
number_type: Float64
mi: nothing""" # ignore (most) whitespace

Expand Down
9 changes: 8 additions & 1 deletion test/test_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ module TestTools

using Test
using Mimi
using Logging

import Mimi:
getproperty, pretty_string
getproperty, pretty_string, set_log_level, log_debug, log_info

#utils: pretty_string
@test pretty_string("camelCaseBasic") == pretty_string(:camelCaseBasic) == "Camel Case Basic"
Expand All @@ -18,4 +19,10 @@ final = 10
ts = 10
@test Mimi.interpolate(collect(0:stepsize:final), ts) == collect(0:stepsize/ts:final)

# utils: logging - toggle back and forth
log_debug()
@test current_logger().min_level == Logging.Debug
log_info()
@test current_logger().min_level == Logging.Info

end #module