Skip to content

Add more support for typing, fix some typing-related edge case bugs #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.10"

- name: Install dependencies
run: |
Expand Down
25 changes: 15 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint with Ruff
uses: astral-sh/ruff-action@v3
with:
args: check --exclude docs,tests

- name: Check with Ruff
run: ruff check --output-format=github .
- name: Check formatting with Ruff
uses: astral-sh/ruff-action@v3
with:
args: format --check --diff --exclude docs,tests

- name: Install package and its dependencies
run: pip install --editable .[dev,idxml]

- name: Static type checking with mypy
run: mypy --non-interactive

- name: Test with pytest and codecov
run: |
pytest --cov=psm_utils --cov-report=xml tests/
pytest --cov=psm_utils --cov-report=xml tests/

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand All @@ -46,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions online/Home.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@


class StreamlitPageHome(StreamlitPage):
"""Streamlit page for the home section."""

def _main_page(self):
pass

Expand Down
7 changes: 4 additions & 3 deletions online/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ECDF:
----------
x : array_like
Observations

"""

def __init__(self, x):
Expand Down Expand Up @@ -101,15 +102,15 @@ def pp_plot(psm_df):

def fdr_plot(psm_df, fdr_threshold):
"""Plot number of identifications in function of FDR threshold."""
df = (
target_psm_df = (
psm_df[~psm_df["is_decoy"]]
.reset_index(drop=True)
.sort_values("qvalue", ascending=True)
.copy()
)
df["count"] = (~df["is_decoy"]).cumsum()
target_psm_df["count"] = (~target_psm_df["is_decoy"]).cumsum()
fig = px.line(
df,
target_psm_df,
x="qvalue",
y="count",
log_x=True,
Expand Down
2 changes: 2 additions & 0 deletions psm_utils/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@


def main():
"""Run the main entry point for the psm_utils CLI."""
logging.basicConfig(
level="NOTSET",
format="%(message)s",
Expand All @@ -47,6 +48,7 @@ def main():

@click.group()
def cli():
"""Command line interface for psm_utils."""
pass


Expand Down
Loading
Loading