From 61b069128eda03190b9ab5a7467d2db5402d71fc Mon Sep 17 00:00:00 2001 From: Patrick Kunzmann Date: Mon, 8 Jun 2020 16:41:44 +0200 Subject: [PATCH] Fix docstrings for commands --- src/ammolite/object.py | 120 ++++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 48 deletions(-) diff --git a/src/ammolite/object.py b/src/ammolite/object.py index b2d884d..3bad1b8 100644 --- a/src/ammolite/object.py +++ b/src/ammolite/object.py @@ -363,8 +363,9 @@ def alter(self, selection, expression): Parameters ---------- - selection : str or ndarray, dtype=bool - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. expression : str @@ -396,8 +397,9 @@ def cartoon(self, type, selection=None): - ``'arrow'`` or - ``'dumbbell'``. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -416,8 +418,9 @@ def center(self, selection=None, state=None, origin=True): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -452,8 +455,9 @@ def clip(self, mode, distance, selection=None, state=None): distance : float The meaning of this parameter depends on `mode`. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -479,8 +483,9 @@ def color(self, color, selection=None): color : str or tuple(float, float, float) Either a *PyMOL* color name or a tuple containing an RGB value (0.0 to 1.0). - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -514,8 +519,9 @@ def desaturate(self, selection=None, a=0.5): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -535,8 +541,9 @@ def disable(self, selection=None): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -557,8 +564,9 @@ def distance(self, name, selection1, selection2, cutoff=None, mode=None, ---------- name : str Name of the distance object to create. - selection1, selection2 : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection1, selection2 : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. cutoff : float, optional @@ -600,8 +608,9 @@ def dss(self, selection=None, state=None): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -624,8 +633,9 @@ def enable(self, selection=None): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -661,8 +671,9 @@ def hide(self, representation, selection=None): - ``'slice'`` or - ``'cell'``. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -680,8 +691,9 @@ def indicate(self, selection=None): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -699,8 +711,9 @@ def label(self, selection, text): Parameters ---------- - selection : str or ndarray, dtype=bool - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. text : str @@ -719,8 +732,9 @@ def orient(self, selection=None, state=None): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -743,8 +757,9 @@ def origin(self, selection=None, state=None): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -771,8 +786,9 @@ def select(self, name, selection=None): ---------- name : str Name of the selection object to create. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -806,8 +822,9 @@ def set(self, name, value, selection=None, state=None): value : object The new value for the given setting name. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -845,8 +862,9 @@ def set_bond(self, name, value, selection1=None, selection2=None, value : object The new value for the given setting name. - selection1, selection2 : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection1, selection2 : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, `selection1` applies to all atoms of this @@ -893,8 +911,9 @@ def show(self, representation, selection=None): - ``'slice'`` or - ``'cell'``. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -931,8 +950,9 @@ def show_as(self, representation, selection=None): - ``'slice'`` or - ``'cell'``. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -951,8 +971,9 @@ def smooth(self, selection=None, passes=1, window=5, Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -998,8 +1019,9 @@ def unset(self, name, selection=None, state=None): - ``'transparency'`` (for surfaces) or - ``'sphere_transparency'``. - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this @@ -1034,8 +1056,9 @@ def unset_bond(self, name, selection1=None, selection2=None, state=None): - ``'stick_color'`` or - ``'stick_transparency'``. - selection1, selection2 : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection1, selection2 : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, `selection1` applies to all atoms of this @@ -1065,8 +1088,9 @@ def zoom(self, selection=None, buffer=0.0, state=None, complete=False): Parameters ---------- - selection : str or ndarray, dtype=bool, optional - A boolean mask or a *PyMOL* selection expression that + selection : str or int or slice or ndarray, dtype=bool or ndarray, dtype=int, optional + A *Biotite* compatible atom selection index, + e.g. a boolean mask, or a *PyMOL* selection expression that selects the atoms of this *PyMOL* object to apply the command on. By default, the command is applied on all atoms of this