opsml.cards.project

 1# Copyright (c) Shipt, Inc.
 2# This source code is licensed under the MIT license found in the
 3# LICENSE file in the root directory of this source tree.
 4
 5#
 6# IMPORTANT: We need `Dict`, `List`, and `Optional` imported here in order for Pydantic to be able to
 7# deserialize ProjectCard.
 8#
 9from typing import Any, Dict, List, Optional  # noqa # pylint: disable=unused-import
10
11from opsml.cards.base import ArtifactCard
12from opsml.types import CardType
13
14
15class ProjectCard(ArtifactCard):
16    """
17    Card containing project information
18    """
19
20    project_id: int = 0  # placeholder
21
22    def create_registry_record(self) -> Dict[str, Any]:
23        """Creates a registry record for a project"""
24
25        return self.model_dump()
26
27    @property
28    def card_type(self) -> str:
29        return CardType.PROJECTCARD.value
class ProjectCard(opsml.cards.base.ArtifactCard):
16class ProjectCard(ArtifactCard):
17    """
18    Card containing project information
19    """
20
21    project_id: int = 0  # placeholder
22
23    def create_registry_record(self) -> Dict[str, Any]:
24        """Creates a registry record for a project"""
25
26        return self.model_dump()
27
28    @property
29    def card_type(self) -> str:
30        return CardType.PROJECTCARD.value

Card containing project information

project_id: int
def create_registry_record(self) -> Dict[str, Any]:
23    def create_registry_record(self) -> Dict[str, Any]:
24        """Creates a registry record for a project"""
25
26        return self.model_dump()

Creates a registry record for a project

card_type: str
28    @property
29    def card_type(self) -> str:
30        return CardType.PROJECTCARD.value
model_config = {'arbitrary_types_allowed': True, 'validate_assignment': False, 'validate_default': True}
model_fields = {'name': FieldInfo(annotation=str, required=False, default='undefined'), 'repository': FieldInfo(annotation=str, required=False, default='undefined'), 'contact': FieldInfo(annotation=str, required=False, default='undefined'), 'version': FieldInfo(annotation=str, required=False, default='0.0.0'), 'uid': FieldInfo(annotation=Union[str, NoneType], required=False), 'info': FieldInfo(annotation=Union[CardInfo, NoneType], required=False), 'tags': FieldInfo(annotation=Dict[str, str], required=False, default={}), 'project_id': FieldInfo(annotation=int, required=False, default=0)}
model_computed_fields = {}
Inherited Members
pydantic.main.BaseModel
BaseModel
model_extra
model_fields_set
model_construct
model_copy
model_dump
model_dump_json
model_json_schema
model_parametrized_name
model_post_init
model_rebuild
model_validate
model_validate_json
model_validate_strings
dict
json
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs
opsml.cards.base.ArtifactCard
name
repository
contact
version
uid
info
tags
validate_args
add_tag
uri
artifact_uri