-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make better use of reflection/homoiconicity #338
Comments
julia> string(Base.nameof(PowerSystems.HydroDispatch))
"HydroDispatch" There are probably more intricacies to figure out here but I'm pretty confident a reflection-based approach is feasible. |
Sometimes we want to do the opposite, go from string to type, and currently we manually build a dictionary to avoid using julia> getproperty(PowerSystems, Symbol("HydroDispatch"))
PowerSystems.HydroDispatch that I don't think has the same security risk as |
Yes, we should use Regarding this one:
I’m not sure I follow what you’re referring to in the code, but we use this approach when de-serializing JSON to types. We store the module and type names as strings and then look them back in this way. It is safe. |
Another catch-all issue for minor, low-priority refactors. There are some things we currently do using string manipulation, manually keeping track of lists of things, etc. that I think could be more elegantly accomplished using Julia's abilities to operate on itself. I'll start a list here:
The text was updated successfully, but these errors were encountered: