store_session
MLTE artifact store interface session implementation.
ArtifactMapper
Bases: ResourceMapper
An interface for mapping CRUD actions to artifacts.
Source code in mlte/store/artifact/store_session.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
write_artifact(model_id, version_id, artifact, *, force=False)
Write an artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
The identifier for the model |
required |
version_id
|
str
|
The identifier for the model version |
required |
artifact
|
ArtifactModel
|
The artifact |
required |
force
|
bool
|
Overwrite an artifact if it already exists for artifact should be implictly created (default: False) |
False
|
Source code in mlte/store/artifact/store_session.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
write_artifact_with_header(model_id, version_id, artifact, *, force=False, user=None)
Write an artifact, generating the timestamp and adding creator. Internally calls the actual write_artifact implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
The identifier for the model |
required |
version_id
|
str
|
The identifier for the model version |
required |
artifact
|
ArtifactModel
|
The artifact |
required |
force
|
bool
|
Overwrite an artifact if it already exists for artifact should be implictly created (default: False) |
False
|
user
|
Optional[str]
|
The username of the user executing this action. |
None
|
Source code in mlte/store/artifact/store_session.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
ArtifactStoreSession
Bases: StoreSession
The base class for all implementations of the MLTE artifact store session.
Source code in mlte/store/artifact/store_session.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
artifact_mapper
instance-attribute
Mapper for the artifact resource.
model_mapper
instance-attribute
Mapper for the model resource.
version_mapper
instance-attribute
Mapper for the version resource.
create_parents(model_id, version_id)
Create organizational elements within this store. If they exist, this operation is a noop.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
The model identifier |
required |
version_id
|
str
|
The version identifier |
required |
Source code in mlte/store/artifact/store_session.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
ManagedArtifactSession
Bases: ManagedSession
A simple context manager for store sessions.
Source code in mlte/store/artifact/store_session.py
43 44 45 46 47 | |
ModelMapper
Bases: ResourceMapper
An interface for mapping CRUD actions to models.
Source code in mlte/store/artifact/store_session.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
VersionMapper
Bases: ResourceMapper
An interface for mapping CRUD actions to versions.
Source code in mlte/store/artifact/store_session.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |