• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vantage6 / vantage6 / 13721339941

07 Mar 2025 01:06PM UTC coverage: 76.779% (-1.5%) from 78.252%
13721339941

push

github

web-flow
Merge pull request #1799 from vantage6/release/4.10

Release/4.10

61 of 115 new or added lines in 22 files covered. (53.04%)

1 existing line in 1 file now uncovered.

1521 of 1981 relevant lines covered (76.78%)

0.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.08
/vantage6/vantage6/cli/context/algorithm_store.py
1
from __future__ import annotations
1✔
2

3
from vantage6.common.globals import APPNAME, InstanceType
1✔
4
from vantage6.cli.configuration_manager import ServerConfigurationManager
1✔
5
from vantage6.cli.globals import (
1✔
6
    DEFAULT_SERVER_SYSTEM_FOLDERS as S_FOL,
7
    ServerType,
8
    AlgoStoreGlobals,
9
)
10
from vantage6.cli._version import __version__
1✔
11
from vantage6.cli.context.base_server import BaseServerContext
1✔
12

13

14
class AlgorithmStoreContext(BaseServerContext):
1✔
15
    """
1✔
16
    A context class for the algorithm store server.
17

18
    Parameters
19
    ----------
20
    instance_name : str
21
        Name of the configuration instance, corresponds to the filename
22
        of the configuration file.
23
    system_folders : bool, optional
24
        System wide or user configuration, by default S_FOL
25
    """
26

27
    INST_CONFIG_MANAGER = ServerConfigurationManager
1✔
28

29
    def __init__(self, instance_name: str, system_folders: bool = S_FOL):
1✔
30
        super().__init__(
×
31
            InstanceType.ALGORITHM_STORE, instance_name, system_folders=system_folders
32
        )
33
        self.log.info("vantage6 version '%s'", __version__)
×
34

35
    def get_database_uri(self) -> str:
1✔
36
        """
37
        Obtain the database uri from the environment or the configuration.
38

39
        Returns
40
        -------
41
        str
42
            string representation of the database uri
43
        """
44
        return super().get_database_uri(AlgoStoreGlobals.DB_URI_ENV_VAR)
×
45

46
    @property
1✔
47
    def docker_container_name(self) -> str:
1✔
48
        """
49
        Name of the docker container that the server is running in.
50

51
        Returns
52
        -------
53
        str
54
            Server's docker container name
55
        """
NEW
56
        return f"{APPNAME}-{self.name}-{self.scope}-{ServerType.ALGORITHM_STORE.value}"
×
57

58
    @classmethod
1✔
59
    def from_external_config_file(
1✔
60
        cls, path: str, system_folders: bool = S_FOL
61
    ) -> AlgorithmStoreContext:
62
        """
63
        Create a server context from an external configuration file. External
64
        means that the configuration file is not located in the default folders
65
        but its location is specified by the user.
66

67
        Parameters
68
        ----------
69
        path : str
70
            Path of the configuration file
71
        system_folders : bool, optional
72
            System wide or user configuration, by default S_FOL
73

74
        Returns
75
        -------
76
        AlgorithmStoreContext
77
            Server context object
78
        """
79
        return super().from_external_config_file(
×
80
            path,
81
            ServerType.ALGORITHM_STORE,
82
            AlgoStoreGlobals.CONFIG_NAME_ENV_VAR,
83
            system_folders,
84
        )
85

86
    @classmethod
1✔
87
    def config_exists(cls, instance_name: str, system_folders: bool = S_FOL) -> bool:
1✔
88
        """
89
        Check if a configuration file exists.
90

91
        Parameters
92
        ----------
93
        instance_name : str
94
            Name of the configuration instance, corresponds to the filename
95
            of the configuration file.
96
        system_folders : bool, optional
97
            System wide or user configuration, by default S_FOL
98

99
        Returns
100
        -------
101
        bool
102
            Whether the configuration file exists or not
103
        """
104
        return super().config_exists(
×
105
            InstanceType.ALGORITHM_STORE, instance_name, system_folders
106
        )
107

108
    @classmethod
1✔
109
    def available_configurations(
1✔
110
        cls, system_folders: bool = S_FOL
111
    ) -> tuple[list, list]:
112
        """
113
        Find all available server configurations in the default folders.
114

115
        Parameters
116
        ----------
117
        system_folders : bool, optional
118
            System wide or user configuration, by default S_FOL
119

120
        Returns
121
        -------
122
        tuple[list, list]
123
            The first list contains validated configuration files, the second
124
            list contains invalid configuration files.
125
        """
126
        return super().available_configurations(
×
127
            InstanceType.ALGORITHM_STORE, system_folders
128
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc