Passed
Push — main ( 65730f...fad324 )
by Douglas
06:54 queued 02:27
created

mandos.model.utils.globals   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 28
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 0
1
import os
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
from pathlib import Path
3
4
from chembl_webresource_client.settings import Settings as ChemblSettings
0 ignored issues
show
introduced by
Unable to import 'chembl_webresource_client.settings'
Loading history...
5
from pocketutils.tools.common_tools import CommonTools
0 ignored issues
show
introduced by
Unable to import 'pocketutils.tools.common_tools'
Loading history...
6
from suretime import Suretime
0 ignored issues
show
introduced by
Unable to import 'suretime'
Loading history...
7
8
9
class Globals:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
10
    cellular_taxon = 131567
11
    viral_taxon = 10239
12
    vertebrata = 7742
13
    start_time = Suretime.tagged.now_utc_sys().dt
14
    start_time_local = start_time.astimezone()
15
    start_timestamp = start_time.isoformat(timespec="milliseconds")
16
    start_timestamp_filesys = start_time_local.strftime("%Y-%m-%d_%H-%M-%S")
17
    chembl_settings = ChemblSettings.Instance()
18
    cwd = os.getcwd()
19
    where_am_i_installed = Path(__file__).parent.parent.parent
20
    is_in_ci = CommonTools.parse_bool(os.environ.get("IS_IN_CI", "false"))
21
    if is_in_ci:
22
        mandos_path = Path(__file__).parent.parent.parent / "tests" / "resources" / ".mandos-cache"
23
    else:
24
        _default_mandos_home = Path.home() / ".mandos"
25
        env_vars = {k.lower(): v for k, v in os.environ.items()}
26
        mandos_path = Path(env_vars.get("MANDOS_HOME", _default_mandos_home))
27
    settings_path = mandos_path / "settings.toml"
28
    disable_chembl = CommonTools.parse_bool(os.environ.get("MANDOS_NO_CHEMBL", "false"))
29
    disable_pubchem = CommonTools.parse_bool(os.environ.get("MANDOS_NO_PUBCHEM", "false"))
30
    is_cli: bool = False
31