Skip to content

Commit

Permalink
Merge pull request #21 from wfondrie/rm_print
Browse files Browse the repository at this point in the history
Check for debugging print statements
  • Loading branch information
Will Fondrie authored Mar 12, 2021
2 parents 50431f1 + 569074f commit d56f69a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Run black
uses: psf/black@stable

- name: Check for debugging print statements
run: |
if grep -rq "print(" mokapot; then
echo "Found the following print statements:"
grep -r "print(" mokapot
exit 1
fi
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog for mokapot

## [0.6.2] - 2021-03-12
### Added
- Now checks to verify there are no debugging print statements in the code
base when linting.

### Fixed
- Removed debugging print statements.

## [0.6.1] - 2021-03-11
### Fixed
- Parsing Percolator tab-delimited files with a "DefaultDirection" line.
Expand Down
1 change: 0 additions & 1 deletion mokapot/confidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ def _assign_confidence(self, desc=True):
scores[targets], scores[~targets], includeDecoys=True
)
except SystemExit as msg:
print(msg)
if "no decoy hits available for PEP calculation" in str(msg):
pep = 0
else:
Expand Down
3 changes: 0 additions & 3 deletions mokapot/parsers/pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ def read_pin(pin_files, group_column=None, to_df=False, copy_data=False):
raise ValueError(f"More than one '{name}' column found.")

if not all([specid, peptides, proteins, labels, spectra]):
print([specid, peptides, proteins, labels, spectra])
raise ValueError(
"This PIN format is incompatible with mokapot. Please"
" verify that the required columns are present."
)

# Convert labels to the correct format.
print(pin_df[labels[0]])
pin_df[labels[0]] = pin_df[labels[0]].astype(int)
if any(pin_df[labels[0]] == -1):
pin_df[labels[0]] = ((pin_df[labels[0]] + 1) / 2).astype(bool)
Expand Down Expand Up @@ -148,7 +146,6 @@ def read_percolator(perc_file):

psms = pd.concat((c for c in _parse_in_chunks(perc, cols)), copy=False)

print(psms.head())
return psms


Expand Down

0 comments on commit d56f69a

Please sign in to comment.