Skip to content

Commit

Permalink
feedback: new formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
a9p committed Jun 17, 2022
1 parent 0cd662e commit da186e6
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 2 deletions.

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

7 changes: 7 additions & 0 deletions pkg/apis/controller/trials/v1beta1/zz_generated.deepcopy.go

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

32 changes: 32 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.

16 changes: 16 additions & 0 deletions pkg/apis/v1beta1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@
"$ref": "#/definitions/v1beta1.EarlyStoppingRule"
}
},
"labels": {
"description": "Suggestion label metadata to attach to Trial job",
"type": "object",
"additionalProperties": {
"type": "string",
"default": ""
}
},
"name": {
"description": "Name of the suggestion",
"type": "string"
Expand Down Expand Up @@ -303,6 +311,14 @@
"description": "Condition when trial custom resource is failed. Condition must be in GJSON format, ref https://github.com/tidwall/gjson. For example for BatchJob: status.conditions.#(type==\"Failed\")#|#(status==\"True\")#",
"type": "string"
},
"labels": {
"description": "Labels that provide additional metadata for services (e.g. Suggestions tracking)",
"type": "object",
"additionalProperties": {
"type": "string",
"default": ""
}
},
"metricsCollector": {
"description": "Describes how metrics will be collected",
"default": {},
Expand Down
1 change: 1 addition & 0 deletions sdk/python/v1beta1/docs/V1beta1TrialAssignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TrialAssignment is the assignment for one trial.
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**early_stopping_rules** | [**list[V1beta1EarlyStoppingRule]**](V1beta1EarlyStoppingRule.md) | Rules for early stopping techniques Contains rule name, value and comparison type | [optional]
**labels** | **dict(str, str)** | Suggestion label metadata to attach to Trial job | [optional]
**name** | **str** | Name of the suggestion | [optional]
**parameter_assignments** | [**list[V1beta1ParameterAssignment]**](V1beta1ParameterAssignment.md) | Suggestion results with Trial parameters | [optional]

Expand Down
1 change: 1 addition & 0 deletions sdk/python/v1beta1/docs/V1beta1TrialSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**early_stopping_rules** | [**list[V1beta1EarlyStoppingRule]**](V1beta1EarlyStoppingRule.md) | Rules for early stopping techniques. Each rule should be met to early stop Trial. | [optional]
**failure_condition** | **str** | Condition when trial custom resource is failed. Condition must be in GJSON format, ref https://github.com/tidwall/gjson. For example for BatchJob: status.conditions.#(type==\"Failed\")#|#(status==\"True\")# | [optional]
**labels** | **dict(str, str)** | Labels that provide additional metadata for services (e.g. Suggestions tracking) | [optional]
**metrics_collector** | [**V1beta1MetricsCollectorSpec**](V1beta1MetricsCollectorSpec.md) | | [optional]
**objective** | [**V1beta1ObjectiveSpec**](V1beta1ObjectiveSpec.md) | | [optional]
**parameter_assignments** | [**list[V1beta1ParameterAssignment]**](V1beta1ParameterAssignment.md) | Key-value pairs for hyperparameters and assignment values. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,34 @@ class V1beta1TrialAssignment(object):
"""
openapi_types = {
'early_stopping_rules': 'list[V1beta1EarlyStoppingRule]',
'labels': 'dict(str, str)',
'name': 'str',
'parameter_assignments': 'list[V1beta1ParameterAssignment]'
}

attribute_map = {
'early_stopping_rules': 'earlyStoppingRules',
'labels': 'labels',
'name': 'name',
'parameter_assignments': 'parameterAssignments'
}

def __init__(self, early_stopping_rules=None, name=None, parameter_assignments=None, local_vars_configuration=None): # noqa: E501
def __init__(self, early_stopping_rules=None, labels=None, name=None, parameter_assignments=None, local_vars_configuration=None): # noqa: E501
"""V1beta1TrialAssignment - 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._early_stopping_rules = None
self._labels = None
self._name = None
self._parameter_assignments = None
self.discriminator = None

if early_stopping_rules is not None:
self.early_stopping_rules = early_stopping_rules
if labels is not None:
self.labels = labels
if name is not None:
self.name = name
if parameter_assignments is not None:
Expand Down Expand Up @@ -85,6 +90,29 @@ def early_stopping_rules(self, early_stopping_rules):

self._early_stopping_rules = early_stopping_rules

@property
def labels(self):
"""Gets the labels of this V1beta1TrialAssignment. # noqa: E501
Suggestion label metadata to attach to Trial job # noqa: E501
:return: The labels of this V1beta1TrialAssignment. # noqa: E501
:rtype: dict(str, str)
"""
return self._labels

@labels.setter
def labels(self, labels):
"""Sets the labels of this V1beta1TrialAssignment.
Suggestion label metadata to attach to Trial job # noqa: E501
:param labels: The labels of this V1beta1TrialAssignment. # noqa: E501
:type: dict(str, str)
"""

self._labels = labels

@property
def name(self):
"""Gets the name of this V1beta1TrialAssignment. # noqa: E501
Expand Down
30 changes: 29 additions & 1 deletion sdk/python/v1beta1/kubeflow/katib/models/v1beta1_trial_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class V1beta1TrialSpec(object):
openapi_types = {
'early_stopping_rules': 'list[V1beta1EarlyStoppingRule]',
'failure_condition': 'str',
'labels': 'dict(str, str)',
'metrics_collector': 'V1beta1MetricsCollectorSpec',
'objective': 'V1beta1ObjectiveSpec',
'parameter_assignments': 'list[V1beta1ParameterAssignment]',
Expand All @@ -48,6 +49,7 @@ class V1beta1TrialSpec(object):
attribute_map = {
'early_stopping_rules': 'earlyStoppingRules',
'failure_condition': 'failureCondition',
'labels': 'labels',
'metrics_collector': 'metricsCollector',
'objective': 'objective',
'parameter_assignments': 'parameterAssignments',
Expand All @@ -58,14 +60,15 @@ class V1beta1TrialSpec(object):
'success_condition': 'successCondition'
}

def __init__(self, early_stopping_rules=None, failure_condition=None, metrics_collector=None, objective=None, parameter_assignments=None, primary_container_name=None, primary_pod_labels=None, retain_run=None, run_spec=None, success_condition=None, local_vars_configuration=None): # noqa: E501
def __init__(self, early_stopping_rules=None, failure_condition=None, labels=None, metrics_collector=None, objective=None, parameter_assignments=None, primary_container_name=None, primary_pod_labels=None, retain_run=None, run_spec=None, success_condition=None, local_vars_configuration=None): # noqa: E501
"""V1beta1TrialSpec - 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._early_stopping_rules = None
self._failure_condition = None
self._labels = None
self._metrics_collector = None
self._objective = None
self._parameter_assignments = None
Expand All @@ -80,6 +83,8 @@ def __init__(self, early_stopping_rules=None, failure_condition=None, metrics_co
self.early_stopping_rules = early_stopping_rules
if failure_condition is not None:
self.failure_condition = failure_condition
if labels is not None:
self.labels = labels
if metrics_collector is not None:
self.metrics_collector = metrics_collector
if objective is not None:
Expand Down Expand Up @@ -143,6 +148,29 @@ def failure_condition(self, failure_condition):

self._failure_condition = failure_condition

@property
def labels(self):
"""Gets the labels of this V1beta1TrialSpec. # noqa: E501
Labels that provide additional metadata for services (e.g. Suggestions tracking) # noqa: E501
:return: The labels of this V1beta1TrialSpec. # noqa: E501
:rtype: dict(str, str)
"""
return self._labels

@labels.setter
def labels(self, labels):
"""Sets the labels of this V1beta1TrialSpec.
Labels that provide additional metadata for services (e.g. Suggestions tracking) # noqa: E501
:param labels: The labels of this V1beta1TrialSpec. # noqa: E501
:type: dict(str, str)
"""

self._labels = labels

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

0 comments on commit da186e6

Please sign in to comment.