Skip to content

Commit 0d5c207

Browse files
authored
Merge branch 'main' into PEP639
2 parents 71cc71c + d20b740 commit 0d5c207

25 files changed

Lines changed: 178 additions & 72 deletions

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: continuous-integration
22

33
on: [push, pull_request]
44

5+
# Cancel in-progress runs when a new push is made to the same branch/PR
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
510
jobs:
611
test:
712
runs-on: ${{ matrix.os }}

.github/workflows/execute_notebooks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
- '.github/workflows/execute_notebooks.yml'
1717
workflow_dispatch: # Allow manual trigger
1818

19+
# Cancel in-progress runs when a new push is made to the same branch/PR
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
1924
jobs:
2025
execute-notebooks:
2126
runs-on: ubuntu-latest

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ permissions:
2222
id-token: write
2323
pull-requests: write
2424

25-
# Allow only one concurrent deployment per branch/PR
25+
# Allow only one concurrent deployment per branch/PR, cancel in-progress runs
2626
concurrency:
2727
group: "pages-${{ github.ref }}"
28-
cancel-in-progress: false
28+
cancel-in-progress: true
2929

3030
jobs:
3131
# Build job - runs for both main branch and PRs

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pyOpenMS-Viz is a Python library that provides a simple interface for extending
2222
- Consistent API across different plotting backends for easy switching between static and interactive plots
2323
- Suitable for use in scripts, Jupyter notebooks, and web applications
2424

25-
## Suported Plots
25+
## Supported Plots
2626
| **Plot Type** | **Required Dimensions** | **pyopenms_viz Name** | **Matplotlib** | **Bokeh** | **Plotly** |
2727
|-----------------|-------------------------|-----------------------------------------------------------|----------------|-----------|------------|
2828
| Chromatogram | x, y | chromatogram ||||
@@ -36,7 +36,7 @@ pyOpenMS-Viz is a Python library that provides a simple interface for extending
3636

3737
The recommended way of installing pyopenms_viz is through the Python Package Index (PyPI). We recommend installing pyopenms_viz in its own virtual environment using Anaconda to avoid packaging conflicts.
3838

39-
First create a new environemnt:
39+
First create a new environment:
4040

