InfrastructureSystems.jl icon indicating copy to clipboard operation
InfrastructureSystems.jl copied to clipboard

Create the flag only_available for get_components functions

Open daniel-thom opened this issue 6 months ago • 1 comments

A pattern has developed in IS/PSY where we have different methods for cases where a user wants to retrieve components that are available. For example, there is get_components and get_available_components. This is causing unnecessary developer burden because it multiplies the number of methods to create in each occurrence. At minimum, we have the two mentioned above as well as another set for methods that accept a filter function as the first argument.

We could instead implement a single method with a flag, such as the following:

function get_components(component_type::Type{<:InfrastructueSystemsComponent}, sys; only_available::bool = false)

daniel-thom avatar May 22 '25 20:05 daniel-thom

we can implement this already for 3.0 release of IS. Most of the use of get_available will be changed anyway in PNM and PF.

jd-lara avatar May 23 '25 22:05 jd-lara