Giter Site home page Giter Site logo

fagan2888 / compute-studio-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from compute-tooling/compute-studio-kit

0.0 0.0 0.0 83 KB

Python toolkit to help developers test their models against the COMP interface

License: MIT License

Python 99.84% Shell 0.16%

compute-studio-kit's Introduction

Compute Studio Kit

cs-kit tests your model's functions against the Compute Studio criteria. If your functions pass the cs-kit tests, then you can be reasonably sure that the functions will work on compute.studio.

Compute Studio Kit also provides a helper command for retrieving your Compute Studio API token.

Install cs-kit

pip install cs-kit

Set up the cs-config directory

$ csk-init
$ tree cs-config/
cs-config/
├── cs_config
│   ├── functions.py
│   ├── __init__.py
│   └── tests
│       ├── __init__.py
│       └── test_functions.py
├── install.sh
└── setup.py

Write your functions in cs-config/cs_config/functions.py

# Write or import your Compute Studio functions here.


def get_version():
    pass


def get_inputs(meta_param_dict):
    pass


def validate_inputs(meta_param_dict, adjustment, errors_warnings):
    pass


def run_model(meta_param_dict, adjustment):
    pass

Test your functions in cs-config/cs_config/tests/test_functions.py

from cs_kit import CoreTestFunctions

from cs_config import functions


class TestFunctions1(CoreTestFunctions):
    get_version = functions.get_version
    get_inputs = functions.get_inputs
    validate_inputs = functions.validate_inputs
    run_model = functions.run_model
    ok_adjustment={"matchup": {"pitcher": [{"value": "Max Scherzer"}]}}
    bad_adjustment={"matchup": {"pitcher": [{"value": "Not a pitcher"}]}}

Run your cs-config tests

py.test cs-config

Write your installation instructions in cs-config/install.sh

conda install your-project

Get your Compute Studio API token

$ csk-token --username myuser --password mypass
Token: your-token-here

Run the compute-studio-kit tests

py.test cs_kit -v

compute-studio-kit's People

Contributors

hdoupe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.