Skip to content

Commit 82d7cd6

Browse files
Merge pull request #120 from matchms/matchms_0_18
Update to matchms 0.18.0
2 parents 78869c8 + 985f0eb commit 82d7cd6

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

.github/workflows/CI_build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
run: pytest
107107
- name: Install Tensorflow version 2.8
108108
run: |
109+
pip install --upgrade "numpy<1.24.0"
109110
pip install --upgrade "tensorflow>=2.8,<2.9"
110111
- name: Show pip list
111112
run: |

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.3.1] - 2023-01-06
11+
12+
### Changed
13+
14+
- 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)
1015

1116
## [0.3.0] - 2022-11-29
1217

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

9398
- This is the initial version of MS2DeepScore
9499

95-
[Unreleased]: https://github.com/matchms/ms2deepscore/compare/0.3.0...HEAD
100+
[Unreleased]: https://github.com/matchms/ms2deepscore/compare/0.3.1...HEAD
101+
[0.3.1]: https://github.com/matchms/ms2deepscore/compare/0.3.1...0.3.1
96102
[0.3.0]: https://github.com/matchms/ms2deepscore/compare/0.2.3...0.3.0
97103
[0.2.3]: https://github.com/matchms/ms2deepscore/compare/0.2.2...0.2.3
98104
[0.2.2]: https://github.com/matchms/ms2deepscore/compare/0.2.1...0.2.2

ms2deepscore/MS2DeepScore.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def pair(self, reference: Spectrum, query: Spectrum) -> float:
102102
return cosine_similarity(reference_vector[0, :], query_vector[0, :])
103103

104104
def matrix(self, references: List[Spectrum], queries: List[Spectrum],
105+
array_type: str = "numpy",
105106
is_symmetric: bool = False) -> np.ndarray:
106107
"""Calculate the MS2DeepScore similarities between all references and queries.
107108
@@ -111,6 +112,10 @@ def matrix(self, references: List[Spectrum], queries: List[Spectrum],
111112
Reference spectrum.
112113
queries:
113114
Query spectrum.
115+
array_type
116+
Specify the output array type. Can be "numpy" or "sparse".
117+
Currently, only "numpy" is supported and will return a numpy array.
118+
Future versions will include "sparse" as option to return a COO-sparse array.
114119
is_symmetric:
115120
Set to True if references == queries to speed up calculation about 2x.
116121
Uses the fact that in this case score[i, j] = score[j, i]. Default is False.

ms2deepscore/MS2DeepScoreMonteCarlo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def pair(self, reference: Spectrum, query: Spectrum) -> Tuple[float, float]:
145145
dtype=self.score_datatype)
146146

147147
def matrix(self, references: List[Spectrum], queries: List[Spectrum],
148+
array_type: str = "numpy",
148149
is_symmetric: bool = False) -> np.ndarray:
149150
"""Calculate the MS2DeepScoreMonteCarlo similarities between all references and queries.
150151
@@ -154,6 +155,10 @@ def matrix(self, references: List[Spectrum], queries: List[Spectrum],
154155
Reference spectrum.
155156
queries:
156157
Query spectrum.
158+
array_type
159+
Specify the output array type. Can be "numpy" or "sparse".
160+
Currently, only "numpy" is supported and will return a numpy array.
161+
Future versions will include "sparse" as option to return a COO-sparse array.
157162
is_symmetric:
158163
Set to True if references == queries to speed up calculation about 2x.
159164
Uses the fact that in this case score[i, j] = score[j, i]. Default is False.

ms2deepscore/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.3.0'
1+
__version__ = '0.3.1'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
test_suite="tests",
3030
python_requires='>=3.7',
3131
install_requires=[
32-
"matchms",
32+
"matchms>=0.14.0",
3333
"numba",
3434
"numpy>= 1.20.3",
3535
"pandas",

0 commit comments

Comments
 (0)