Skip to content

PR: number_of_cpu function logic for Darwin and some error handling #19

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

beiyonder
Copy link

Heyy, I've

Updated regex for multi-digit CPU numbers on Windows (eco2ai/tools/tools_cpu.py).

Refined cpu_num logic for Darwin (eco2ai/tools/tools_cpu.py). My reasoning:
Ensures sysctl probes fail before raising errors.
Distinguishes "no packages data" (subprocess error) from "zero packages" (bad data).
Falls back to hw.physicalcpu instead of silently returning 1 on macOS.

Enhancements:
Added try/except statements in eco2ai/tools/tools_gpu.py, tools_ram.py, and utils.py for robust error handling.

Thanks much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant