Skip to main content

biotest

build

image PyPI - Downloads image image

Ruff Actions status
Ruff Actions status
pytest doctest Actions status
uv Actions status
Built with Material for MkDocs Actions status

A Python package for testing bioinformatics data. Mainly, it provides a set of functions to compare normal text/binary files, npy files, pdb files, and directories.

🛠️ Installation

pip install biotest

🚀 Usage

Mainly, use the API with pytest.

from biotest.compare_files import (
    assert_two_files_equal_sha,
    assert_two_npys_within_tolerance,
    assert_two_pdbqt_files_within_tolerance,
    assert_two_pdb_files_within_tolerance,
    assert_two_dirs_within_tolerance,
)

def assert_two_files_sha(file1: str | PathLike | IOBase, file2: str | PathLike | IOBase):
    """
    Assert that two files are exactly the same.
    """
    ...

def assert_two_npys_within_tolerance(
    npy1: str | PathLike | np.ndarray, npy2: str | PathLike | np.ndarray, *, tolerance=1e-6
):
    """
    Assert that two npy files are almost the same within a tolerance.
    """
    ...


def assert_two_pdbqt_files_within_tolerance(
    file1: str | PathLike | IOBase, file2: str | PathLike | IOBase, *, tolerance=1e-3
):
    """
    Assert that two pdbqt files are equal under following conditions.

    - ignore the trailing whitespace.
    - 0.001 default tolerance for Orthogonal coordinates for X,Y,Z in Angstroms.
    """
    ...


def assert_two_pdb_files_within_tolerance(
    file1: str | PathLike | IOBase, file2: str | PathLike | IOBase, *, tolerance=1e-3
):
    """
    Assert that two pdb files are equal under following conditions.

    - ignore the trailing whitespace.
    - 0.001 default tolerance for Orthogonal coordinates for X,Y,Z in Angstroms.
    """
    ...


def assert_two_dirs_within_tolerance(
    dir1: str | PathLike,
    dir2: str | PathLike,
    *,
    tolerance: float = 1e-3,
    filenames_exclude: Sequence[str] | None = None,
):
    """
    Assert that two directories have the same files with almost the same content within tolerance.
    """
    ...

Also, you can use the CLI to quickly test the functionality. These merely call the functions above, so they will print the traceback if the assertion fails.

biotest assert-two-files-equal-sha file1 file2
biotest assert-two-npys-within-tolerance file1.npy file2.npy
biotest assert-two-pdbqt-files-within-tolerance file1.pdbqt file2.pdbqt
biotest assert-two-pdb-files-within-tolerance file1.pdb file2.pdb
biotest assert-two-dirs-within-tolerance dir1 dir2

Metadata

Release files for biotest 0.0.4

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

Source distribution (sdist)

Source distribution for biotest 0.0.4
File Size Uploaded Provenance
biotest-0.0.4.tar.gz 17.2 kB Without provenance Details

Release files / biotest-0.0.4.tar.gz

Download URL biotest-0.0.4.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e12f618b4faccbc9e479bf397592aed527ae37adf30079bf7407f88e862102eb
BLAKE2b-256 checksum
How to use checksums
022cdf289bf6fefe4600f89fa9b121da3c13c8d2665d4420082bb2d75bb2ce79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.5.8

Security for biotest 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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