Class: Ml::Candidate
Constant Summary
collapse
- PACKAGE_PREFIX =
'candidate_'
AtomicInternalId::MissingValueError
ApplicationRecord::MAX_PLUCK
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
ResetOnColumnErrors::MAX_RESET_PERIOD
Class Method Summary
collapse
Instance Method Summary
collapse
group_init, #internal_id_read_scope, #internal_id_scope_attrs, #internal_id_scope_usage, namespace_init, project_init, scope_attrs, scope_usage
#present
===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
#sharding_organization
#reset_on_union_error, #reset_on_unknown_attribute_error
#serializable_hash
Class Method Details
.with_project_id_and_eid(project_id, eid) ⇒ Object
88
89
90
91
92
|
# File 'app/models/ml/candidate.rb', line 88
def with_project_id_and_eid(project_id, eid)
return unless project_id.present? && eid.present?
find_by(project_id: project_id, eid: eid)
end
|
.with_project_id_and_id(project_id, id) ⇒ Object
100
101
102
103
104
|
# File 'app/models/ml/candidate.rb', line 100
def with_project_id_and_id(project_id, id)
return unless project_id.present? && id.present?
find_by(project_id: project_id, id: id)
end
|
.with_project_id_and_iid(project_id, iid) ⇒ Object
94
95
96
97
98
|
# File 'app/models/ml/candidate.rb', line 94
def with_project_id_and_iid(project_id, iid)
return unless project_id.present? && iid.present?
find_by(project_id: project_id, internal_id: iid)
end
|
Instance Method Details
#artifact_root ⇒ Object
71
72
73
|
# File 'app/models/ml/candidate.rb', line 71
def artifact_root
"/#{package_name}/#{package_version}/"
end
|
#for_model? ⇒ Boolean
83
84
85
|
# File 'app/models/ml/candidate.rb', line 83
def for_model?
experiment.for_model? && !model_version_id.present?
end
|
#from_ci? ⇒ Boolean
79
80
81
|
# File 'app/models/ml/candidate.rb', line 79
def from_ci?
ci_build_id.present?
end
|
#package_version ⇒ Object
75
76
77
|
# File 'app/models/ml/candidate.rb', line 75
def package_version
package&.generic? ? iid : "#{PACKAGE_PREFIX}#{iid}"
end
|