Skip to content

florianBachinger/SCPR-REST-Client

Repository files navigation

openapi-client

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >=3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import openapi_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import openapi_client

Getting Started

Please follow the installation procedure and then run the following:

import time
import openapi_client
from pprint import pprint
from openapi_client.api import scpr_api
from openapi_client.model.training_request import TrainingRequest
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
    host = "http://localhost"
)



# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = scpr_api.SCPRApi(api_client)
    training_request = TrainingRequest(
        x=[
            [
                3.14,
            ],
        ],
        y=[
            3.14,
        ],
        inputs=[
            "inputs_example",
        ],
        target="target_example",
        algorithm_parameters=SCPRParameters(
            model_type=SCPRModelType(0),
            degree=1,
            alpha=0,
            _lambda=3.14,
            shuffled_restarts=1,
            max_variables_in_interaction=1,
            input_variable_scaling={
                "key": DoubleRange(
                    lower_bound=3.14,
                    upper_bound=3.14,
                ),
            },
            constraints=[
                ShapeConstraint(
                    variable_name="variable_name_example",
                    order_derivative=1,
                    interval=DoubleRange(
                        lower_bound=3.14,
                        upper_bound=3.14,
                    ),
                ),
            ],
            algorithm_version=Version(
                major=1,
                minor=1,
                build=1,
                revision=1,
            ),
            max_sdp_solver_iterations=1,
            positivstellensatz_poly_degree=1,
            min_coeff_value=3.14,
        ),
    ) # TrainingRequest |  (optional)

    try:
        api_response = api_instance.train(training_request=training_request)
        pprint(api_response)
    except openapi_client.ApiException as e:
        print("Exception when calling SCPRApi->train: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
SCPRApi train POST /SCPR

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in openapi_client.apis and openapi_client.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from openapi_client.api.default_api import DefaultApi
  • from openapi_client.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import openapi_client
from openapi_client.apis import *
from openapi_client.models import *

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages