@@ -64,8 +64,8 @@ class Client:
6464 def __init__ (
6565 self ,
6666 * ,
67- server_token : typing . Optional [ pydantic .SecretStr ] = None ,
68- server_url : typing . Optional [ str ] = None ,
67+ server_token : pydantic .SecretStr | None = None ,
68+ server_url : str | None = None ,
6969 ) -> None :
7070 """Initialise an instance of the Simvue client
7171
@@ -136,7 +136,7 @@ def get_run_id_from_name(
136136
137137 @prettify_pydantic
138138 @pydantic .validate_call
139- def get_run (self , run_id : str ) -> typing . Optional [ Run ] :
139+ def get_run (self , run_id : str ) -> Run | None :
140140 """Retrieve a single run
141141
142142 Parameters
@@ -177,7 +177,7 @@ def get_run_name_from_id(self, run_id: str) -> str:
177177 @pydantic .validate_call
178178 def get_runs (
179179 self ,
180- filters : typing . Optional [ list [str ]] ,
180+ filters : list [str ] | None ,
181181 * ,
182182 system : bool = False ,
183183 metrics : bool = False ,
@@ -187,7 +187,7 @@ def get_runs(
187187 count_limit : pydantic .PositiveInt | None = 100 ,
188188 start_index : pydantic .NonNegativeInt = 0 ,
189189 show_shared : bool = False ,
190- ) -> typing . Union [ DataFrame , typing .Generator [tuple [str , Run ], None , None ], None ] :
190+ ) -> DataFrame | typing .Generator [tuple [str , Run ], None , None ] | None :
191191 """Retrieve all runs matching filters.
192192
193193 Parameters
@@ -216,7 +216,7 @@ def get_runs(
216216
217217 Returns
218218 -------
219- dict | pandas.DataFrame
219+ pandas.DataFrame | Generator[tuple[str, Run], None, None]
220220 either the JSON response from the runs request or the results in the
221221 form of a Pandas DataFrame
222222
@@ -280,7 +280,7 @@ def get_runs(
280280
281281 @prettify_pydantic
282282 @pydantic .validate_call
283- def delete_run (self , run_id : str ) -> typing . Optional [ dict ] :
283+ def delete_run (self , run_id : str ) -> dict | None :
284284 """Delete run by identifier
285285
286286 Parameters
@@ -300,7 +300,7 @@ def delete_run(self, run_id: str) -> typing.Optional[dict]:
300300 """
301301 return Run (identifier = run_id ).delete () or None
302302
303- def _get_folder_from_path (self , path : str ) -> typing . Optional [ Folder ] :
303+ def _get_folder_from_path (self , path : str ) -> Folder | None :
304304 """Retrieve folder for the specified path if found
305305
306306 Parameters
@@ -321,7 +321,7 @@ def _get_folder_from_path(self, path: str) -> typing.Optional[Folder]:
321321 except StopIteration :
322322 return None
323323
324- def _get_folder_id_from_path (self , path : str ) -> typing . Optional [ str ] :
324+ def _get_folder_id_from_path (self , path : str ) -> str | None :
325325 """Retrieve folder identifier for the specified path if found
326326
327327 Parameters
@@ -342,7 +342,7 @@ def _get_folder_id_from_path(self, path: str) -> typing.Optional[str]:
342342 @pydantic .validate_call
343343 def delete_runs (
344344 self , folder_path : typing .Annotated [str , pydantic .Field (pattern = FOLDER_REGEX )]
345- ) -> typing . Optional [ list ] :
345+ ) -> list | None :
346346 """Delete runs in a named folder
347347
348348 Parameters
@@ -374,7 +374,7 @@ def delete_folder(
374374 recursive : bool = False ,
375375 remove_runs : bool = False ,
376376 allow_missing : bool = False ,
377- ) -> typing . Optional [ list ] :
377+ ) -> list | None :
378378 """Delete a folder by name
379379
380380 Parameters
@@ -460,7 +460,7 @@ def _retrieve_artifacts_from_server(
460460
461461 @prettify_pydantic
462462 @pydantic .validate_call
463- def abort_run (self , run_id : str , reason : str ) -> typing . Union [ dict , list ] :
463+ def abort_run (self , run_id : str , reason : str ) -> dict | list :
464464 """Abort a currently active run on the server
465465
466466 Parameters
@@ -707,7 +707,7 @@ def _get_run_metrics_from_server(
707707 aggregate : bool ,
708708 max_points : int | None = None ,
709709 ) -> dict [str , typing .Any ]:
710- params : dict [str , typing . Union [ str , int , None ] ] = {
710+ params : dict [str , str | int | None ] = {
711711 "runs" : json .dumps (run_ids ),
712712 "aggregate" : aggregate ,
713713 "metrics" : json .dumps (metric_names ),
@@ -740,7 +740,7 @@ def get_metric_values(
740740 use_run_names : bool = False ,
741741 aggregate : bool = False ,
742742 max_points : pydantic .PositiveInt | None = None ,
743- ) -> typing . Union [ dict , DataFrame , None ] :
743+ ) -> dict | DataFrame | None :
744744 """Retrieve the values for a given metric across multiple runs
745745
746746 Uses filters to specify which runs should be retrieved.
@@ -828,7 +828,7 @@ def plot_metrics(
828828 metric_names : list [str ],
829829 xaxis : typing .Literal ["step" , "time" ],
830830 * ,
831- max_points : typing . Optional [ int ] = None ,
831+ max_points : int | None = None ,
832832 ) -> typing .Any :
833833 """Plt the time series values for multiple metrics/runs
834834
@@ -910,9 +910,9 @@ def get_events(
910910 self ,
911911 run_id : str ,
912912 * ,
913- message_contains : typing . Optional [ str ] = None ,
914- start_index : typing . Optional [ pydantic .NonNegativeInt ] = None ,
915- count_limit : typing . Optional [ pydantic .PositiveInt ] = None ,
913+ message_contains : str | None = None ,
914+ start_index : pydantic .NonNegativeInt | None = None ,
915+ count_limit : pydantic .PositiveInt | None = None ,
916916 ) -> list [dict [str , str ]]:
917917 """Return events for a specified run
918918
@@ -944,7 +944,7 @@ def get_events(
944944 else ""
945945 )
946946
947- params : dict [str , typing . Union [ str , int ] ] = {
947+ params : dict [str , str | int ] = {
948948 "run" : run_id ,
949949 "filters" : msg_filter ,
950950 "start" : start_index or 0 ,
@@ -970,11 +970,11 @@ def get_events(
970970 def get_alerts (
971971 self ,
972972 * ,
973- run_id : typing . Optional [ str ] = None ,
973+ run_id : str | None = None ,
974974 critical_only : bool = True ,
975975 names_only : bool = True ,
976- start_index : typing . Optional [ pydantic .NonNegativeInt ] = None ,
977- count_limit : typing . Optional [ pydantic .PositiveInt ] = None ,
976+ start_index : pydantic .NonNegativeInt | None = None ,
977+ count_limit : pydantic .PositiveInt | None = None ,
978978 ) -> list [AlertBase ] | list [str | None ]:
979979 """Retrieve alerts for a given run
980980
@@ -1018,8 +1018,8 @@ def get_alerts(
10181018 def get_tags (
10191019 self ,
10201020 * ,
1021- start_index : typing . Optional [ pydantic .NonNegativeInt ] = None ,
1022- count_limit : typing . Optional [ pydantic .PositiveInt ] = None ,
1021+ start_index : pydantic .NonNegativeInt | None = None ,
1022+ count_limit : pydantic .PositiveInt | None = None ,
10231023 ) -> typing .Generator [Tag , None , None ]:
10241024 """Retrieve tags
10251025
0 commit comments