# SPDX-License-Identifier: MIT
# Copyright (c) 2001-{{ COPYRIGHT_END_YEAR }} JCMwave GmbH
"""Installation and runtime info entrypoint for `jcmsuite`."""
from __future__ import annotations
from ..context import SolverContext, resolve_context
from ..context.models import JCMInfoDetails
[docs]
def info(
*,
context: SolverContext | None = None,
print: bool = True,
verbose: bool = False,
) -> JCMInfoDetails:
"""Return installation, system, and license information.
Parameters
----------
context : SolverContext | None, optional
JCMsuite settings to use. If omitted, use the active context or the
default context.
print : bool, optional
If `True`, show the information in the terminal.
verbose : bool, optional
If `True`, also show the interface build time and Git commit
identifier.
Returns
-------
JCMInfoDetails
Installation, computer, interface, and license information.
Raises
------
RuntimeContextError
If JCMsuite is not configured or `JCMsolve` is not available.
RuntimeError
If called from asynchronous code before context startup is complete.
"""
resolved_context: SolverContext = resolve_context(context)
return resolved_context.info(print=print, verbose=verbose)