Commit a1f47fb7 authored by eric pellegrini's avatar eric pellegrini
Browse files

docstringed new set of configurators

parent a3a8b1e5
......@@ -52,10 +52,9 @@ class ProjectionConfigurator(IConfigurator):
:param configuration: the current configuration.
:type configuration: a MDANSE.Framework.Configurable.Configurable object
:param value: the input projector definition. It must be a 2-tuple whose 1st element if the name of the projector (one of 'null','axial' or 'planar')
and the 2nd element the parameters for hte selected projector (None for 'null', a Scientific.Vector for 'axial' and a list of two Scientific.Vector for
'planar').
a list of file formats.
:param value: the input projector definition. It can be a 2-tuple whose 1st element if the name of the projector (one of 'null','axial' or 'planar')
and the 2nd element the parameters for the selected projector (None for 'null', a Scientific.Vector for 'axial' and a list of two Scientific.Vector for
'planar') or None in the case where no projection is needed.
:type value: 2-tuple
'''
......
......@@ -27,7 +27,7 @@
'''
Created on Mar 30, 2015
@author: pellegrini
@author: Eric C. Pellegrini
'''
from MDANSE import REGISTRY
......@@ -36,7 +36,21 @@ from MDANSE.Framework.Configurators.IConfigurator import IConfigurator, Configur
class QVectorsConfigurator(IConfigurator):
"""
This Configurator allows to set reciprocal vectors for a given system.
This Configurator allows to set reciprocal vectors.
Reciprocal vectors are used in MDANSE for the analysis related to scattering experiments such as dynamic coherent structure
or elastic incoherent structure factor analysis. In MDANSE, properties that depends on Q vectors are always scalar regarding
Q vectors in the sense that the values of these properties will be computed for a given norm of Q vectors and not for a given Q vectors.
Hence, the Q vectors generator supported by MDANSE always generates Q vectors on Q-shells, each shell containing a set of Q vectors whose
norm match the Q shell value within a given tolerance.
Depending on the generator selected, Q vectors can be generated isotropically or anistropically, on a lattice or randomly.
Q vectors can be saved to a user definition and, as such, can be further reused in another MDANSE session.
To define a new Q vectors generator, you must inherit from MDANSE.Framework.QVectors.QVectors.QVector interface.
:note: this configurator depends on 'trajectory' configurator to be configured
"""
type = "q_vectors"
......@@ -44,6 +58,15 @@ class QVectorsConfigurator(IConfigurator):
_default = ("spherical_lattice",{"shells":(0,5,0.1), "width" : 0.1, "n_vectors" : 50})
def configure(self, configuration, value):
'''
Configure a Q vectors generator.
:param configuration: the current configuration.
:type configuration: a MDANSE.Framework.Configurable.Configurable object
:param value: the Q vectors generator definition. It can be a 2-tuple, whose 1st element is the name of the Q vector generator
and 2nd element the parameters for this configurator or a string that matches a Q vectors user definition.
:type value: 2-tuple or str
'''
trajConfig = configuration[self._dependencies['trajectory']]
......@@ -74,6 +97,12 @@ class QVectorsConfigurator(IConfigurator):
self["value"] = self["q_vectors"]
def get_information(self):
'''
Returns string information about this configurator.
:return: the information about this configurator.
:rtype: str
'''
info = ["%d Q shells generated\n" % self["n_shells"]]
for (qValue,qVectors) in self["q_vectors"].items():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment