libgunshotmatch 0.11.0__py3-none-any.whl → 0.11.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of libgunshotmatch might be problematic. Click here for more details.

@@ -29,5 +29,5 @@ Base library for GunShotMatch.
29
29
  __author__: str = "Dominic Davis-Foster"
30
30
  __copyright__: str = "2020-2023 Dominic Davis-Foster"
31
31
  __license__: str = "MIT License"
32
- __version__: str = "0.11.0"
32
+ __version__: str = "0.11.1"
33
33
  __email__: str = "dominic@davis-foster.co.uk"
@@ -477,10 +477,17 @@ class ConsolidatedPeak:
477
477
  for hit in d["hits"]:
478
478
  hits.append(ConsolidatedSearchResult.from_dict(hit))
479
479
 
480
+ ms_list: MutableSequence[Optional[MassSpectrum]] = []
481
+ for msd in d["ms_list"]:
482
+ if msd is None:
483
+ ms_list.append(None)
484
+ else:
485
+ ms_list.append(MassSpectrum.from_dict(msd))
486
+
480
487
  return cls(
481
488
  rt_list=d["rt_list"],
482
489
  area_list=d["area_list"],
483
- ms_list=[MassSpectrum.from_dict(msd) for msd in d["ms_list"]],
490
+ ms_list=ms_list,
484
491
  meta=d["meta"],
485
492
  ms_comparison=d["ms_comparison"],
486
493
  hits=hits,
libgunshotmatch/peak.py CHANGED
@@ -241,6 +241,10 @@ class PeakList(List[Peak]):
241
241
 
242
242
  peaks_as_pure_list: List[Dict[str, Any]] = []
243
243
  for peak in self:
244
+ if peak is None:
245
+ peaks_as_pure_list.append(None)
246
+ continue
247
+
244
248
  try:
245
249
  ion_areas = peak.ion_areas
246
250
  except ValueError:
@@ -28,7 +28,7 @@ Represents a collection of repeat analyses.
28
28
 
29
29
  # stdlib
30
30
  import os
31
- from typing import Any, Dict, List, Mapping, Optional, Type
31
+ from typing import Any, Dict, List, Mapping, MutableSequence, Optional, Type
32
32
 
33
33
  # 3rd party
34
34
  import attr
@@ -131,14 +131,15 @@ class Project:
131
131
  """
132
132
 
133
133
  alignment_as_dict = d["alignment"]
134
- alignment_peaks: List[List[Peak]] = []
134
+ alignment_peaks: List[MutableSequence[Optional[Peak]]] = []
135
135
  for row in alignment_as_dict["peaks"]:
136
136
  alignment_peaks.append([])
137
137
  for peak in row:
138
138
  # print(peak)
139
- peak_obj = peak_from_dict(peak)
140
-
141
- alignment_peaks[-1].append(peak_obj)
139
+ if peak is None:
140
+ alignment_peaks[-1].append(None)
141
+ else:
142
+ alignment_peaks[-1].append(peak_from_dict(peak))
142
143
 
143
144
  alignment = create_alignment(
144
145
  alignment_peaks,
libgunshotmatch/utils.py CHANGED
@@ -171,7 +171,11 @@ def get_rt_range(project: "Project") -> Tuple[float, float]:
171
171
  return min_rt, max_rt
172
172
 
173
173
 
174
- def create_alignment(peakpos: Sequence[Sequence[Peak]], expr_code: List[str], similarity: float = 0) -> Alignment:
174
+ def create_alignment(
175
+ peakpos: Sequence[Sequence[Optional[Peak]]],
176
+ expr_code: List[str],
177
+ similarity: float = 0,
178
+ ) -> Alignment:
175
179
  """
176
180
  Create a new :class:`pyms.DPA.Alignment.Alignment` object.
177
181
 
@@ -185,7 +189,7 @@ def create_alignment(peakpos: Sequence[Sequence[Peak]], expr_code: List[str], si
185
189
  """
186
190
 
187
191
  alignment = Alignment(None)
188
- alignment.peakpos = [list(p) for p in peakpos]
192
+ alignment.peakpos = [list(p) for p in peakpos] # type: ignore[arg-type]
189
193
  alignment.peakalgt = numpy.transpose(alignment.peakpos).tolist() # type: ignore[arg-type]
190
194
  alignment.expr_code = expr_code
191
195
  alignment.similarity = similarity
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: libgunshotmatch
3
- Version: 0.11.0
3
+ Version: 0.11.1
4
4
  Summary: Base library for GunShotMatch.
5
5
  Author-email: Dominic Davis-Foster <dominic@davis-foster.co.uk>
6
6
  License: MIT
@@ -135,7 +135,7 @@ libgunshotmatch
135
135
  .. |language| image:: https://img.shields.io/github/languages/top/GunShotMatch/libgunshotmatch
136
136
  :alt: GitHub top language
137
137
 
138
- .. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.11.0
138
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/GunShotMatch/libgunshotmatch/v0.11.1
139
139
  :target: https://github.com/GunShotMatch/libgunshotmatch/pulse
140
140
  :alt: GitHub commits since tagged version
141
141
 
@@ -2,21 +2,21 @@ libgunshotmatch/comparison/__init__.py,sha256=g-KDfzG-oyRf2aeXlMaJJ3aWfQtQkr5-bG
2
2
  libgunshotmatch/comparison/_utils.py,sha256=aZ6fnFM4M_vTsKq5t79V4tfven1eVdG4EUCuYFuXMVs,1895
3
3
  libgunshotmatch/comparison/projects.py,sha256=Dq294cDndmQI2FnIcVXwleCQF0mF2m8U5wWnO5_aD9A,3356
4
4
  libgunshotmatch/comparison/unknowns.py,sha256=kvJJDtfpMp-c3hjCOz7YtvuuDR0YksWmyUuaSBC_5Jg,2710
5
- libgunshotmatch/consolidate/__init__.py,sha256=ezF2MwUykNSzB5s3X8HiPohTef_kS4gXtRBKG1p6zwc,24567
5
+ libgunshotmatch/consolidate/__init__.py,sha256=qjY5meI2TMCpMGwzLSo4NZ4HbhH8VJoR1t9ev4ObBmA,24706
6
6
  libgunshotmatch/consolidate/_fields.py,sha256=0kfPXJ0EG7GhdFiNzvcmd6W4i1x6Y0s2Y58z3RltPiA,2759
7
7
  libgunshotmatch/consolidate/_spectra.py,sha256=24aDoPwGWEyIFCH-fwRa4nifNMPqUyd-qTogk3BMeLY,2319
8
8
  libgunshotmatch/method/__init__.py,sha256=TP_3rvv3WEbV6Y5E_QWd2lcORPFnbXV4YRKGwXDa4ds,9423
9
9
  libgunshotmatch/method/_fields.py,sha256=HBFl0XmHBaAOHYdABs2NRbjtngGEw7kY0xP6D2Fl7h4,4941
10
- libgunshotmatch/__init__.py,sha256=OXM6TubGh5_DlwFy9SnXURf9fzbaz9cy-gNRZIAhimw,1434
10
+ libgunshotmatch/__init__.py,sha256=RYV-3nDk5ruAuFXDnZuk5LbiFM_503YfSuKwtGTdddk,1434
11
11
  libgunshotmatch/datafile.py,sha256=4C4BiR95PBfIUbiUKQzVfh57tgZu_l6rLS8bIgrgPUs,16246
12
12
  libgunshotmatch/gzip_util.py,sha256=PcfT4QC4TM0KI3uCGetRpjChbTXTGmNEJBr7BghO3i8,2414
13
- libgunshotmatch/peak.py,sha256=qe3-y0EsA37W2qMlMVruEOFRRxSG7NVWDcd8TvjZaqY,17546
14
- libgunshotmatch/project.py,sha256=ch8v8egvcULjYk7_40KywgM-_j3mf2tvRTzAsIC6Kp0,6904
13
+ libgunshotmatch/peak.py,sha256=jIbuOTj_FWTeb46pZtzSwnGsMK_c71Dd9_T9Gj2DxNk,17616
14
+ libgunshotmatch/project.py,sha256=498xoKkDSFDsFodwoRwwEfRL-FOX_hnzyDLLgPNxWr0,6987
15
15
  libgunshotmatch/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  libgunshotmatch/search.py,sha256=GMP7_DMnXFq3TG8AT1WARIn4ObCfOGfTDakpGeKzJYw,3123
17
- libgunshotmatch/utils.py,sha256=8wrdSk1ZWIgIu6eN9QEDF23goxN7z2VszxcDYZZ8ov0,5729
18
- libgunshotmatch-0.11.0.dist-info/LICENSE,sha256=bFtJt-lyVJHV-88FeFa_r3BEOsmpna5qG2KOl9JUNfU,1064
19
- libgunshotmatch-0.11.0.dist-info/METADATA,sha256=8TbC-eZngXagQbCQ_G5iStuzriCjYSvGD5umtsxjkAo,6394
20
- libgunshotmatch-0.11.0.dist-info/WHEEL,sha256=pUf8gZsdmDXXTtqZfolZFpfoEwFoEdADIuUvQVl5qAY,83
21
- libgunshotmatch-0.11.0.dist-info/entry_points.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- libgunshotmatch-0.11.0.dist-info/RECORD,,
17
+ libgunshotmatch/utils.py,sha256=7WVJPd9wNBFFoAFqh2J6Lsu7BGrGksW32ZqpH7ZIL_I,5776
18
+ libgunshotmatch-0.11.1.dist-info/LICENSE,sha256=bFtJt-lyVJHV-88FeFa_r3BEOsmpna5qG2KOl9JUNfU,1064
19
+ libgunshotmatch-0.11.1.dist-info/METADATA,sha256=X6IRaQ7QLl3ugK51lSmpa205f0Ds1QmbVICEaFucBtw,6394
20
+ libgunshotmatch-0.11.1.dist-info/WHEEL,sha256=pUf8gZsdmDXXTtqZfolZFpfoEwFoEdADIuUvQVl5qAY,83
21
+ libgunshotmatch-0.11.1.dist-info/entry_points.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
+ libgunshotmatch-0.11.1.dist-info/RECORD,,