@@ -217,9 +217,9 @@ class SimpleRemoteProxy(SimpleBaseProxy):
217217 ['toto']
218218 >>> proxy.get_object_from_title("toto")
219219 <cdlclient.model.signal.SignalObj at 0x7f7f1c0b4a90>
220- >>> proxy.get_object(0 )
220+ >>> proxy.get_object(1 )
221221 <cdlclient.model.signal.SignalObj at 0x7f7f1c0b4a90>
222- >>> proxy.get_object(0 ).data
222+ >>> proxy.get_object(1 ).data
223223 array([1., 2., 3.])
224224 """
225225
@@ -382,92 +382,43 @@ def calc(self, name: str, param: gds.DataSet | None = None) -> gds.DataSet:
382382 return self ._cdl .calc (name )
383383 return self ._cdl .calc (name , dataset_to_json (param ))
384384
385- def get_object_from_title (
386- self , title : str , panel : str | None = None
387- ) -> SignalObj | ImageObj :
388- """Get object (signal/image) from title
389-
390- Args:
391- title (str): object
392- panel (str | None): panel name (valid values: "signal", "image").
393- If None, current panel is used.
394-
395- Returns:
396- Union[SignalObj, ImageObj]: object
397-
398- Raises:
399- ValueError: if object not found
400- ValueError: if panel not found
401- """
402- param_data = self ._cdl .get_object_from_title (title , panel )
403- return json_to_dataset (param_data )
404-
405385 def get_object (
406386 self ,
407- index : int | None = None ,
408- group_index : int | None = None ,
387+ nb_id_title : int | str | None = None ,
409388 panel : str | None = None ,
410389 ) -> SignalObj | ImageObj :
411390 """Get object (signal/image) from index.
412391
413392 Args:
414- index (int): Object index in current panel. Defaults to None.
415- group_index (int | None): Group index. Defaults to None.
416- panel (str | None): Panel name. Defaults to None.
417-
418- If ``index`` is not specified, returns the currently selected object.
419- If ``group_index`` is not specified, return an object from the current group.
420- If ``panel`` is not specified, return an object from the current panel.
393+ nb_id_title: Object number, or object id, or object title.
394+ Defaults to None (current object).
395+ panel: Panel name. Defaults to None (current panel).
421396
422397 Returns:
423- Union[SignalObj, ImageObj]: object
398+ Object
424399
425400 Raises:
426- IndexError : if object not found
401+ KeyError : if object not found
427402 """
428- param_data = self ._cdl .get_object (index , group_index , panel )
429- return json_to_dataset (param_data )
430-
431- def get_object_from_uuid (
432- self , oid : str , panel : str | None = None
433- ) -> SignalObj | ImageObj :
434- """Get object (signal/image) from uuid
435-
436- Args:
437- oid (str): object uuid
438- panel (str | None): panel name (valid values: "signal", "image").
439-
440- Returns:
441- Union[SignalObj, ImageObj]: object
442-
443- Raises:
444- ValueError: if object not found
445- ValueError: if panel not found
446- """
447- param_data = self ._cdl .get_object_from_uuid (oid , panel )
403+ param_data = self ._cdl .get_object (nb_id_title , panel )
448404 return json_to_dataset (param_data )
449405
450406 def get_object_shapes (
451407 self ,
452- index : int | None = None ,
453- group_index : int | None = None ,
408+ nb_id_title : int | str | None = None ,
454409 panel : str | None = None ,
455410 ) -> list :
456411 """Get plot item shapes associated to object (signal/image).
457412
458413 Args:
459- index: Object index in current panel. Defaults to None.
460- group_index: Group index. Defaults to None.
461- panel: Panel name. Defaults to None.
462-
463- If ``index`` is not specified, returns the currently selected object.
464- If ``group_index`` is not specified, return an object from the current group.
465- If ``panel`` is not specified, return an object from the current panel.
414+ nb_id_title: Object number, or object id, or object title.
415+ Defaults to None (current object).
416+ panel: Panel name. Defaults to None (current panel).
466417
467418 Returns:
468419 List of plot item shapes
469420 """
470- items_json = self ._cdl .get_object_shapes (index , group_index , panel )
421+ items_json = self ._cdl .get_object_shapes (nb_id_title , panel )
471422 return json_to_items (items_json )
472423
473424 def add_annotations_from_items (
0 commit comments