Skip to main content

yeom

yeom is a collection of simple utilities for statistics, machine learning, design of experiments, and image processing.

Installation

Install the package from the repository root:

python -m pip install .

To install the package in editable mode with its test dependencies:

python -m pip install -e ".[test]"

Python 3.9 or later is required.

Converting an OpenCV image to Pillow

to_pil converts an OpenCV image array to a PIL.Image.Image object. OpenCV is not installed as a dependency of yeom; install exactly one OpenCV package appropriate for your environment if you need it to load images.

import cv2 as cv

from yeom import to_pil

cv_image = cv.imread("sample.png", cv.IMREAD_UNCHANGED)
if cv_image is None:
    raise FileNotFoundError("sample.png")

pil_image = to_pil(cv_image)
pil_image.show()

The conversion depends on the shape of the input array:

Input array Conversion Pillow mode
(height, width) Preserve grayscale values L
(height, width, 3) BGR → RGB RGB
(height, width, 4) BGRA → RGBA RGBA

For arrays whose dtype is not uint8, values are clipped to the range 0–255 and then converted to uint8. Arrays with unsupported dimensions or channel counts raise ValueError.

Design-of-experiments utilities

yeom.doe includes utilities for calculating variance inflation factors, estimating regression-coefficient power and required sample sizes, and generating D-optimal designs.

from yeom import doe

design, determinant = doe.coordinate_exchange(4, "A + B")
print(design)
print(determinant)

Testing

pytest

License

MIT License

Metadata

Release files for yeom 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yeom 0.2.0
File Size Uploaded
yeom-0.2.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yeom 0.2.0
File Interpreter ABI Platform
yeom-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / yeom-0.2.0.tar.gz

Download URL yeom-0.2.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5270d3078c4438b29e1a9882f7d586a319ef966b636a9c5e6c089d942a5f33ca
BLAKE2b-256 checksum
How to use checksums
6b982cc3f686db1f5ff523c8e5c444c17cb8d1a58ab27a53d8c717aee1a12a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / yeom-0.2.0-py3-none-any.whl

Download URL yeom-0.2.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
381c41e4d0b2579644927bd84f558def0c375e5b6dcc8cce770b30ce067828ed
BLAKE2b-256 checksum
How to use checksums
043103f6ccaf83ec0893932ddc18ee3f1bd4a2a27037f807bb0e542105c5b968
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page