Skip to content

Commit

Permalink
[GSoC] Added DistributionType to Experiment API (#2377)
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Mittal <[email protected]>

modified feasibleSpace

Removed Categorical from Distribution
  • Loading branch information
shashank-iitbhu authored Jul 31, 2024
1 parent 9a8c9d4 commit 6a17c3e
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 9 deletions.
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

0 comments on commit 6a17c3e

Please sign in to comment.