Repository: matchms/matchms

Issue:
Filter parameters in default pipelines are not used
When adding filter parameters in the default filters they are not used by SpectrumProcessor. 

For instance in the code below "ion_mode_to_keep" is not set to "both"

```python
FULLY_ANNOTATED_PROCESSING = DEFAULT_FILTERS \
    + ["clean_adduct",
       "derive_inchi_from_smiles",
       "derive_smiles_from_inchi",
       ("require_correct_ionmode", {"ion_mode_to_keep": "both"}),
       ("require_parent_mass_match_smiles", {'mass_tolerance': 0.1}),
       "require_valid_annotation",
    ]
```



Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 135242fa..09cb8c1c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,8 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [unreleased]
 
-## [0.22.0] - 2023-08-18
-
 ### Added
 
 - New `SpectrumProcessing` class to be the central hub for all filter functions [#455](https://github.com/matchms/matchms/pull/455). Also takes care that filters are executed in a useful order. This is also integrated into the `Pipeline` class.
@@ -562,10 +560,7 @@ Contains three plot types: `plot_spectrum()` or `spectrum.plot()`, `plot_spectra
 - This is the initial version of Spec2Vec from https://github.com/iomega/Spec2Vec
 - (later splitted into matchms + spec2vec)
 
-[Unreleased]: https://github.com/matchms/matchms/compare/0.22.0...HEAD
-[0.22.0]: https://github.com/matchms/matchms/compare/0.21.2...0.22.0
-[0.21.2]: https://github.com/matchms/matchms/compare/0.20.1...0.21.2
-[0.21.1]: https://github.com/matchms/matchms/compare/0.21.0...0.21.1
+[Unreleased]: https://github.com/matchms/matchms/compare/0.21.0...HEAD
 [0.21.0]: https://github.com/matchms/matchms/compare/0.20.0...0.21.0
 [0.20.0]: https://github.com/matchms/matchms/compare/0.19.0...0.20.0
 [0.19.0]: https://github.com/matchms/matchms/compare/0.18.0...0.19.0
diff --git a/matchms/Pipeline.py b/matchms/Pipeline.py
index baf579bb..32214b4e 100644
--- a/matchms/Pipeline.py
+++ b/matchms/Pipeline.py
@@ -214,24 +214,25 @@ class Pipeline:
         self.__workflow = workflow
         self.check_workflow()
 
-        self.write_to_logfile("--- Processing pipeline: ---")
         self._initialize_spectrum_processor_queries()
         if self.is_symmetric is False:
             self._initialize_spectrum_processor_references()
 
     def _initialize_spectrum_processor_queries(self):
         """Initialize spectrum processing workflow for the query spectra."""
+        self.write_to_logfile("--- Processing pipeline query spectra: ---")
         self.processing_queries = initialize_spectrum_processor(
             None,
             self.__workflow["query_filters"]
             )
-
         self.write_to_logfile(str(self.processing_queries))
         if self.processing_queries.processing_steps != self.__workflow["query_filters"]:
             logger.warning("The order of the filters has been changed compared to the Yaml file.")
 
     def _initialize_spectrum_processor_references(self):
         """Initialize spectrum processing workflow for the reference spectra."""
+        self.write_to_logfile("--- Processing pipeline reference spectra: ---")
+
         self.processing_references = initialize_spectrum_processor(
             None,
             self.__workflow["reference_filters"]
diff --git a/matchms/SpectrumProcessor.py b/matchms/SpectrumProcessor.py
index 51964296..5a5f8c31 100644
--- a/matchms/SpectrumProcessor.py
+++ b/matchms/SpectrumProcessor.py
@@ -1,6 +1,6 @@
 from collections import defaultdict
 from functools import partial
-from typing import Optional, Tuple, Union
+from typing import Dict, Optional, Tuple, Union
 import numpy as np
 import pandas as pd
 from tqdm import tqdm
@@ -30,8 +30,8 @@ class SpectrumProcessor:
                 raise ValueError("Predefined pipeline parameter should be a string")
             if predefined_pipeline not in PREDEFINED_PIPELINES:
                 raise ValueError(f"Unknown processing pipeline '{predefined_pipeline}'. Available pipelines: {list(PREDEFINED_PIPELINES.keys())}")
-            for fname in PREDEFINED_PIPELINES[predefined_pipeline]:
-                self.add_matchms_filter(fname)
+            for filter_name in PREDEFINED_PIPELINES[predefined_pipeline]:
+                self.add_matchms_filter(filter_name)
 
     def add_filter(self, filter_function: Union[Tuple[str], str]):
         """Add a filter to the processing pipeline. Takes both matchms filter names (and parameters)
@@ -44,7 +44,7 @@ class SpectrumProcessor:
         else:
             self.add_custom_filter(filter_function[0], filter_function[1])
 
-    def add_matchms_filter(self, filter_spec: Union[Tuple[str], str]):
+    def add_matchms_filter(self, filter_spec: Union[Tuple[str, Dict[str, any]], str]):
         """
         Add a filter to the processing pipeline.
 
@@ -171,11 +171,27 @@ class SpectrumProcessor:
 
     @property
     def processing_steps(self):
-        return [x.__name__ for x in self.filters]
+        filter_list = []
+        for filter_step in self.filters:
+            if isinstance(filter_step, partial):
+                filter_params = filter_step.keywords
+                filter_list.append((filter_step.__name__, filter_params))
+            else:
+                filter_list.append(filter_step.__name__)
+        return filter_list
 
     def __str__(self):
-        summary_string = "SpectrumProcessor\nProcessing steps:\n - "
-        return summary_string + "\n - ".join(self.processing_steps)
+        summary_string = "SpectrumProcessor\nProcessing steps:"
+        for processing_step in self.processing_steps:
+            if isinstance(processing_step, str):
+                summary_string += "\n- " + processing_step
+            elif isinstance(processing_step, tuple):
+                filter_name = processing_step[0]
+                summary_string += "\n- - " + filter_name
+                filter_params = processing_step[1]
+                for filter_param in filter_params:
+                    summary_string += "\n  - " + str(filter_param)
+        return summary_string
 
 
 # List all filters in a functionally working order
@@ -246,7 +262,6 @@ DEFAULT_FILTERS = BASIC_FILTERS \
        "harmonize_undefined_inchi",
        "harmonize_undefined_smiles",
        "repair_inchi_inchikey_smiles",
-       "repair_parent_mass_match_smiles_wrapper",
        "normalize_intensities",
     ]
 FULLY_ANNOTATED_PROCESSING = DEFAULT_FILTERS \
diff --git a/matchms/__version__.py b/matchms/__version__.py
index 81edede8..e9734d46 100644
--- a/matchms/__version__.py
+++ b/matchms/__version__.py
@@ -1,1 +1,1 @@
-__version__ = '0.22.0'
+__version__ = '0.21.2'
diff --git a/pyproject.toml b/pyproject.toml
index 07a8d7fc..e7bccd6d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "matchms"
-version = "0.22.0"
+version = "0.21.2"
 description = "Python library for large-scale comparisons and processing of tandem mass spectral data"
 authors = ["matchms developer team <florian.huber@hs-duesseldorf.de>"]
 


Test patch:
diff --git a/tests/filtering/test_spectrum_processor.py b/tests/filtering/test_spectrum_processor.py
index 0cad682c..44330aaf 100644
--- a/tests/filtering/test_spectrum_processor.py
+++ b/tests/filtering/test_spectrum_processor.py
@@ -40,7 +40,6 @@ def test_filter_sorting_and_output():
         'harmonize_undefined_inchi',
         'harmonize_undefined_smiles',
         'repair_inchi_inchikey_smiles',
-        'repair_parent_mass_match_smiles_wrapper',
         'normalize_intensities'
         ]
     actual_filters = [x.__name__ for x in processing.filters]
@@ -51,8 +50,8 @@ def test_filter_sorting_and_output():
 
 def test_string_output():
     processing = SpectrumProcessor("minimal")
-    expected_str = "SpectrumProcessor\nProcessing steps:\n - make_charge_int\n - interpret_pepmass"\
-        "\n - derive_ionmode\n - correct_charge"
+    expected_str = "SpectrumProcessor\nProcessing steps:\n- make_charge_int\n- interpret_pepmass"\
+        "\n- derive_ionmode\n- correct_charge"
     assert str(processing) == expected_str