Passed
Push — main ( 9813db...5006f2 )
by Douglas
01:43
created

mandos.entries._entry_utils   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 26
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A EntryUtils.split() 0 3 1
A EntryUtils.get_flags() 0 3 1
A EntryUtils.get_trial_statuses() 0 3 1
A EntryUtils.get_target_types() 0 3 1
A EntryUtils.get_taxa() 0 4 1
1
from typing import Set, Sequence
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
3
from mandos.model.settings import MANDOS_SETTINGS
4
from mandos.model.apis.chembl_support.chembl_activity import DataValidityComment
5
from mandos.model.apis.chembl_support.chembl_targets import TargetType
6
from mandos.model.apis.pubchem_support.pubchem_models import ClinicalTrialsGovUtils
7
from mandos.model.taxonomy import Taxonomy
8
from mandos.model.taxonomy_caches import TaxonomyFactories
9
10
11
class EntryUtils:
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
12
    """ """
13
14
    @staticmethod
15
    def split(st: str) -> Set[str]:
0 ignored issues
show
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
16
        return {s.strip() for s in st.split(",")}
17
18
    @staticmethod
19
    def get_taxa(taxa: str) -> Sequence[Taxonomy]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
20
        factory = TaxonomyFactories.from_uniprot(MANDOS_SETTINGS.taxonomy_cache_path)
21
        return [factory.load(str(taxon).strip()) for taxon in taxa.split(",")]
22
23
    @staticmethod
24
    def get_trial_statuses(st: str) -> Set[str]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
25
        return ClinicalTrialsGovUtils.resolve_statuses(st)
26
27
    @staticmethod
28
    def get_target_types(st: str) -> Set[str]:
0 ignored issues
show
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
29
        return {s.name for s in TargetType.resolve(st)}
30
31
    @staticmethod
32
    def get_flags(st: str) -> Set[str]:
0 ignored issues
show
Coding Style Naming introduced by
Argument name "st" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
introduced by
Missing function or method docstring
Loading history...
33
        return {s.name for s in DataValidityComment.resolve(st)}
34
35
36
__all__ = ["EntryUtils"]
37