Skip to content

Commit 2ecad6c

Browse files
authored
Merge pull request #5 from bigbio/dev
tests improved
2 parents dd72319 + 149f17e commit 2ecad6c

17 files changed

+531
-9
lines changed

.github/workflows/pyspectrafuse-containers.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ jobs:
8888
# Note: Only building for linux/amd64
8989
platforms: linux/amd64
9090

91+
- name: Test container functionality
92+
run: |
93+
echo "Testing container import and CLI..."
94+
docker run --rm ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} --help || docker run --rm ghcr.io/bigbio/pyspectrafuse:latest --help
95+
echo "Testing Python imports..."
96+
docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "from pyspectrafuse.pyspectrafuse import main; print('CLI import successful')" || docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:latest -c "from pyspectrafuse.pyspectrafuse import main; print('CLI import successful')"
97+
echo "Testing consensus strategy imports..."
98+
docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "from pyspectrafuse.consensus_strategy.best_spetrum_strategy import BestSpectrumStrategy; print('BestSpectrumStrategy import successful')" || docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:latest -c "from pyspectrafuse.consensus_strategy.best_spetrum_strategy import BestSpectrumStrategy; print('BestSpectrumStrategy import successful')"
99+
echo "Testing spectrum_utils import (numba caching test)..."
100+
docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:${{ steps.version.outputs.VERSION }} -c "import spectrum_utils.spectrum as sus; print('spectrum_utils import successful')" || docker run --rm --entrypoint python ghcr.io/bigbio/pyspectrafuse:latest -c "import spectrum_utils.spectrum as sus; print('spectrum_utils import successful')"
101+
echo "All container tests passed!"
102+
91103
- name: Free up disk space after build
92104
run: |
93105
docker image rm ghcr.io/bigbio/pyspectrafuse:latest || true

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ jobs:
4949
name: codecov-umbrella
5050
fail_ci_if_error: false
5151

52+

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,14 @@ cython_debug/
163163
#Ignore cursor AI rules
164164
.cursor/
165165
.codacy/
166+
167+
# Test data files (downloaded from FTP)
168+
**/PXD*.parquet
169+
**/PXD*.sdrf.tsv
170+
**/pyspectrafuse_ftp_test_*/
171+
**/mgf_output/
172+
**/msp_output/
173+
**/*.mgf
174+
**/*.msp
175+
**/test_data/
176+
**/integration_test_data/

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ LABEL description="pyspectrafuse - Command-line utilities for spectrum clusterin
66
# Set working directory
77
WORKDIR /app
88

9+
# Set numba cache directory to a writable location
10+
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
11+
912
# Install system dependencies
1013
RUN apt-get update && apt-get install -y --no-install-recommends \
1114
build-essential \
12-
&& rm -rf /var/lib/apt/lists/*
15+
&& rm -rf /var/lib/apt/lists/* \
16+
&& mkdir -p /tmp/numba_cache
1317

1418
# Copy requirements first for better caching
1519
COPY requirements.txt .
@@ -26,7 +30,7 @@ COPY pyspectrafuse/ ./pyspectrafuse/
2630
RUN pip install --no-cache-dir -e .
2731

2832
# Set the entrypoint
29-
ENTRYPOINT ["pyspectrafuse_cli"]
33+
ENTRYPOINT ["pyspectrafuse"]
3034

3135
# Default command
3236
CMD ["--help"]

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# pyspectrafuse
22

3+
[![Tests](https://github.com/bigbio/pyspectrafuse/actions/workflows/tests.yml/badge.svg)](https://github.com/bigbio/pyspectrafuse/actions/workflows/tests.yml)
4+
[![Containers](https://github.com/bigbio/pyspectrafuse/actions/workflows/pyspectrafuse-containers.yml/badge.svg)](https://github.com/bigbio/pyspectrafuse/actions/workflows/pyspectrafuse-containers.yml)
5+
[![codecov](https://codecov.io/gh/bigbio/pyspectrafuse/branch/master/graph/badge.svg)](https://codecov.io/gh/bigbio/pyspectrafuse)
6+
[![Python](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
7+
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
8+
39
Python library with utility scripts for spectrafuse pipeline - a tool for processing and converting mass spectrometry data formats, generating consensus spectra, and handling cluster-based analysis workflows.
410

511
## Features
@@ -64,7 +70,7 @@ The package provides a command-line interface with two main commands:
6470
Convert parquet files to MGF format:
6571

6672
```bash
67-
pyspectrafuse_cli convert-mgf \
73+
pyspectrafuse convert-mgf \
6874
--parquet_dir /path/to/parquet/files \
6975
--batch_size 100000 \
7076
--spectra_capacity 1000000 \
@@ -82,7 +88,7 @@ pyspectrafuse_cli convert-mgf \
8288
Generate MSP format files from clustered spectra:
8389

8490
```bash
85-
pyspectrafuse_cli msp \
91+
pyspectrafuse msp \
8692
--parquet_dir /path/to/project \
8793
--method_type average \
8894
--cluster_tsv_file /path/to/cluster.tsv \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Homepage = "https://github.com/bigbio/pyspectrafuse"
3333
Repository = "https://github.com/bigbio/pyspectrafuse"
3434

3535
[project.scripts]
36-
pyspectrafuse_cli = "pyspectrafuse.pyspectrafuse_cli:main"
36+
pyspectrafuse = "pyspectrafuse.pyspectrafuse:main"
3737

3838
[tool.setuptools]
3939
include-package-data = true

pyspectrafuse/commands/quantmsio2mgf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import os
1010

1111
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
12-
REVISION = "0.1.1"
1312

1413
logger = logging.getLogger(__name__)
1514

pyspectrafuse/commands/spectrum2msp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import uuid
1414

1515
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
16-
REVISION = "0.1.1"
1716

1817
logger = logging.getLogger(__name__)
1918

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from pyspectrafuse import __version__
55

66
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
7-
REVISION = "0.1.1"
87

98

109
# Cli returns command line requests

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ pytest>=7.0.0
1111
pytest-cov>=4.0.0
1212
pytest-mock>=3.10.0
1313

14+

0 commit comments

Comments
 (0)