From f1d3d6d6d324c7325d31b44d6a4bdb60fb550354 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 16 Jan 2026 14:18:44 +0100 Subject: [PATCH] Fix typos found by codespell --- README.md | 4 +-- docs/Getting Started.ipynb | 30 +++++++++---------- docs/conf.py | 2 +- .../gallery_scripts_template/plot_spectrum.py | 2 +- nbs/Spectrum.ipynb | 4 +-- pyopenms_viz/_core.py | 6 ++-- pyopenms_viz/_matplotlib/core.py | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 086ee7821..6afda21ed 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ pyOpenMS-Viz is a Python library that provides a simple interface for extending - Consistent API across different plotting backends for easy switching between static and interactive plots - Suitable for use in scripts, Jupyter notebooks, and web applications -## Suported Plots +## Supported Plots | **Plot Type** | **Required Dimensions** | **pyopenms_viz Name** | **Matplotlib** | **Bokeh** | **Plotly** | |-----------------|-------------------------|-----------------------------------------------------------|----------------|-----------|------------| | Chromatogram | x, y | chromatogram | ✓ | ✓ | ✓ | @@ -36,7 +36,7 @@ pyOpenMS-Viz is a Python library that provides a simple interface for extending 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. -First create a new environemnt: +First create a new environment: ```bash conda create --name=pyopenms_viz python=3.12 diff --git a/docs/Getting Started.ipynb b/docs/Getting Started.ipynb index f040d14e1..1fb03be3b 100644 --- a/docs/Getting Started.ipynb +++ b/docs/Getting Started.ipynb @@ -678,7 +678,7 @@ "id": "3dc84ffd-d227-4593-a699-b1d9bac20dcb", "metadata": {}, "source": [ - "##### Base Customization Examples (Avalible for all graph types)" + "##### Base Customization Examples (Available for all graph types)" ] }, { @@ -686,7 +686,7 @@ "id": "549340bf-6216-4a48-8d9b-bc8091611225", "metadata": {}, "source": [ - "Below are examples of customizations avaliable for all plot types. For a full list of customization options, please see [Parameters](Parameters/Parameters.rst)" + "Below are examples of customizations available for all plot types. For a full list of customization options, please see [Parameters](Parameters/Parameters.rst)" ] }, { @@ -858,7 +858,7 @@ "plt.savefig('spectrum.pdf')\n", "```\n", "\n", - "- 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", + "- 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", "\n", "```python\n", "from bokeh.io import output_file\n", @@ -901,7 +901,7 @@ "id": "732688a5-c69f-48e9-a6bb-c0216d52595e", "metadata": {}, "source": [ - "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`" + "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`" ] }, { @@ -953,7 +953,7 @@ "id": "2495b624-e17c-4803-8bae-a3581ac325c3", "metadata": {}, "source": [ - "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`" + "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`" ] }, { @@ -1512,7 +1512,7 @@ "id": "273adf2f-8879-4c82-99f8-0ea8f83013c8", "metadata": {}, "source": [ - "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)." + "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)." ] }, { @@ -1933,7 +1933,7 @@ "id": "1abd64d2-3f47-4fe5-bbd7-bea77515b10c", "metadata": {}, "source": [ - "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. " + "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. " ] }, { @@ -2093,7 +2093,7 @@ "id": "026280af-f73a-4d71-97fd-035b20a28994", "metadata": {}, "source": [ - "In this dataset different features are resolved nicely as indicated by nicely seperable peaks. " + "In this dataset different features are resolved nicely as indicated by nicely separable peaks. " ] }, { @@ -2125,7 +2125,7 @@ "id": "9b17fa72-1791-4e9d-b0e5-8d743042fbf5", "metadata": {}, "source": [ - "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) " + "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) " ] }, { @@ -2691,7 +2691,7 @@ "id": "ef06ecc1-fa50-48a2-97a0-8c86995765b3", "metadata": {}, "source": [ - "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." + "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." ] }, { @@ -2755,7 +2755,7 @@ "dia_df.plot(x='rt_values', \n", " y='intensity_values', \n", " kind='chromatogram', \n", - " by='Annotation', # each annotation as seperate chromatogram\n", + " by='Annotation', # each annotation as separate chromatogram\n", " aggregate_duplicates=True,\n", " width=700,\n", " legend_config=dict(title='Annotation'),\n", @@ -2768,7 +2768,7 @@ "id": "83f27f19-ba2d-479d-808a-92eb2211afc1", "metadata": {}, "source": [ - "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." + "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." ] }, { @@ -2837,7 +2837,7 @@ "dia_df_small.plot(x='rt_values', \n", " y='intensity_values', \n", " kind='chromatogram', \n", - " by='Annotation', # each annotation as seperate chromatogram\n", + " by='Annotation', # each annotation as separate chromatogram\n", " aggregate_duplicates=True,\n", " annotation_data=annotation_data,\n", " width=700,\n", @@ -2852,7 +2852,7 @@ "id": "a3335ede-5d2d-4afb-93f8-dd9f5beca962", "metadata": {}, "source": [ - "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." + "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." ] }, { @@ -2921,7 +2921,7 @@ "dia_df_small.plot(x='rt_values', \n", " y='intensity_values', \n", " kind='chromatogram', \n", - " by='ms_level', # each ms_level as a seperate chromatogram\n", + " by='ms_level', # each ms_level as a separate chromatogram\n", " aggregate_duplicates=True,\n", " annotation_data=annotation_data,\n", " width=700,\n", diff --git a/docs/conf.py b/docs/conf.py index f70974033..c6ca73fd4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -295,7 +295,7 @@ def bokeh_scraper(block, block_vars, gallery_conf, **kwargs): + "from bokeh.plotting import show\n" + str(block[1]) ) - # add indendation + # add indentation code_block = code_block.replace("\n", "\n ") return code_block diff --git a/docs/gallery_scripts_template/plot_spectrum.py b/docs/gallery_scripts_template/plot_spectrum.py index f0043dbda..d52b63758 100644 --- a/docs/gallery_scripts_template/plot_spectrum.py +++ b/docs/gallery_scripts_template/plot_spectrum.py @@ -16,7 +16,7 @@ download_file(url, local_path) df = pd.read_csv(local_path, sep="\t") -# mirror a reference spectrum with ion and sequence annoations +# mirror a reference spectrum with ion and sequence annotations df.plot( x="mz", y="intensity", diff --git a/nbs/Spectrum.ipynb b/nbs/Spectrum.ipynb index 24a8facf2..7efd0ffb9 100644 --- a/nbs/Spectrum.ipynb +++ b/nbs/Spectrum.ipynb @@ -347,7 +347,7 @@ } ], "source": [ - "# custom annoation for all peaks without mz annotation\n", + "# custom annotation for all peaks without mz annotation\n", "df.plot(x=\"mz\", y=\"intensity\", kind=\"spectrum\",\n", " custom_annotation=\"custom_annotation\", annotate_mz=False, annotate_top_n_peaks=\"all\")" ] @@ -369,7 +369,7 @@ } ], "source": [ - "# mirror a reference spectrum with ion and sequence annoations\n", + "# mirror a reference spectrum with ion and sequence annotations\n", "df.plot(x=\"mz\", y=\"intensity\", kind=\"spectrum\",\n", " ion_annotation=\"ion_annotation\", sequence_annotation=\"sequence\",\n", " reference_spectrum=df, mirror_spectrum=True)" diff --git a/pyopenms_viz/_core.py b/pyopenms_viz/_core.py index 3ab705585..51018df9b 100644 --- a/pyopenms_viz/_core.py +++ b/pyopenms_viz/_core.py @@ -220,7 +220,7 @@ def load_config(self, **kwargs): def _check_and_aggregate_duplicates(self): """ Check if duplicate data is present and aggregate if specified. - Properly handles data types and only aggregates relevent columns + Properly handles data types and only aggregates relevant columns """ # Determine intensity column and relevant grouping columns intensity_col = self.z if self._kind == "peakmap" else self.y @@ -535,7 +535,7 @@ def _create_tooltips(self, entries: dict, index: bool = True): Parameters: entries (dict): Which data to put in tool tip and how display it with labels as keys and column names as values. - index (bool, optional): Wether to show dataframe index in tooltip. Defaults to True. + index (bool, optional): Whether to show dataframe index in tooltip. Defaults to True. Returns: Tooltip text. @@ -774,7 +774,7 @@ def plot(self): # color generation is more complex for spectrum plots, so it has its own methods - # Peak colors are determined by peak_color column (highest priorty) or ion_annotation column (second priority) or "by" column (lowest priority) + # Peak colors are determined by peak_color column (highest priority) or ion_annotation column (second priority) or "by" column (lowest priority) if self.peak_color is not None and self.peak_color in self.data.columns: self.by = self.peak_color elif ( diff --git a/pyopenms_viz/_matplotlib/core.py b/pyopenms_viz/_matplotlib/core.py index beaa0834d..a5aac25c3 100644 --- a/pyopenms_viz/_matplotlib/core.py +++ b/pyopenms_viz/_matplotlib/core.py @@ -65,7 +65,7 @@ def _create_figure(self): Create a figure and axes objects, for consistency with other backends, the fig object stores the matplotlib axes object """ - # TODO why is self.heigh and self.width checked if no alternatives + # TODO why is self.height and self.width checked if no alternatives if self.width is not None and self.height is not None and not self.plot_3d: self.fig, self.ax = plt.subplots( figsize=(self.width / 100, self.height / 100), dpi=100