Skip to content

Commit

Permalink
Merge pull request #120 from matchms/matchms_0_18
Browse files Browse the repository at this point in the history
Update to matchms 0.18.0
  • Loading branch information
florian-huber authored Jan 6, 2023
2 parents 78869c8 + 985f0eb commit 82d7cd6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
run: pytest
- name: Install Tensorflow version 2.8
run: |
pip install --upgrade "numpy<1.24.0"
pip install --upgrade "tensorflow>=2.8,<2.9"
- name: Show pip list
run: |
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.1] - 2023-01-06

### Changed

- Minor changes to make tests work with new matchms (>=0.18.0). Older versions should work as well though. [#120](https://github.com/matchms/ms2deepscore/pull/120)

## [0.3.0] - 2022-11-29

Expand Down Expand Up @@ -92,7 +97,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- This is the initial version of MS2DeepScore

[Unreleased]: https://github.com/matchms/ms2deepscore/compare/0.3.0...HEAD
[Unreleased]: https://github.com/matchms/ms2deepscore/compare/0.3.1...HEAD
[0.3.1]: https://github.com/matchms/ms2deepscore/compare/0.3.1...0.3.1
[0.3.0]: https://github.com/matchms/ms2deepscore/compare/0.2.3...0.3.0
[0.2.3]: https://github.com/matchms/ms2deepscore/compare/0.2.2...0.2.3
[0.2.2]: https://github.com/matchms/ms2deepscore/compare/0.2.1...0.2.2
Expand Down
5 changes: 5 additions & 0 deletions ms2deepscore/MS2DeepScore.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def pair(self, reference: Spectrum, query: Spectrum) -> float:
return cosine_similarity(reference_vector[0, :], query_vector[0, :])

def matrix(self, references: List[Spectrum], queries: List[Spectrum],
array_type: str = "numpy",
is_symmetric: bool = False) -> np.ndarray:
"""Calculate the MS2DeepScore similarities between all references and queries.
Expand All @@ -111,6 +112,10 @@ def matrix(self, references: List[Spectrum], queries: List[Spectrum],
Reference spectrum.
queries:
Query spectrum.
array_type
Specify the output array type. Can be "numpy" or "sparse".
Currently, only "numpy" is supported and will return a numpy array.
Future versions will include "sparse" as option to return a COO-sparse array.
is_symmetric:
Set to True if references == queries to speed up calculation about 2x.
Uses the fact that in this case score[i, j] = score[j, i]. Default is False.
Expand Down
5 changes: 5 additions & 0 deletions ms2deepscore/MS2DeepScoreMonteCarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def pair(self, reference: Spectrum, query: Spectrum) -> Tuple[float, float]:
dtype=self.score_datatype)

def matrix(self, references: List[Spectrum], queries: List[Spectrum],
array_type: str = "numpy",
is_symmetric: bool = False) -> np.ndarray:
"""Calculate the MS2DeepScoreMonteCarlo similarities between all references and queries.
Expand All @@ -154,6 +155,10 @@ def matrix(self, references: List[Spectrum], queries: List[Spectrum],
Reference spectrum.
queries:
Query spectrum.
array_type
Specify the output array type. Can be "numpy" or "sparse".
Currently, only "numpy" is supported and will return a numpy array.
Future versions will include "sparse" as option to return a COO-sparse array.
is_symmetric:
Set to True if references == queries to speed up calculation about 2x.
Uses the fact that in this case score[i, j] = score[j, i]. Default is False.
Expand Down
2 changes: 1 addition & 1 deletion ms2deepscore/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.0'
__version__ = '0.3.1'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
test_suite="tests",
python_requires='>=3.7',
install_requires=[
"matchms",
"matchms>=0.14.0",
"numba",
"numpy>= 1.20.3",
"pandas",
Expand Down

0 comments on commit 82d7cd6

Please sign in to comment.