semvec/pypi-packages huggingface dataset:
ascend-npu-utils 0.1.1
A utility library for interacting with Ascend NPUs via the npu-smi command options, to directly get information from the terminal commands parsed into python
Requires Python: >=3.6

# Ascend NPU Utils

A utility library for interacting with Ascend NPUs using the `npu-smi` tool.

## Purpose

`ascend-npu-utils` is designed to provide an easy-to-use interface for accessing and manipulating information from Ascend Neural Processing Units (NPUs). By parsing the output of the `npu-smi info` command, this library allows developers to directly retrieve useful metrics and statistics about NPU devices and their performance in Python applications.

## Features

- **Retrieve NPU Device Information**: Get details about each available NPU, including health status, power consumption, temperature, and memory usage.
  
- **Query Power Dissipation**: Access real-time power consumption data for specific NPUs to monitor energy usage.

- **List Running Processes**: Identify processes that are currently utilizing the NPU, helping to manage workloads effectively.

- **Memory Usage Statistics**: Obtain total and used memory information for specified NPU devices, aiding in resource management.

## Installation

You can install the package using pip:

```bash
pip install ascend-npu-utils
Usage
Here’s a simple example of how to use the library:

```python

from ascend_npu_utils.utils import AscendNPUUtils

# Create an instance of the utility class
npu_utils = AscendNPUUtils()

# Retrieve NPU information
npu_info = npu_utils.npu_smi()
print("NPU Info:", npu_info)

# Query power dissipation for the first NPU
power_dissipation = npu_utils.npu_smi_query_power(npu_id=0)
print("Power Dissipation:", power_dissipation)

# List all processes running on the NPU
npu_processes = npu_utils.list_npu_processes()
print("NPU Processes:", npu_processes)

# Get memory usage information for the first NPU
memory_info = npu_utils.get_memory_info(device_index=0)
print("Memory Info:", memory_info)
```

Requirements
Python 3.6 or higher
psutil package
Limitations
This utility has primarily been tested on the Ascend 310P3 model, and while it aims to support other Ascend NPUs, there may be variations in command outputs that could affect compatibility.
polars-interval-match 0.1.31
A Python extension module for matching intervals in Polars DataFrames
Requires Python: >=3.10
Keywords: Polars, interval, data science, data wrangling, plugin

# Polars Interval Match

This package enables the matching of a Polars `Series` of numerical values (currently only `Float64` is supported) to a `Series` of interval strings (using standard interval notation).

## Installation

You can install the package using pip:

```sh
pip install polars-interval-match
```

## Usage

Here is a basic example of how to use the `match_intervals` function:

```python
import polars as pl
from polars_interval_match import match_intervals

# Create a Polars Series of values
values = pl.Series("values", [1.5, 2.5, 3.5, 4.5])

# Create a Polars Series of interval strings
intervals = pl.Series("intervals", ["[1.0, 2.0]", "(2.0, 3.0]", "[3.0, 4.0)", "(4.0, 5.0]"])

# Match values to intervals
matched = match_intervals(values, intervals)

# Show the result
print(matched)
```

The match_intervals function matches each value in the `values` Series to the corresponding interval in the `intervals` Series. The intervals are specified using standard interval notation:

- `[a, b]` denotes an interval that includes both endpoints a and b (is closed on both the left and the right).
- `(a, b]` denotes an interval that excludes the start point a but includes the endpoint b (is closed on the right only).
- `[a, b)` denotes an interval that includes the start point a but excludes the endpoint b (is closed on the left only).
- `(a, b)` denotes an interval that excludes both endpoints a and b (is open on both the left and the right).

The function returns a new Polars `Series` where each value is replaced by the interval it matches.