Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
misialq committed Sep 6, 2023
1 parent cc08fcc commit 6b008c0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
14 changes: 8 additions & 6 deletions q2_types_genomics/kaiju/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ def _validate_n_records(self, n=None):
if not line[0].isnumeric() or not line[1].isnumeric():
raise ValidationError(
"NCBI taxonomy nodes file must contain a numeric "
"taxonomy ID in the first two columns, found non-numeric "
f"value on line {i + 1}."
"taxonomy ID in the first two columns, found "
f"non-numeric value on line {i + 1}."
)
for col in (5, 7, 9, 10, 11):
if not line[col].isnumeric() or not int(line[col]) in (0, 1):
if not line[col].isnumeric() or \
not int(line[col]) in (0, 1):
raise ValidationError(
"NCBI taxonomy nodes file must contain 0 or 1 in columns "
"6, 8, 10, 11, and 12, found a non-allowed value on line "
f"{i + 1}, column {col + 1}: {line[col]}."
"NCBI taxonomy nodes file must contain 0 or 1 "
"in columns 6, 8, 10, 11, and 12, found a "
f"non-allowed value on line {i + 1}, column "
f"{col + 1}: {line[col]}."
)

def _validate_(self, level):
Expand Down
5 changes: 3 additions & 2 deletions q2_types_genomics/kaiju/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
from q2_types.sample_data import SampleData
from qiime2.plugin import SemanticType

from . import KaijuDBDirectoryFormat
Expand All @@ -16,4 +15,6 @@

plugin.register_semantic_types(KaijuDB)

plugin.register_semantic_type_to_format(KaijuDB, artifact_format=KaijuDBDirectoryFormat)
plugin.register_semantic_type_to_format(
KaijuDB, artifact_format=KaijuDBDirectoryFormat
)
4 changes: 3 additions & 1 deletion q2_types_genomics/kaiju/tests/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def test_kaijudb_semantic_type_registration(self):
self.assertRegisteredSemanticType(KaijuDB)

def test_kaijudb_semantic_type_to_format_registration(self):
self.assertSemanticTypeRegisteredToFormat(KaijuDB, KaijuDBDirectoryFormat)
self.assertSemanticTypeRegisteredToFormat(
KaijuDB, KaijuDBDirectoryFormat
)


if __name__ == "__main__":
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
license="BSD-3-Clause",
url="https://github.com/bokulich-lab/q2-types-genomics",
entry_points={
"qiime2.plugins": ["q2-types-genomics=q2_types_genomics.plugin_setup:plugin"]
"qiime2.plugins": [
"q2-types-genomics=q2_types_genomics.plugin_setup:plugin"
]
},
package_data={
'q2_types_genomics': ['citations.bib'],
Expand Down

0 comments on commit 6b008c0

Please sign in to comment.