NREL-Sienna / InfrastructureSystems.jl

Utility package for Sienna's simulation infrastructure
https://nrel-sienna.github.io/InfrastructureSystems.jl/stable/
BSD 3-Clause "New" or "Revised" License
39 stars 21 forks source link

print empty system broken #179

Closed jd-lara closed 3 years ago

jd-lara commented 3 years ago

REPL print of empty system broken

MWE

julia> test_sys = System(100.0; time_series_in_memory = true)

output:

Error showing value of type System:
ERROR: ArgumentError: type does not have a definite number of fields
Stacktrace:
 [1] fieldcount at ./reflection.jl:725 [inlined]
 [2] buildcolumns at /Users/jdlara/.julia/packages/Tables/iG2a3/src/fallbacks.jl:206 [inlined]
 [3] columns at /Users/jdlara/.julia/packages/Tables/iG2a3/src/fallbacks.jl:262 [inlined]
 [4] DataFrame(::Array{Any,1}; copycols::Bool) at /Users/jdlara/.julia/packages/DataFrames/Zx5mm/src/other/tables.jl:55
 [5] DataFrame at /Users/jdlara/.julia/packages/DataFrames/Zx5mm/src/other/tables.jl:46 [inlined]
 [6] create_components_df(::InfrastructureSystems.Components) at /Users/jdlara/.julia/dev/InfrastructureSystems/src/utils/print.jl:204
 [7] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::InfrastructureSystems.Components) at /Users/jdlara/.julia/dev/InfrastructureSystems/src/utils/print.jl:27
 [8] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::InfrastructureSystems.SystemData) at /Users/jdlara/.julia/dev/InfrastructureSystems/src/utils/print.jl:70
 [9] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::System) at /Users/jdlara/.julia/dev/PowerSystems/src/utils/print.jl:18
 [10] display(::REPL.REPLDisplay{REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::System) at /Users/jdlara/.julia/packages/OhMyREPL/07uNa/src/output_prompt_overwrite.jl:8
 [11] display(::REPL.REPLDisplay, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:218
 [12] display(::Any) at ./multimedia.jl:328
 [13] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [14] invokelatest at ./essentials.jl:709 [inlined]
 [15] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:238
 [16] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:223
 [17] (::REPL.var"#do_respond#54"{Bool,Bool,REPL.var"#64#73"{REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:822
 [18] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [19] invokelatest at ./essentials.jl:709 [inlined]
 [20] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2355
 [21] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1144
 [22] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356