-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improving type hints and usage of abc (#259)
* add PathLike for input files * add PathLike for input directory * add import of annotations * fix bug in unit tests * annotate defaults with type Final * add type alias * change type var to type alias * remove literal type hints * remove unused type var * replace typing deprecated classes with those from collections.abc * change registering to inheritance of abstract class Registering as virtual class can avoid metclass conflicts. However, it's not an issue we need to worry in this codebase, since all concrete classes, e.g. AntismashBGCLoader, inherit only one base class instead of multiple classes that have different metaclasses. Using inheritance of abstract class is more straightforward and explict. * simplify imports * add type hints for **kwarg * add overloaded type hints to fix mkdocs warning * remove base class from package level * rename logging.py to logger.py to avoid name conflict * fix bug of logger name * move NPLINKER_APP_DATA_DIR to defaults to avoid partial initialisation
- Loading branch information
1 parent
bedebde
commit 6c78c20
Showing
23 changed files
with
166 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
STRAIN_MAPPINGS_FILENAME = "strain_mappings.json" | ||
GENOME_BGC_MAPPINGS_FILENAME = "genome_bgc_mappings.json" | ||
GENOME_STATUS_FILENAME = "genome_status.json" | ||
GNPS_SPECTRA_FILENAME = "spectra.mgf" | ||
GNPS_MOLECULAR_FAMILY_FILENAME = "molecular_families.tsv" | ||
GNPS_ANNOTATIONS_FILENAME = "annotations.tsv" | ||
GNPS_FILE_MAPPINGS_TSV = "file_mappings.tsv" | ||
GNPS_FILE_MAPPINGS_CSV = "file_mappings.csv" | ||
STRAINS_SELECTED_FILENAME = "strains_selected.json" | ||
from pathlib import Path | ||
from typing import Final | ||
|
||
|
||
DOWNLOADS_DIRNAME = "downloads" | ||
MIBIG_DIRNAME = "mibig" | ||
GNPS_DIRNAME = "gnps" | ||
ANTISMASH_DIRNAME = "antismash" | ||
BIGSCAPE_DIRNAME = "bigscape" | ||
BIGSCAPE_RUNNING_OUTPUT_DIRNAME = "bigscape_running_output" | ||
OUTPUT_DIRNAME = "output" | ||
# The path to the NPLinker application database directory | ||
NPLINKER_APP_DATA_DIR: Final = Path(__file__).parent / "data" | ||
|
||
|
||
STRAIN_MAPPINGS_FILENAME: Final = "strain_mappings.json" | ||
GENOME_BGC_MAPPINGS_FILENAME: Final = "genome_bgc_mappings.json" | ||
GENOME_STATUS_FILENAME: Final = "genome_status.json" | ||
GNPS_SPECTRA_FILENAME: Final = "spectra.mgf" | ||
GNPS_MOLECULAR_FAMILY_FILENAME: Final = "molecular_families.tsv" | ||
GNPS_ANNOTATIONS_FILENAME: Final = "annotations.tsv" | ||
GNPS_FILE_MAPPINGS_TSV: Final = "file_mappings.tsv" | ||
GNPS_FILE_MAPPINGS_CSV: Final = "file_mappings.csv" | ||
STRAINS_SELECTED_FILENAME: Final = "strains_selected.json" | ||
|
||
|
||
DOWNLOADS_DIRNAME: Final = "downloads" | ||
MIBIG_DIRNAME: Final = "mibig" | ||
GNPS_DIRNAME: Final = "gnps" | ||
ANTISMASH_DIRNAME: Final = "antismash" | ||
BIGSCAPE_DIRNAME: Final = "bigscape" | ||
BIGSCAPE_RUNNING_OUTPUT_DIRNAME: Final = "bigscape_running_output" | ||
OUTPUT_DIRNAME: Final = "output" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.