mimiframework / Mimi.jl

Integrated Assessment Modeling Framework
https://www.mimiframework.org
Other
65 stars 34 forks source link

Review the Typing and Type Checking of Parameters and Variables #875

Open lrennels opened 2 years ago

lrennels commented 2 years ago

The typing story for parameters and variables, particularly for non-Number types like Strings and Symbols, is a bit fragile and can cause some confusing error messages. For example, typing with something like

p1 = Parameter{Array{Symbol}}(default = [:hello, :goodbye], regions = [mydim])

will fail, and only work if you type it with {Symbol}, as if you are indicating the element type instead of the parameter type. We should move through this carefully and think about the conversion story, the typing, etc.

lrennels commented 2 years ago

Update that we should fold this in to all three _check_attributes methods including the one for internal parameter connections as added in #899. That particular method does not currently check datatypes, so as to avoid further complexity before we handle this uniformly, but should check them.