From 049b426aec14d0b8234eda2fcd3d29bce99a08f2 Mon Sep 17 00:00:00 2001 From: Valerio Mariani <valerio.mariani@desy.de> Date: Tue, 10 Jul 2018 12:08:27 +0200 Subject: [PATCH] Updated docstrings --- cfelpyutils/__init__.py | 6 +++--- cfelpyutils/crystfel_utils.py | 5 +++-- cfelpyutils/geometry_utils.py | 5 +++-- cfelpyutils/parameter_utils.py | 16 +++++++++------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/cfelpyutils/__init__.py b/cfelpyutils/__init__.py index a6eda16..e7ed0c0 100644 --- a/cfelpyutils/__init__.py +++ b/cfelpyutils/__init__.py @@ -20,13 +20,13 @@ and classes used by many projects developed at the Center For Free Electron Laser Science (CFEL) in Hamburg. (`Link CFEL: https://www.cfel.de`) -The 'crystfel_utils' submodule contains python implementations of +The 'crystfel_utils' submodule contains the python implementation of some functions from the CrystFEL software package. (`Link CrystFEL http://www.desy.de/~twhite/crystfel/`) The 'geometry_utils' submodule contains the implementation of functions used to manipulate detector geometry information. -The 'parameter utils' submodule contains the implementation of -functions used to manipulate detector geometry information. +This 'parameter_utils' module contains the implementation of functions +that are used to parse and manipulate options and parameters. """ diff --git a/cfelpyutils/crystfel_utils.py b/cfelpyutils/crystfel_utils.py index 6356610..c218c42 100644 --- a/cfelpyutils/crystfel_utils.py +++ b/cfelpyutils/crystfel_utils.py @@ -15,8 +15,9 @@ """ CryystFEL utilities. -This module contains the implementation of several functions used to -interact with CrystFEL files and data (geometry files, stream files). +This module contains the python implementation of some functions from +the CrystFEL software package. +(`Link CrystFEL http://www.desy.de/~twhite/crystfel/`) """ from __future__ import (absolute_import, division, print_function, unicode_literals) diff --git a/cfelpyutils/geometry_utils.py b/cfelpyutils/geometry_utils.py index c280f73..dd44cde 100644 --- a/cfelpyutils/geometry_utils.py +++ b/cfelpyutils/geometry_utils.py @@ -16,7 +16,8 @@ Geometry utilities. This module contains the implementation of several functions used to -manipulate geometry information.""" +manipulate geometry information. +""" from __future__ import (absolute_import, division, print_function, unicode_literals) @@ -173,7 +174,7 @@ def compute_visualization_pix_maps(geometry): Args: - geometry (dict): A CrystFEL geometry object (A dictionary + geometry (Dict): A CrystFEL geometry object (A dictionary returned by the :obj:`cfelpyutils.crystfel_utils.load_crystfel_geometry` function). diff --git a/cfelpyutils/parameter_utils.py b/cfelpyutils/parameter_utils.py index dd5a039..5ce1481 100644 --- a/cfelpyutils/parameter_utils.py +++ b/cfelpyutils/parameter_utils.py @@ -15,8 +15,9 @@ """ Parameter parsing utilities. -This module contains the implementation of several utilities used -to parse and manipulate dictionaries that store options and parameters. +This 'parameter_utils' module contains the implementation of functions +that are used to parse and manipulate options and parameters, as +extracted by the python :obj:`configparse` module. """ from __future__ import (absolute_import, division, print_function, unicode_literals) @@ -38,9 +39,9 @@ def convert_parameters(config_dict): """ Convert strings in parameter dictionaries to the correct data type. - Convert a dictionary return by the configparse module to a - dictionar contaning the same parameters converted from string to - their correct type (int, float, string, etc.) + Convert a dictionary extracted by the configparse module to a + dictionary contaning the same parameters converted from strings to + correct types (int, float, string, etc.) Try to convert each entry in the dictionary according to the following rules. The first rule that applies to the entry @@ -69,8 +70,9 @@ def convert_parameters(config_dict): Args: - config (Dict): a dictionary containing strings (the dictionary - returned by Config Parser). + config (Dict[str]): a dictionary containing the parameters from + a configuration file as extracted by the + :obj:`configparser` module). Returns: -- GitLab