How to use the oasislmf.__version__ function in oasislmf

To help you get started, we’ve selected a few oasislmf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OasisLMF / OasisPlatform / src / model_execution_worker / tasks.py View on Github external
def get_worker_versions():
    """ Search and return the versions of Oasis components 
    """
    ktool_ver_str = subprocess.getoutput('fmcalc -v')
    plat_ver_file = '/home/worker/VERSION'

    if os.path.isfile(plat_ver_file):
        with open(plat_ver_file, 'r') as f:
            plat_ver_str = f.read().strip()    
    else:
        plat_ver_str = ""

    return {"worker_verisons": {
        "oasislmf": mdk_version,
        "ktools": ktool_ver_str,
        "platform": plat_ver_str
    }}
github OasisLMF / OasisPlatform / src / server / oasisapi / oed_info / views.py View on Github external
def get(self, request):
        peril_codes = {PERILS[p]['id']: {'desc': PERILS[p]['desc']} for p in PERILS.keys()}
        peril_groups = {
            PERIL_GROUPS[g]['id']: {
                'desc': PERIL_GROUPS[g]['desc'],
                'peril_ids': PERIL_GROUPS[g]['peril_ids']
            } for g in PERIL_GROUPS.keys()
        }

        return Response({
            'oasislmf_version': oasislmf_package_ver,
            'peril_codes': peril_codes,
            'peril_groups': peril_groups
        })