@@ -45,19 +45,19 @@ class ComponentGraph(ABC):
4545 @abstractmethod
4646 def components (
4747 self ,
48- component_id : set [int ] | None = None ,
49- component_category : set [ComponentCategory ] | None = None ,
48+ component_ids : set [int ] | None = None ,
49+ component_categories : set [ComponentCategory ] | None = None ,
5050 ) -> set [Component ]:
5151 """Fetch the components of the microgrid.
5252
5353 Args:
54- component_id : filter out any components not matching one of the provided IDs
55- component_category : filter out any components not matching one of the
54+ component_ids : filter out any components not matching one of the provided IDs
55+ component_categories : filter out any components not matching one of the
5656 provided types
5757
5858 Returns:
5959 Set of the components currently connected to the microgrid, filtered by
60- the provided `component_id ` and `component_category ` values.
60+ the provided `component_ids ` and `component_categories ` values.
6161 """
6262
6363 @abstractmethod
@@ -331,31 +331,31 @@ def __init__(
331331
332332 def components (
333333 self ,
334- component_id : set [int ] | None = None ,
335- component_category : set [ComponentCategory ] | None = None ,
334+ component_ids : set [int ] | None = None ,
335+ component_categories : set [ComponentCategory ] | None = None ,
336336 ) -> set [Component ]:
337337 """Fetch the components of the microgrid.
338338
339339 Args:
340- component_id : filter out any components not matching one of the provided IDs
341- component_category : filter out any components not matching one of the
340+ component_ids : filter out any components not matching one of the provided IDs
341+ component_categories : filter out any components not matching one of the
342342 provided types
343343
344344 Returns:
345345 Set of the components currently connected to the microgrid, filtered by
346- the provided `component_id ` and `component_category ` values.
346+ the provided `component_ids ` and `component_categories ` values.
347347 """
348- if component_id is None :
348+ if component_ids is None :
349349 # If any node has not node[1], then it will not pass validations step.
350350 selection : Iterable [Component ] = map (
351351 lambda node : Component (** (node [1 ])), self ._graph .nodes (data = True )
352352 )
353353 else :
354- valid_ids = filter (self ._graph .has_node , component_id )
354+ valid_ids = filter (self ._graph .has_node , component_ids )
355355 selection = map (lambda idx : Component (** self ._graph .nodes [idx ]), valid_ids )
356356
357- if component_category is not None :
358- types : set [ComponentCategory ] = component_category
357+ if component_categories is not None :
358+ types : set [ComponentCategory ] = component_categories
359359 selection = filter (lambda c : c .category in types , selection )
360360
361361 return set (selection )
@@ -832,7 +832,7 @@ def _validate_grid_endpoint(self) -> None:
832832 it has no successors in the graph (i.e. it is not connected to
833833 anything)
834834 """
835- grid = list (self .components (component_category = {ComponentCategory .GRID }))
835+ grid = list (self .components (component_categories = {ComponentCategory .GRID }))
836836
837837 if len (grid ) == 0 :
838838 # it's OK to not have a grid endpoint as long as other properties
@@ -865,7 +865,7 @@ def _validate_intermediary_components(self) -> None:
865865 or zero successors
866866 """
867867 intermediary_components = list (
868- self .components (component_category = {ComponentCategory .INVERTER })
868+ self .components (component_categories = {ComponentCategory .INVERTER })
869869 )
870870
871871 missing_predecessors = list (
@@ -893,7 +893,7 @@ def _validate_leaf_components(self) -> None:
893893 """
894894 leaf_components = list (
895895 self .components (
896- component_category = {
896+ component_categories = {
897897 ComponentCategory .BATTERY ,
898898 ComponentCategory .EV_CHARGER ,
899899 }
0 commit comments