Skip to main content

A Python parallel computing library

Project description

CPU-Heater

A Python parallel computing library.

Install

pip install cpu-heater

Usage

Multiprocessing:

import cpu_heater

def adder(x, y):
    return x + y

def test_cpu_heater():
    args_list = [(i, i) for i in range(114514)]
    results = cpu_heater.multiprocess(
        adder,
        args_list,
        max_workers=8,
        show_progress=True,
        timeout=10,
        desc="test",
        not_none=True,
        extend_mode=False,
    )
    assert sorted(results) == sorted([i + i for i in range(114514)])

Multithreading:

import cpu_heater

def adder(x, y):
    return x + y

def test_cpu_heater():
    args_list = [(i, i) for i in range(114514)]
    results = cpu_heater.multithreads(
        adder,
        args_list,
        max_workers=8,
        show_progress=True,
        desc="test",
        not_none=True,
        extend_mode=False,
    )
    assert sorted(results) == sorted([i + i for i in range(114514)])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpu_heater-0.2.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpu_heater-0.2.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file cpu_heater-0.2.1.tar.gz.

File metadata

  • Download URL: cpu_heater-0.2.1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cpu_heater-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4dc4ff909e946e04272a825d9488deb1c07c1b88bac9982e615513575f8b0033
MD5 5ec107a1a5e41873df1ec0982e2b18bb
BLAKE2b-256 7395fe40c54d274b04d016bf486b9f2a806529342f26e60cd9307cf3b294a1d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cpu_heater-0.2.1.tar.gz:

Publisher: python-publish.yml on SunBK201/cpu-heater

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cpu_heater-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: cpu_heater-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cpu_heater-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7195e2d72c2a7ed45195808b288a7c33b6d776663961830451a3775768e21f
MD5 32e1eeac8a1c6a7c5be51429df46f8f5
BLAKE2b-256 519571265d594298d0d49e296c83a3285a9368eb8fab2fa8f50eaa76ea898ac2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cpu_heater-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on SunBK201/cpu-heater

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page