Skip to content

Commit

Permalink
Distribution Type added
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Mittal <[email protected]>
  • Loading branch information
shashank-iitbhu committed Jul 8, 2024
1 parent 154a85b commit 53db4e3
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 7 deletions.
17 changes: 14 additions & 3 deletions pkg/apis/controller/experiments/v1beta1/experiment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ const (
)

type ParameterSpec struct {
Name string `json:"name,omitempty"`
ParameterType ParameterType `json:"parameterType,omitempty"`
FeasibleSpace FeasibleSpace `json:"feasibleSpace,omitempty"`
Name string `json:"name,omitempty"`
ParameterType ParameterType `json:"parameterType,omitempty"`
DistributionType DistributionType `json:"distributionType,omitempty"`
FeasibleSpace FeasibleSpace `json:"feasibleSpace,omitempty"`
}

type ParameterType string
Expand All @@ -206,6 +207,16 @@ const (
ParameterTypeCategorical ParameterType = "categorical"
)

type DistributionType string

const (
DistributionTypeUniform DistributionType = "uniform"
DistributionTypeLogUniform DistributionType = "logUniform"
DistributionTypeNormal DistributionType = "normal"
DistributionTypeLogNormal DistributionType = "logNormal"
DistributionTypeCategorical DistributionType = "categorical"
)

type FeasibleSpace struct {
Max string `json:"max,omitempty"`
Min string `json:"min,omitempty"`
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 @@ -1009,6 +1009,9 @@
"v1beta1.ParameterSpec": {
"type": "object",
"properties": {
"distributionType": {
"type": "string"
},
"feasibleSpace": {
"default": {},
"$ref": "#/definitions/v1beta1.FeasibleSpace"
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/V1beta1ParameterSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**distribution_type** | **str** | | [optional]
**feasible_space** | [**V1beta1FeasibleSpace**](V1beta1FeasibleSpace.md) | | [optional]
**name** | **str** | | [optional]
**parameter_type** | **str** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,61 @@ class V1beta1ParameterSpec(object):
and the value is json key in definition.
"""
openapi_types = {
'distribution_type': 'str',
'feasible_space': 'V1beta1FeasibleSpace',
'name': 'str',
'parameter_type': 'str'
}

attribute_map = {
'distribution_type': 'distributionType',
'feasible_space': 'feasibleSpace',
'name': 'name',
'parameter_type': 'parameterType'
}

def __init__(self, feasible_space=None, name=None, parameter_type=None, local_vars_configuration=None): # noqa: E501
def __init__(self, distribution_type=None, feasible_space=None, name=None, parameter_type=None, local_vars_configuration=None): # noqa: E501
"""V1beta1ParameterSpec - 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_type = None
self._feasible_space = None
self._name = None
self._parameter_type = None
self.discriminator = None

if distribution_type is not None:
self.distribution_type = distribution_type
if feasible_space is not None:
self.feasible_space = feasible_space
if name is not None:
self.name = name
if parameter_type is not None:
self.parameter_type = parameter_type

@property
def distribution_type(self):
"""Gets the distribution_type of this V1beta1ParameterSpec. # noqa: E501
:return: The distribution_type of this V1beta1ParameterSpec. # noqa: E501
:rtype: str
"""
return self._distribution_type

@distribution_type.setter
def distribution_type(self, distribution_type):
"""Sets the distribution_type of this V1beta1ParameterSpec.
:param distribution_type: The distribution_type of this V1beta1ParameterSpec. # noqa: E501
:type: str
"""

self._distribution_type = distribution_type

@property
def feasible_space(self):
"""Gets the feasible_space of this V1beta1ParameterSpec. # noqa: E501
Expand Down

0 comments on commit 53db4e3

Please sign in to comment.