-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
352 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[style] | ||
BASED_ON_STYLE = pep8 | ||
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true | ||
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include requirements/*.txt | ||
recursive-include openbioseq/.mim/tools *.sh *.py |
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,3 +1,60 @@ | ||
from .version import __version__, short_version | ||
import warnings | ||
|
||
__all__ = ['__version__', 'short_version'] | ||
import mmcv | ||
from packaging.version import parse | ||
|
||
from .version import __version__ | ||
|
||
|
||
def digit_version(version_str: str, length: int = 4): | ||
"""Convert a version string into a tuple of integers. | ||
This method is usually used for comparing two versions. For pre-release | ||
versions: alpha < beta < rc. | ||
Args: | ||
version_str (str): The version string. | ||
length (int): The maximum number of version levels. Default: 4. | ||
Returns: | ||
tuple[int]: The version info in digits (integers). | ||
""" | ||
version = parse(version_str) | ||
assert version.release, f'failed to parse version {version_str}' | ||
release = list(version.release) | ||
release = release[:length] | ||
if len(release) < length: | ||
release = release + [0] * (length - len(release)) | ||
if version.is_prerelease: | ||
mapping = {'a': -3, 'b': -2, 'rc': -1} | ||
val = -4 | ||
# version.pre can be None | ||
if version.pre: | ||
if version.pre[0] not in mapping: | ||
warnings.warn(f'unknown prerelease version {version.pre[0]}, ' | ||
'version checking may go wrong') | ||
else: | ||
val = mapping[version.pre[0]] | ||
release.extend([val, version.pre[-1]]) | ||
else: | ||
release.extend([val, 0]) | ||
|
||
elif version.is_postrelease: | ||
release.extend([1, version.post]) | ||
else: | ||
release.extend([0, 0]) | ||
return tuple(release) | ||
|
||
|
||
mmcv_minimum_version = '1.4.2' | ||
mmcv_maximum_version = '1.7.0' | ||
mmcv_version = digit_version(mmcv.__version__) | ||
|
||
|
||
assert (mmcv_version >= digit_version(mmcv_minimum_version) | ||
and mmcv_version <= digit_version(mmcv_maximum_version)), \ | ||
f'MMCV=={mmcv.__version__} is used but incompatible. ' \ | ||
f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.' | ||
|
||
|
||
__all__ = ['__version__', 'digit_version'] |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) CAIRI AI Lab. All rights reserved | ||
|
||
__version__ = '0.1.1' | ||
|
||
def parse_version_info(version_str): | ||
"""Parse a version string into a tuple. | ||
Args: | ||
version_str (str): The version string. | ||
Returns: | ||
tuple[int | str]: The version info, e.g., "1.3.0" is parsed into | ||
(1, 3, 0), and "2.0.0rc1" is parsed into (2, 0, 0, 'rc1'). | ||
""" | ||
version_info = [] | ||
for x in version_str.split('.'): | ||
if x.isdigit(): | ||
version_info.append(int(x)) | ||
elif x.find('rc') != -1: | ||
patch_version = x.split('rc') | ||
version_info.append(int(patch_version[0])) | ||
version_info.append(f'rc{patch_version[1]}') | ||
return tuple(version_info) | ||
|
||
|
||
version_info = parse_version_info(__version__) | ||
|
||
__all__ = ['__version__', 'version_info', 'parse_version_info'] |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mmcls >= 0.21.0 | ||
mmcv-full>=1.4.7 | ||
mmdet >= 2.16.0 | ||
mmsegmentation >= 0.20.2 |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[bdist_wheel] | ||
universal=1 | ||
|
||
[aliases] | ||
test=pytest | ||
|
||
[yapf] | ||
based_on_style = pep8 | ||
blank_line_before_nested_class_or_def = true | ||
split_before_expression_after_opening_paren = true | ||
|
||
[isort] | ||
line_length = 79 | ||
multi_line_output = 0 | ||
extra_standard_library = setuptools | ||
known_first_party = OpenBioSeq | ||
known_third_party = PIL,detectron2,faiss,matplotlib,mmcls,mmcv,mmdet,mmseg,numpy,packaging,pytest,pytorch_sphinx_theme,scipy,seaborn,six,sklearn,svm_helper,timm,torch,torchvision,tqdm | ||
no_lines_before = STDLIB,LOCALFOLDER | ||
default_section = THIRDPARTY | ||
|
||
[codespell] | ||
skip = *.ipynb | ||
quiet-level = 3 | ||
ignore-words-list = patten,confectionary,nd,ty,formating,dows |
Oops, something went wrong.