Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSoC] Added DistributionType to Experiment API #2377

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions pkg/apis/controller/experiments/v1beta1/experiment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,22 @@ const (
)

type FeasibleSpace struct {
Max string `json:"max,omitempty"`
Min string `json:"min,omitempty"`
List []string `json:"list,omitempty"`
Step string `json:"step,omitempty"`
Max string `json:"max,omitempty"`
Min string `json:"min,omitempty"`
List []string `json:"list,omitempty"`
Step string `json:"step,omitempty"`
Distribution Distribution `json:"distribution,omitempty"`
}

type Distribution string

const (
DistributionUniform Distribution = "uniform"
DistributionLogUniform Distribution = "logUniform"
DistributionNormal Distribution = "normal"
DistributionLogNormal Distribution = "logNormal"
)

// TrialTemplate describes structure of trial template
type TrialTemplate struct {
// Retain indicates that trial resources must be not cleanup
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/v1beta1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/apis/v1beta1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,9 @@
"v1beta1.FeasibleSpace": {
"type": "object",
"properties": {
"distribution": {
"type": "string"
},
"list": {
"type": "array",
"items": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/python/v1beta1/docs/V1beta1FeasibleSpace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**distribution** | **str** | | [optional]
**list** | **list[str]** | | [optional]
**max** | **str** | | [optional]
**min** | **str** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,36 @@ class V1beta1FeasibleSpace(object):
and the value is json key in definition.
"""
openapi_types = {
'distribution': 'str',
'list': 'list[str]',
'max': 'str',
'min': 'str',
'step': 'str'
}

attribute_map = {
'distribution': 'distribution',
'list': 'list',
'max': 'max',
'min': 'min',
'step': 'step'
}

def __init__(self, list=None, max=None, min=None, step=None, local_vars_configuration=None): # noqa: E501
def __init__(self, distribution=None, list=None, max=None, min=None, step=None, local_vars_configuration=None): # noqa: E501
"""V1beta1FeasibleSpace - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._distribution = None
self._list = None
self._max = None
self._min = None
self._step = None
self.discriminator = None

if distribution is not None:
self.distribution = distribution
if list is not None:
self.list = list
if max is not None:
Expand All @@ -67,6 +72,27 @@ def __init__(self, list=None, max=None, min=None, step=None, local_vars_configur
if step is not None:
self.step = step

@property
def distribution(self):
"""Gets the distribution of this V1beta1FeasibleSpace. # noqa: E501


:return: The distribution of this V1beta1FeasibleSpace. # noqa: E501
:rtype: str
"""
return self._distribution

@distribution.setter
def distribution(self, distribution):
"""Sets the distribution of this V1beta1FeasibleSpace.


:param distribution: The distribution of this V1beta1FeasibleSpace. # noqa: E501
:type: str
"""

self._distribution = distribution

@property
def list(self):
"""Gets the list of this V1beta1FeasibleSpace. # noqa: E501
Expand Down
Loading