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.
cs-kit
pip install cs-kit
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
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
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"}]}}
py.test cs-config
cs-config/install.sh
conda install your-project
$ csk-token --username myuser --password mypass
Token: your-token-here
py.test cs_kit -v