Skip to content

Commit

Permalink
Make some methods private
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort committed Aug 19, 2024
1 parent 6c0c973 commit 1f9d4b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/crc_idle.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_cluster_list(self, args: Namespace) -> tuple[str]:
return specified_clusters or argument_clusters

@staticmethod
def count_idle_cpu_resources(cluster: str, partition: str) -> dict[int, int]:
def _count_idle_cpu_resources(cluster: str, partition: str) -> dict[int, int]:
"""Return the idle CPU resources on a given cluster partition.
Args:
Expand All @@ -83,7 +83,7 @@ def count_idle_cpu_resources(cluster: str, partition: str) -> dict[int, int]:
return return_dict

@staticmethod
def count_idle_gpu_resources(cluster: str, partition: str) -> dict[int, int]:
def _count_idle_gpu_resources(cluster: str, partition: str) -> dict[int, int]:
"""Return idle GPU resources on a given cluster partition.
If the host node is in a `drain` state, the GPUs are reported as unavailable.
Expand Down Expand Up @@ -135,10 +135,10 @@ def count_idle_resources(self, cluster: str, partition: str) -> dict[int, int]:

cluster_type = self.cluster_types[cluster]
if cluster_type == 'GPUs':
return self.count_idle_gpu_resources(cluster, partition)
return self._count_idle_gpu_resources(cluster, partition)

elif cluster_type == 'cores':
return self.count_idle_cpu_resources(cluster, partition)
return self._count_idle_cpu_resources(cluster, partition)

raise ValueError(f'Unknown cluster type: {cluster}')

Expand Down

0 comments on commit 1f9d4b3

Please sign in to comment.