Skip to content

Commit

Permalink
Merge pull request #6 from not-a-feature/dev
Browse files Browse the repository at this point in the history
Black code formatting
  • Loading branch information
not-a-feature authored Mar 11, 2022
2 parents 34c3676 + ce4bac9 commit 7037ffd
Show file tree
Hide file tree
Showing 10 changed files with 3,168 additions and 507 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Black Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "-l 100"
32 changes: 0 additions & 32 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ Any information relevant to third-party vendors listed below are collected using

## Dependencies

### [flake8 (4.0.1)](https://gitlab.com/pycqa/flake8)

#### Declared Licenses
MIT

### Package Info

**Package Homepage**: https://gitlab.com/pycqa/flake8

**Package Download URL**: https://files.pythonhosted.org/packages/34/39/cde2c8a227abb4f9ce62fe55586b920f438f1d2903a1a22514d0b982c333/flake8-4.0.1-py2.py3-none-any.whl

**Dependency Paths**: flake8

---

### [mypy (0.930)](http://www.mypy-lang.org/)

#### Declared Licenses
Expand All @@ -30,11 +15,6 @@ MIT *OR* Python-2.0
### Package Info

**Package Homepage**: http://www.mypy-lang.org/

**Package Download URL**: https://files.pythonhosted.org/packages/c0/5c/12591c72af2774dfe08a58cad3b814eb79809297dfc92aae8588a7b22fd7/mypy-0.930-cp310-cp310-macosx_10_9_x86_64.whl

**Dependency Paths**: mypy

---

### [pytest (7.0.0rc1)](http://pytest.org)
Expand All @@ -45,10 +25,6 @@ MIT *OR* Python-2.0

**Package Homepage**: http://pytest.org

**Package Download URL**: https://files.pythonhosted.org/packages/5b/19/90bb3215fd679ead2a93f606e46044d5999eed7271434305c1da60653e1f/pytest-7.0.0rc1-py3-none-any.whl

**Dependency Paths**: pytest

---

### [pytest-cov (3.0.0)](https://github.com/pytest-dev/pytest-cov)
Expand All @@ -60,10 +36,6 @@ MIT

**Package Homepage**: https://github.com/pytest-dev/pytest-cov

**Package Download URL**: https://files.pythonhosted.org/packages/20/49/b3e0edec68d81846f519c602ac38af9db86e1e71275528b3e814ae236063/pytest_cov-3.0.0-py3-none-any.whl

**Dependency Paths**: pytest-cov

---

### [tox (4.0.0a9)](https://tox.readthedocs.org/)
Expand All @@ -74,7 +46,3 @@ MIT
### Package Info

**Package Homepage**: https://tox.readthedocs.org/

**Package Download URL**: https://files.pythonhosted.org/packages/9e/1d/62707decc7690dafc1e1ffff6a02ab41ee3806a21ac2e1ca28082c5aed22/tox-4.0.0a9-py3-none-any.whl

**Dependency Paths**: tox
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ A small module for easy access to BLOSUM matrices without dependencies.
![Test Badge](https://github.com/not-a-feature/blosum/actions/workflows/tests.yml/badge.svg)
![Python Version Badge](https://img.shields.io/pypi/pyversions/blosum)
![Download Badge](https://img.shields.io/pypi/dm/blosum.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

The BLOcks SUbstitution Matrices (BLOSUM) are used to score alignments between protein sequences and are therefore mainly used in bioinformatics.

Expand Down Expand Up @@ -79,7 +80,7 @@ matrix = bl.BLOSUM(62, default=0)

## License
```
Copyright (C) 2021 by Jules Kreuer - @not_a_feature
Copyright (C) 2022 by Jules Kreuer - @not_a_feature
This piece of software is published unter the GNU General Public License v3.0
TLDR:
Expand Down
1 change: 0 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
flake8>=3.9
pytest>=6.2
pytest-cov>=2.12
mypy>=0.910
Expand Down
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = blosum
version = 1.1.2
version = 1.1.3
description = A simple BLOSUM toolbox without dependencies.
long_description = file: README.md
long_description_content_type=text/markdown
Expand Down Expand Up @@ -28,14 +28,10 @@ zip_safe = no
testing =
pytest>=6.0
pytest-cov>=2.0
flake8>=3.9
tox>=3.20

[options.package_data]
frameshift_aware_alignment = py.typed

[flake8]
max-line-length = 120

[pytest]
xfail_strict=true
1 change: 1 addition & 0 deletions src/blosum/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ._blosum import BLOSUM

__all__ = [
"BLOSUM",
]
10 changes: 5 additions & 5 deletions src/blosum/_blosum.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ._data import default_blosum


class BLOSUM():
class BLOSUM:
def __init__(self, n, default: float = float("-inf")):
"""
Object to easily access a blosum matrix.
Expand Down Expand Up @@ -40,7 +40,7 @@ def __init__(self, n, default: float = float("-inf")):
# load custom matrix
self.__loadMatrix(n)
else:
raise(BaseException("Can't initate empty BLOSUM Object"))
raise (BaseException("Can't initate empty BLOSUM Object"))

def __loadMatrix(self, path: str) -> None:
"""
Expand Down Expand Up @@ -89,7 +89,7 @@ def __loadMatrix(self, path: str) -> None:
blosumDict[f"{linelist[0]}{lab}"] = float(linelist[index])

# Check quadratic
if not len(blosumDict) == len(labelslist)**2:
if not len(blosumDict) == len(labelslist) ** 2:
raise EOFError("Blosum file is not quadratic.")
self.matrix = blosumDict

Expand Down Expand Up @@ -120,7 +120,7 @@ def __str__(self) -> str:
"""
Magic method to allow BLOSUM object printing.
"""
return f'BLOSUM {self.n}\n{self.matrix}'
return f"BLOSUM {self.n}\n{self.matrix}"

def __repr__(self) -> str:
"""
Expand All @@ -132,4 +132,4 @@ def __repr__(self) -> str:
n = self.n
else:
n = f'"{self.n}"'
return f'BLOSUM({n}, default={d})'
return f"BLOSUM({n}, default={d})"
Loading

0 comments on commit 7037ffd

Please sign in to comment.