Skip to content

Commit

Permalink
feat: allow configuration to be passed into get_simulator_version_specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Feb 11, 2022
1 parent 583fa37 commit 44c4fc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion biosimulators_utils/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.159'
__version__ = '0.1.160'
10 changes: 7 additions & 3 deletions biosimulators_utils/simulator_registry/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,28 @@
"""

from ..biosimulations.utils import validate_biosimulations_api_response
from ..config import get_config
from ..config import get_config, Config # noqa: F401
import requests


__all__ = ['get_simulator_version_specs']


def get_simulator_version_specs(id):
def get_simulator_version_specs(id, config=None):
""" Get the specifications of the versions of a simulator in the BioSimulators registry
Args:
id (:obj:`str`): simulator id
config (:obj:`Config`, optional): configuration
Returns:
:obj:`list` of :obj:`dict`: specifications of the registered versions of the simulator
"""

endpoint = get_config().BIOSIMULATORS_API_ENDPOINT
if config is None:
config = get_config()

endpoint = config.BIOSIMULATORS_API_ENDPOINT
response = requests.get('{}simulators/{}'.format(endpoint, id))

try:
Expand Down

0 comments on commit 44c4fc0

Please sign in to comment.