4141
```bash
4242
conda create --name=pyopenms_viz python=3.12

docs/Getting Started.ipynb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -678,15 +678,15 @@
678678
"id": "3dc84ffd-d227-4593-a699-b1d9bac20dcb",
679679
"metadata": {},
680680
"source": [
681-
"##### Base Customization Examples (Avalible for all graph types)"
681+
"##### Base Customization Examples (Available for all graph types)"
682682
]
683683
},
684684
{
685685
"cell_type": "markdown",
686686
"id": "549340bf-6216-4a48-8d9b-bc8091611225",
687687
"metadata": {},
688688
"source": [
689-
"Below are examples of customizations avaliable for all plot types. For a full list of customization options, please see [Parameters](Parameters/Parameters.rst)"
689+
"Below are examples of customizations available for all plot types. For a full list of customization options, please see [Parameters](Parameters/Parameters.rst)"
690690
]
691691
},
692692
{
@@ -858,7 +858,7 @@
858858
"plt.savefig('spectrum.pdf')\n",
859859
"```\n",
860860
"\n",
861-
"- For bokeh, you can use `output_file` method to save an html file of the iteractive plot. To save a static plot you can use the tool bar in the interactive plot to save the plot as a png. Or you can use the `export_png` method. However, this requires additional dependencies: `pip install selenium geckodriver firefox`. For more information on saving bokeh plots see [here](https://docs.bokeh.org/en/latest/docs/first_steps/first_steps_7.html#first-steps-7-displaying-and-exporting).\n",
861+
"- For bokeh, you can use `output_file` method to save an html file of the interactive plot. To save a static plot you can use the tool bar in the interactive plot to save the plot as a png. Or you can use the `export_png` method. However, this requires additional dependencies: `pip install selenium geckodriver firefox`. For more information on saving bokeh plots see [here](https://docs.bokeh.org/en/latest/docs/first_steps/first_steps_7.html#first-steps-7-displaying-and-exporting).\n",
862862
"\n",
863863
"```python\n",
864864
"from bokeh.io import output_file\n",
@@ -901,7 +901,7 @@
901901
"id": "732688a5-c69f-48e9-a6bb-c0216d52595e",
902902
"metadata": {},
903903
"source": [
904-
"If there is a peptide spectrum match, it is useful to annotate the spectrum with the fragments of the expected peptide so that one can manually evalute the match. Here, we demonstrate how to do this with `pyopenms_viz` and `pyopenms`"
904+
"If there is a peptide spectrum match, it is useful to annotate the spectrum with the fragments of the expected peptide so that one can manually evaluate the match. Here, we demonstrate how to do this with `pyopenms_viz` and `pyopenms`"
905905
]
906906
},
907907
{
@@ -953,7 +953,7 @@
953953
"id": "2495b624-e17c-4803-8bae-a3581ac325c3",
954954
"metadata": {},
955955
"source": [
956-
"To plot with pyopenms_viz, all that is required is the addtional `reference_spectrum` parameter which contains a pandas dataframe of the theoretical spectrum and to change `mirror_spectrum` to `True`"
956+
"To plot with pyopenms_viz, all that is required is the additional `reference_spectrum` parameter which contains a pandas dataframe of the theoretical spectrum and to change `mirror_spectrum` to `True`"
957957
]
958958
},
959959
{
@@ -1512,7 +1512,7 @@
15121512
"id": "273adf2f-8879-4c82-99f8-0ea8f83013c8",
15131513
"metadata": {},
15141514
"source": [
1515-
"Below are some customizations that are specific to the `\"peakMap\"` plot. Note that some of these customizations, such as binning are also available for the `\"spectrum\"` plot however they are not avaliable for all plot types (e.g. `\"chromatogram\"`). For a full list of customizations please see the [PeakMap Parameters](Parameters/PeakMap.rst)."
1515+
"Below are some customizations that are specific to the `\"peakMap\"` plot. Note that some of these customizations, such as binning are also available for the `\"spectrum\"` plot however they are not available for all plot types (e.g. `\"chromatogram\"`). For a full list of customizations please see the [PeakMap Parameters](Parameters/PeakMap.rst)."
15161516
]
15171517
},
15181518
{
@@ -1933,7 +1933,7 @@
19331933
"id": "1abd64d2-3f47-4fe5-bbd7-bea77515b10c",
19341934
"metadata": {},
19351935
"source": [
1936-
"A chromatogram plot is useful for visualizing intensity across retention time. This can either be the total ion current across retention time or the ion curent from a specific region across m/z as used in targeted apporaches. "
1936+
"A chromatogram plot is useful for visualizing intensity across retention time. This can either be the total ion current across retention time or the ion current from a specific region across m/z as used in targeted approaches. "
19371937
]
19381938
},
19391939
{
@@ -2093,7 +2093,7 @@
20932093
"id": "026280af-f73a-4d71-97fd-035b20a28994",
20942094
"metadata": {},
20952095
"source": [
2096-
"In this dataset different features are resolved nicely as indicated by nicely seperable peaks. "
2096+
"In this dataset different features are resolved nicely as indicated by nicely separable peaks. "
20972097
]
20982098
},
20992099
{
@@ -2125,7 +2125,7 @@
21252125
"id": "9b17fa72-1791-4e9d-b0e5-8d743042fbf5",
21262126
"metadata": {},
21272127
"source": [
2128-
"In this example, we will show how `pyopenms_viz` can be used to inspec a target peptide in Data Indepdent Acquisition. For this, we will be using a timsTOF dataset and show how `pyopenms_viz` integrates well with [alphatims](https://github.com/MannLabs/alphatims) "
2128+
"In this example, we will show how `pyopenms_viz` can be used to inspec a target peptide in Data Independent Acquisition. For this, we will be using a timsTOF dataset and show how `pyopenms_viz` integrates well with [alphatims](https://github.com/MannLabs/alphatims) "
21292129
]
21302130
},
21312131
{
@@ -2691,7 +2691,7 @@
26912691
"id": "ef06ecc1-fa50-48a2-97a0-8c86995765b3",
26922692
"metadata": {},
26932693
"source": [
2694-
"If we plot the dia_df chromatograms at baseline, we will have multiple points per RT point (due to multiple points across ion mobility). To address this we can use the `aggregate_duplicates=True` argument. Furthermore, setting `by='Annotation` tells `pyopenms_viz` to plot each annotation as a seperate chromatogram."
2694+
"If we plot the dia_df chromatograms at baseline, we will have multiple points per RT point (due to multiple points across ion mobility). To address this we can use the `aggregate_duplicates=True` argument. Furthermore, setting `by='Annotation` tells `pyopenms_viz` to plot each annotation as a separate chromatogram."
26952695
]
26962696
},
26972697
{
@@ -2755,7 +2755,7 @@
27552755
"dia_df.plot(x='rt_values', \n",
27562756
" y='intensity_values', \n",
27572757
" kind='chromatogram', \n",
2758-
" by='Annotation', # each annotation as seperate chromatogram\n",
2758+
" by='Annotation', # each annotation as separate chromatogram\n",
27592759
" aggregate_duplicates=True,\n",
27602760
" width=700,\n",
27612761
" legend_config=dict(title='Annotation'),\n",
@@ -2768,7 +2768,7 @@
27682768
"id": "83f27f19-ba2d-479d-808a-92eb2211afc1",
27692769
"metadata": {},
27702770
"source": [
2771-
"Based on the plot above, it looks like this peptide precursor elutes from 594.40 to 605 seconds. We can draw these boundaries on the chromatogram by specifiying the `annotation_data` dataframe. We can also extract across retention time to better see the feature."
2771+
"Based on the plot above, it looks like this peptide precursor elutes from 594.40 to 605 seconds. We can draw these boundaries on the chromatogram by specifying the `annotation_data` dataframe. We can also extract across retention time to better see the feature."
27722772
]
27732773
},
27742774
{
@@ -2837,7 +2837,7 @@
28372837
"dia_df_small.plot(x='rt_values', \n",
28382838
" y='intensity_values', \n",
28392839
" kind='chromatogram', \n",
2840-
" by='Annotation', # each annotation as seperate chromatogram\n",
2840+
" by='Annotation', # each annotation as separate chromatogram\n",
28412841
" aggregate_duplicates=True,\n",
28422842
" annotation_data=annotation_data,\n",
28432843
" width=700,\n",
@@ -2852,7 +2852,7 @@
28522852
"id": "a3335ede-5d2d-4afb-93f8-dd9f5beca962",
28532853
"metadata": {},
28542854
"source": [
2855-
"Grouping is not only limited to `Annnotation` we can change the `by` parameter to `ms_level` to get the total ion chromatograms for MS1 and MS2 levels respectively."
2855+
"Grouping is not only limited to `Annotation` we can change the `by` parameter to `ms_level` to get the total ion chromatograms for MS1 and MS2 levels respectively."
28562856
]
28572857
},
28582858
{
@@ -2921,7 +2921,7 @@
29212921
"dia_df_small.plot(x='rt_values', \n",
29222922
" y='intensity_values', \n",
29232923
" kind='chromatogram', \n",
2924-
" by='ms_level', # each ms_level as a seperate chromatogram\n",
2924+
" by='ms_level', # each ms_level as a separate chromatogram\n",
29252925
" aggregate_duplicates=True,\n",
29262926
" annotation_data=annotation_data,\n",
29272927
" width=700,\n",

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def bokeh_scraper(block, block_vars, gallery_conf, **kwargs):
295295
+ "from bokeh.plotting import show\n"
296296
+ str(block[1])
297297
)
298-
# add indendation
298+
# add indentation
299299
code_block = code_block.replace("\n", "\n ")
300300

301301
return code_block

docs/gallery_scripts_template/plot_chromatogram.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
pd.options.plotting.backend = "TEMPLATE"
1212

13-
url = "https://zenodo.org/records/17904352/files/ionMobilityTestChromatogramDf.tsv?download=1"
13+
# GitHub raw URL (primary) with Zenodo as backup
14+
url = "https://raw.githubusercontent.com/OpenMS/pyopenms_viz/main/test/test_data/ionMobilityTestChromatogramDf.tsv"
15+
backup_url = "https://zenodo.org/records/17904352/files/ionMobilityTestChromatogramDf.tsv?download=1"
1416
local_path = "ionMobilityTestChromatogramDf.tsv"
15-
download_file(url, local_path)
17+
download_file(url, local_path, backup_url=backup_url)
1618
df = pd.read_csv(local_path, sep="\t")
1719

1820
df.plot(

docs/gallery_scripts_template/plot_investigate_spectrum_binning_ms_matplotlib.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
pd.options.plotting.backend = "ms_matplotlib"
1313

14-
url = "https://zenodo.org/records/17904352/files/TestSpectrumDf.tsv?download=1"
14+
# GitHub raw URL (primary) with Zenodo as backup
15+
url = "https://raw.githubusercontent.com/OpenMS/pyopenms_viz/main/test/test_data/TestSpectrumDf.tsv"
16+
backup_url = "https://zenodo.org/records/17904352/files/TestSpectrumDf.tsv?download=1"
1517
local_path = "TestSpectrumDf.tsv"
16-
download_file(url, local_path)
18+
download_file(url, local_path, backup_url=backup_url)
1719
df = pd.read_csv(local_path, sep="\t")
1820

1921
# Let's assess the peak binning and create a 4 by 2 subplot to visualize the different methods of binning

docs/gallery_scripts_template/plot_manuscript_d_fructose_spectrum_prediction_ms_matplotlib.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@
4949

5050
from pyopenms_viz.util import download_file, unzip_file
5151

52-
# URL of the ZIP file
53-
url = "https://zenodo.org/records/17904512/files/d_fructose_example.zip?download=1"
54-
55-
# Download and extract the ZIP file
52+
# GitHub release asset (primary) with Zenodo as backup
53+
url = "https://github.com/OpenMS/pyopenms_viz/releases/download/manuscript/d_fructose_example.zip"
54+
backup_url = (
55+
"https://zenodo.org/records/17904512/files/d_fructose_example.zip?download=1"
56+
)
5657
zip_filename = "d_fructose_example.zip"
57-
download_file(url, zip_filename)
58+
download_file(url, zip_filename, backup_url=backup_url)
5859
unzip_file(zip_filename, ".") # Extract to current directory
5960

6061

docs/gallery_scripts_template/plot_mobilogram.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
This example shows how to use different approaches.
77
"""
88

9-
import os
109
import pandas as pd
1110
from pyopenms_viz.util import download_file
1211

1312
pd.options.plotting.backend = "TEMPLATE"
1413

14+
# GitHub raw URL (primary) with Zenodo as backup
15+
url = "https://raw.githubusercontent.com/OpenMS/pyopenms_viz/main/test/test_data/ionMobilityTestFeatureDf.tsv"
16+
backup_url = (
17+
"https://zenodo.org/records/17904352/files/ionMobilityTestFeatureDf.tsv?download=1"
18+
)
1519
local_path = "ionMobilityTestFeatureDf.tsv"
16-
url = "https://zenodo.org/records/17904352/files/ionMobilityTestFeatureDf.tsv?download=1"
17-
download_file(url, local_path)
20+
download_file(url, local_path, backup_url=backup_url)
1821
df = pd.read_csv(local_path, sep="\t")
1922

2023
df.plot(

0 commit comments

Comments
 (0)