Skip to content

Commit

Permalink
feat: created a static method to count the number of available cores …
Browse files Browse the repository at this point in the history
…based on the operation system
  • Loading branch information
gtdang committed Aug 23, 2024
1 parent 481ac4a commit fff9bd1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hnn_core/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,15 @@ def __init__(self, theme_color="#802989",
self._init_ui_components()
self.add_logging_window_logger()

@staticmethod
def _available_cores():
# For macos
if platform.system() == 'Darwin':
return psutil.cpu_count()
# For Linux and Windows
else:
return len(psutil.Process().cpu_affinity())

def get_cell_parameters_dict(self):
"""Returns the number of elements in the
cell_parameters_dict dictionary.
Expand Down

0 comments on commit fff9bd1

Please sign in to comment.