diff --git a/CHANGELOG.md b/CHANGELOG.md index faa356c..977c6ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.5.5] - 2026-06-05 +### Fixed + +- `io.pepxml`: Fix a `TypeError` when none of the standard search engine scores are found and the fallback (`score_keys[0]`) is accessed (fixes #150) + ### Changed - Pin version bounds for all core dependencies. Most notably, `pyteomics` is now constrained to `< 5` to avoid breaking changes introduced in the upcoming major release. diff --git a/psm_utils/io/pepxml.py b/psm_utils/io/pepxml.py index af81400..325bca1 100644 --- a/psm_utils/io/pepxml.py +++ b/psm_utils/io/pepxml.py @@ -75,7 +75,7 @@ def _infer_score_name(self) -> str | None: for spectrum_query in reader: if "search_hit" not in spectrum_query: continue - score_keys = spectrum_query["search_hit"][0]["search_score"].keys() + score_keys = list(spectrum_query["search_hit"][0]["search_score"].keys()) break else: score_keys = []