Skip to content

Commit

Permalink
Avoid physical cores being casted as float
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Jan 1, 2025
1 parent c274ada commit d33dd4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyarchitecture/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pyarchitecture import cpu, disks, gpu, memory

version = "0.1.0a2"
version = "0.1.0a3"


def all_components() -> Dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion pyarchitecture/cpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ def get_cpu_info(cpu_lib: str | os.PathLike = None) -> Dict[str, int | str]:
return {
"name": cpu_name,
"logical_cores": cpu_count,
"physical_cores": cpu_count / 2 if cpu_count >= 2 else 1,
"physical_cores": int(cpu_count / 2) if cpu_count >= 2 else 1,
}
LOGGER.error(f"CPU library {library_path!r} doesn't exist")
2 changes: 1 addition & 1 deletion pyarchitecture/memory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_memory_info(
models.OperatingSystem.windows: windows.get_memory_info,
}
library_path = _get_mem_lib(mem_lib)
if os.path.isfile(library_path) :
if os.path.isfile(library_path):
raw_info = os_map[models.OPERATING_SYSTEM](library_path)
if humanize:
return {k: squire.size_converter(v) for k, v in raw_info.items()}
Expand Down

0 comments on commit d33dd4a

Please sign in to comment.