Skip to content

Commit

Permalink
Fix printing of supplemental attributes
Browse files Browse the repository at this point in the history
The default Base.show method was printing circular references to
objects internal to supplemental attributes. This solution uses the same
method as is used for components.
  • Loading branch information
daniel-thom committed Sep 6, 2024
1 parent 0816ef2 commit 16f3306
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function Base.show(io::IO, ::MIME"text/plain", system_units::SystemUnitsSettings
end
end

function Base.show(io::IO, ::MIME"text/plain", ist::InfrastructureSystemsComponent)
function Base.show(io::IO, ::MIME"text/plain", ist::TimeSeriesOwners)
print(io, summary(ist), ":")
for name in fieldnames(typeof(ist))
obj = getfield(ist, name)
Expand All @@ -131,7 +131,7 @@ function Base.show(io::IO, ::MIME"text/plain", ist::InfrastructureSystemsCompone
print(io, "\n ", "has_time_series", ": ", string(has_time_series(ist)))
end

function Base.show(io::IO, ist::InfrastructureSystemsComponent)
function Base.show(io::IO, ist::TimeSeriesOwners)
print(io, strip_module_name(typeof(ist)), "(")
is_first = true
for (name, field_type) in zip(fieldnames(typeof(ist)), fieldtypes(typeof(ist)))
Expand Down

0 comments on commit 16f3306

Please sign in to comment.