From 6b008c08928736f90db4f620535db22db71b0adc Mon Sep 17 00:00:00 2001 From: Michal Ziemski Date: Wed, 6 Sep 2023 16:30:06 +0200 Subject: [PATCH] Linting --- q2_types_genomics/kaiju/_format.py | 14 ++++++++------ q2_types_genomics/kaiju/_type.py | 5 +++-- q2_types_genomics/kaiju/tests/test_type.py | 4 +++- setup.py | 4 +++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/q2_types_genomics/kaiju/_format.py b/q2_types_genomics/kaiju/_format.py index dead660..a485d8c 100644 --- a/q2_types_genomics/kaiju/_format.py +++ b/q2_types_genomics/kaiju/_format.py @@ -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): diff --git a/q2_types_genomics/kaiju/_type.py b/q2_types_genomics/kaiju/_type.py index cb3dec1..169a023 100644 --- a/q2_types_genomics/kaiju/_type.py +++ b/q2_types_genomics/kaiju/_type.py @@ -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 @@ -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 +) diff --git a/q2_types_genomics/kaiju/tests/test_type.py b/q2_types_genomics/kaiju/tests/test_type.py index 3a0ee9b..10cf15f 100644 --- a/q2_types_genomics/kaiju/tests/test_type.py +++ b/q2_types_genomics/kaiju/tests/test_type.py @@ -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__": diff --git a/setup.py b/setup.py index 9983c25..3ff94b1 100644 --- a/setup.py +++ b/setup.py @@ -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'],