Skip to content

Commit

Permalink
Apply suggestions from code review ♻️
Browse files Browse the repository at this point in the history
♻️

Co-authored-by: Ralf Gabriels <[email protected]>
  • Loading branch information
ArthurDeclercq and RalfG authored Apr 10, 2024
1 parent b144d5f commit 1999039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions ms2rescore/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,8 @@ def _fill_missing_precursor_info(psm_list, config):
get_missing_values(psm_list, config, rt_required=rt_required, im_required=im_required)

# Check if values are now present
for value_name, required in zip(
["retention_time", "ion_mobility"], [rt_required, im_required]
):
if not required:
continue
if (
for value_name, required in [("retention_time", rt_required), ("ion_mobility", im_required)]):

Check failure on line 178 in ms2rescore/core.py

View workflow job for this annotation

GitHub Actions / test-python-package (3.8)

Ruff (E999)

ms2rescore/core.py:178:97: E999 SyntaxError: Expected '":"', but got ')'

Check failure on line 178 in ms2rescore/core.py

View workflow job for this annotation

GitHub Actions / test-python-package (3.10)

Ruff (E999)

ms2rescore/core.py:178:97: E999 SyntaxError: Expected '":"', but got ')'

Check failure on line 178 in ms2rescore/core.py

View workflow job for this annotation

GitHub Actions / test-python-package (3.11)

Ruff (E999)

ms2rescore/core.py:178:97: E999 SyntaxError: Expected '":"', but got ')'
if required and (
0.0 in psm_list[value_name]
or None in psm_list[value_name]
or np.isnan(psm_list[value_name]).any()
Expand Down
3 changes: 1 addition & 2 deletions ms2rescore/report/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,12 @@ def _get_stats_context(confidence_before, confidence_after):
if not before or not after:
continue
increase = (after - before) / before * 100
diff = after - before
stats.append(
{
"item": level_name,
"card_color": card_color,
"number": after,
"diff": f"({diff:+})",
"diff": f"({after - before:+})",
"percentage": f"{increase:.1f}%",
"is_increase": increase > 0,
"bar_percentage": before / after * 100 if increase > 0 else after / before * 100,
Expand Down

0 comments on commit 1999039

Please sign in to comment.