diff --git a/src/utils/print.jl b/src/utils/print.jl index 82f8e25..523e795 100644 --- a/src/utils/print.jl +++ b/src/utils/print.jl @@ -40,57 +40,6 @@ function Base.show(io::IO, ::MIME"text/html", p::Portfolio) return end -function Base.show(io::IO, ::MIME"text/plain", ist::PSY.Component) - default_units = false - if !PSY.has_units_setting(ist) - print(io, "\n") - @warn( - "SystemUnitSetting not defined, using NATURAL_UNITS for displaying device specification." - ) - PSY.set_units_setting!( - ist, - PSY.SystemUnitsSettings(100.0, PSY.UNIT_SYSTEM_MAPPING["NATURAL_UNITS"]), - ) - default_units = true - end - try - print(io, summary(ist), ":") - for name in fieldnames(typeof(ist)) - obj = getproperty(ist, name) - getter_name = Symbol("get_$name") - if (obj isa InfrastructureSystemsInternal) && !default_units - print(io, "\n ") - show(io, MIME"text/plain"(), obj.units_info) - continue - elseif obj isa IS.InfrastructureSystemsType || - obj isa Vector{<:IS.InfrastructureSystemsComponent} - val = summary(getproperty(ist, name)) - elseif PSY.hasproperty(PowerSystemsInvestmentsPortfolios, getter_name) - getter_func = - PSY.getproperty(PowerSystemsInvestmentsPortfolios, getter_name) - #print(getter_func) - val = getter_func(ist) - else - val = getproperty(ist, name) - end - print(io, "\n ", name, ": ", val) - end - print( - io, - "\n ", - "has_supplemental_attributes", - ": ", - string(PSY.has_supplemental_attributes(ist)), - ) - print(io, "\n ", "has_time_series", ": ", string(PSY.has_time_series(ist))) - finally - if default_units - PSY.set_units_setting!(ist, nothing) - end - end - return -end - function show_portfolio_table(io::IO, p::Portfolio; kwargs...) header = ["Property", "Value"] table = [