Skip to main content

Bridge for Stactics AICore

Project description

corebridge

This package provides functions and classes to run wodan style processing functions in the Stactics AICore environment.

Installation

Use

pip install corebridge

to install corebrdige.

How to use

Introduction

Wodan is a proprietary backend service that applies high performance, custom analytical processing to timeseries data in the Whysor data and dashboarding environment.

Each wodan module defines one function that operates as the entry point. The parameter annotations in this function definition are used to format data and retrieve parameters from the originating call to the wodan api. This function is called with data retrieved according to a specification and with additional parameters as annotated.

A simple function might look like:

import numpy as np

def multiply(data:np.ndarray, multiplier:float=1.0):
    return data * multiplier
    

Wodan binds this function to a service endpoint and takes care of fetching data and parameters and converting the result for the caller.

AICore modules

For AICore users define a class, always named Module with a constructor __init__ and a method infer.

This package defines a baseclass to quickly construct a custom Module class that is able to use a wodan processor function inside the AICore system:

import numpy as np
import corebridge

def multiply(data:np.ndarray, multiplier:float=1.0):
    return data * multiplier

class Module(corebridge.aicorebridge.AICoreModule):
    def __init__(self, save_dir, assets_dir, *args, **kwargs):
        super().__init__(multiply, save_dir, assets_dir, *args, **kwargs)
    

That’s it. Well, you can add parameters to __init__ that can be used as hyperparameters in the web-interface and you could override infer for the same reason. The baseclass takes care of converting call parameters and data to the function specification and, calls the function and converts the result for the caller, similar to the original Wodan service.

Development

Setup a virtual environment, activate it and install the development package and dependencies with, on linux

    pip install -e ‘.\[dev\]’

or on Windows

    pip install -e .\[dev\]

nbdev cycle

  • edit
  • nbdev_export
  • nbdev_test
  • nbdev_clean
  • nbdev_readme
  • nbdev_prepare
  • git add .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corebridge-0.2.7.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

corebridge-0.2.7-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page