@@ -755,7 +755,7 @@ def reconnect(self, run_id: str) -> bool:
755
755
Returns
756
756
-------
757
757
bool
758
- _description_
758
+ whether reconnection succeeded
759
759
"""
760
760
if self ._mode == "disabled" :
761
761
return True
@@ -842,10 +842,18 @@ def config(
842
842
@check_run_initialised
843
843
@pydantic .validate_call
844
844
def update_metadata (self , metadata : dict [str , typing .Any ]) -> bool :
845
- """
846
- Add/update metadata
847
- """
845
+ """Update metadata for this run
848
846
847
+ Parameters
848
+ ----------
849
+ metadata : dict[str, typing.Any]
850
+ set run metadata
851
+
852
+ Returns
853
+ -------
854
+ bool
855
+ if the update was successful
856
+ """
849
857
if self ._mode == "disabled" :
850
858
return True
851
859
@@ -868,8 +876,17 @@ def update_metadata(self, metadata: dict[str, typing.Any]) -> bool:
868
876
@check_run_initialised
869
877
@pydantic .validate_call
870
878
def update_tags (self , tags : list [str ]) -> bool :
871
- """
872
- Add/update tags
879
+ """Update tags for this run
880
+
881
+ Parameters
882
+ ----------
883
+ tags : list[str]
884
+ new set of tags to assign
885
+
886
+ Returns
887
+ -------
888
+ bool
889
+ whether the update was successful
873
890
"""
874
891
if self ._mode == "disabled" :
875
892
return True
@@ -888,9 +905,20 @@ def update_tags(self, tags: list[str]) -> bool:
888
905
@skip_if_failed ("_aborted" , "_suppress_errors" , False )
889
906
@check_run_initialised
890
907
@pydantic .validate_call
891
- def log_event (self , message , timestamp : typing .Optional [str ] = None ) -> bool :
892
- """
893
- Write event
908
+ def log_event (self , message : str , timestamp : typing .Optional [str ] = None ) -> bool :
909
+ """Log event to the server
910
+
911
+ Parameters
912
+ ----------
913
+ message : str
914
+ event message to log
915
+ timestamp : str, optional
916
+ manually specify the time stamp for this log, by default None
917
+
918
+ Returns
919
+ -------
920
+ bool
921
+ whether event log was successful
894
922
"""
895
923
if self ._mode == "disabled" :
896
924
self ._error ("Cannot log events in 'disabled' state" )
@@ -970,8 +998,23 @@ def log_metrics(
970
998
time : typing .Optional [int ] = None ,
971
999
timestamp : typing .Optional [str ] = None ,
972
1000
) -> bool :
973
- """
974
- Write metrics
1001
+ """Log metrics to Simvue server
1002
+
1003
+ Parameters
1004
+ ----------
1005
+ metrics : dict[str, typing.Union[int, float]]
1006
+ set of metrics to upload to server for this run
1007
+ step : int, optional
1008
+ manually specify the step index for this log, by default None
1009
+ time : int, optional
1010
+ manually specify the time for this log, by default None
1011
+ timestamp : str, optional
1012
+ manually specify the timestamp for this log, by default None
1013
+
1014
+ Returns
1015
+ -------
1016
+ bool
1017
+ if the metric log was succcessful
975
1018
"""
976
1019
add_dispatch = self ._add_metrics_to_dispatch (
977
1020
metrics , step = step , time = time , timestamp = timestamp
@@ -1129,8 +1172,23 @@ def save_directory(
1129
1172
filetype : typing .Optional [str ] = None ,
1130
1173
preserve_path : bool = False ,
1131
1174
) -> bool :
1132
- """
1133
- Upload a whole directory
1175
+ """Upload files from a whole directory
1176
+
1177
+ Parameters
1178
+ ----------
1179
+ directory : pydantic.DirectoryPath
1180
+ the directory to save to the run
1181
+ category : Literal[['output', 'input', 'code']
1182
+ the category to assign to the saved objects within this directory
1183
+ filetype : str, optional
1184
+ manually specify the MIME type for items in the directory, by default None
1185
+ preserve_path : bool, optional
1186
+ preserve the full path, by default False
1187
+
1188
+ Returns
1189
+ -------
1190
+ bool
1191
+ if the directory save was successful
1134
1192
"""
1135
1193
if self ._mode == "disabled" :
1136
1194
return True
@@ -1166,8 +1224,23 @@ def save_all(
1166
1224
filetype : typing .Optional [str ] = None ,
1167
1225
preserve_path : bool = False ,
1168
1226
) -> bool :
1169
- """
1170
- Save the list of files and/or directories
1227
+ """Save a set of files and directories
1228
+
1229
+ Parameters
1230
+ ----------
1231
+ items : list[pydantic.FilePath | pydantic.DirectoryPath]
1232
+ list of file paths and directories to save
1233
+ category : Literal['input', 'output', 'code']
1234
+ the category to assign to the saved objects
1235
+ filetype : str, optional
1236
+ manually specify the MIME type for all items, by default None
1237
+ preserve_path : bool, optional
1238
+ _preserve the full path, by default False
1239
+
1240
+ Returns
1241
+ -------
1242
+ bool
1243
+ whether the save was successful
1171
1244
"""
1172
1245
success : bool = True
1173
1246
@@ -1194,7 +1267,13 @@ def set_status(
1194
1267
self , status : typing .Literal ["completed" , "failed" , "terminated" ]
1195
1268
) -> bool :
1196
1269
"""Set run status
1197
- status to assign to this run
1270
+
1271
+ status to assign to this run
1272
+
1273
+ Parameters
1274
+ ----------
1275
+ status : Literal['completed', 'failed', 'terminated']
1276
+ status to set the run to
1198
1277
1199
1278
Returns
1200
1279
-------
@@ -1221,7 +1300,13 @@ def set_status(
1221
1300
1222
1301
@skip_if_failed ("_aborted" , "_suppress_errors" , False )
1223
1302
def close (self ) -> bool :
1224
- """Close the run"""
1303
+ """Close the run
1304
+
1305
+ Returns
1306
+ -------
1307
+ bool
1308
+ whether close was successful
1309
+ """
1225
1310
self ._executor .wait_for_completion ()
1226
1311
if self ._mode == "disabled" :
1227
1312
return True
0 commit comments