Exemplo n.º 1
0
Arquivo: api.py Projeto: tlinnet/relax
    def __init__(self):
        """Initialise the class by placing API_common methods into the API."""

        # Place methods into the API.
        self.base_data_loop = self._base_data_loop_spin
        self.create_mc_data = self._create_mc_relax_data
        self.model_loop = self._model_loop_spin
        self.print_model_title = self._print_model_title_spin
        self.return_conversion_factor = self._return_no_conversion_factor
        self.return_error = self._return_error_relax_data
        self.return_value = self._return_value_general
        self.set_param_values = self._set_param_values_spin
        self.set_selected_sim = self._set_selected_sim_spin
        self.sim_pack_data = self._sim_pack_relax_data

        # Place a copy of the parameter list object in the instance namespace.
        self._PARAMS = Consistency_tests_params()
Exemplo n.º 2
0
def return_parameter_object(analysis_type=None, pipe_name=None):
    """Return the specific analysis API parameter object corresponding to the function type.

    @keyword analysis_type:     The specific analysis type.  This overrides the pipe_name argument.
    @type analysis_type:        str or None
    @keyword pipe_name:         The name of the data pipe to obtain the analysis type from.  This is ignored if the analysis_type argument is given.  If both arguments are None, then the current data pipe will be used.
    """

    # The analysis type, if not given.
    if analysis_type is None:
        # Check if a data pipe exists.
        check_pipe()

        # Use a custom data pipe name.
        if pipe_name:
            analysis_type = ds[pipe_name].pipe_type

        # Use the current data pipe.
        else:
            analysis_type = cdp.pipe_type

    # Consistency testing.
    if analysis_type == 'ct':
        from specific_analyses.consistency_tests.parameter_object import Consistency_tests_params
        return Consistency_tests_params()

    # The Frame Order theories.
    elif analysis_type == 'frame order':
        from specific_analyses.frame_order.parameter_object import Frame_order_params
        return Frame_order_params()

    # Hybrid models.
    elif analysis_type == 'hybrid':
        from specific_analyses.hybrid import Hybrid_params
        return Hybrid_params()

    # Reduced spectral density mapping.
    elif analysis_type == 'jw':
        from specific_analyses.jw_mapping.parameter_object import Jw_mapping_params
        return Jw_mapping_params()

    # Model-free analysis.
    elif analysis_type == 'mf':
        from specific_analyses.model_free.parameter_object import Model_free_params
        return Model_free_params()

    # The N-state model.
    elif analysis_type == 'N-state':
        from specific_analyses.n_state_model.parameter_object import N_state_params
        return N_state_params()

    # NOE calculation.
    elif analysis_type == 'noe':
        from specific_analyses.noe.parameter_object import Noe_params
        return Noe_params()

    # Relaxation dispersion curve fitting.
    elif analysis_type == 'relax_disp':
        from specific_analyses.relax_disp.parameter_object import Relax_disp_params
        return Relax_disp_params()

    # Relaxation curve fitting.
    elif analysis_type == 'relax_fit':
        from specific_analyses.relax_fit.parameter_object import Relax_fit_params
        return Relax_fit_params()

    # Unknown analysis.
    else:
        raise RelaxError("The analysis type '%s' is unknown." % analysis_type)
Exemplo n.º 3
0
#                                                                             #
# You should have received a copy of the GNU General Public License           #
# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
#                                                                             #
###############################################################################

# Module docstring.
"""The value user function definitions."""

# Python module imports.
from os import sep

# relax module imports.
from graphics import WIZARD_IMAGE_PATH
from pipe_control import pipes, value
from specific_analyses.consistency_tests.parameter_object import Consistency_tests_params; consistency_test_params = Consistency_tests_params()
from specific_analyses.frame_order.parameter_object import Frame_order_params; frame_order_params = Frame_order_params()
from specific_analyses.jw_mapping.parameter_object import Jw_mapping_params; jw_mapping_params = Jw_mapping_params()
from specific_analyses.model_free.parameter_object import Model_free_params; model_free_params = Model_free_params()
from specific_analyses.n_state_model.parameter_object import N_state_params; n_state_params = N_state_params()
from specific_analyses.noe.parameter_object import Noe_params; noe_params = Noe_params()
from specific_analyses.relax_disp.parameter_object import Relax_disp_params; relax_disp_params = Relax_disp_params()
from specific_analyses.relax_fit.parameter_object import Relax_fit_params; relax_fit_params = Relax_fit_params()
from user_functions.data import Uf_info; uf_info = Uf_info()
from user_functions.data import Uf_tables; uf_tables = Uf_tables()
from user_functions.objects import Desc_container


# The user function class.
uf_class = uf_info.add_class('value')
uf_class.title = "Class for setting parameter values."
Exemplo n.º 4
0
# GNU General Public License for more details.                                #
#                                                                             #
# You should have received a copy of the GNU General Public License           #
# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
#                                                                             #
###############################################################################

# Module docstring.
"""The grace user function definitions for controlling the Grace data viewing software."""

# relax module imports.
from graphics import WIZARD_IMAGE_PATH
from pipe_control import grace
from pipe_control.plotting import write_xy
from specific_analyses.consistency_tests.parameter_object import Consistency_tests_params
consistency_test_params = Consistency_tests_params()
from specific_analyses.jw_mapping.parameter_object import Jw_mapping_params
jw_mapping_params = Jw_mapping_params()
from specific_analyses.model_free.parameter_object import Model_free_params
model_free_params = Model_free_params()
from specific_analyses.noe.parameter_object import Noe_params
noe_params = Noe_params()
from specific_analyses.relax_disp.parameter_object import Relax_disp_params
relax_disp_params = Relax_disp_params()
from specific_analyses.relax_fit.parameter_object import Relax_fit_params
relax_fit_params = Relax_fit_params()
from user_functions.data import Uf_info
uf_info = Uf_info()
from user_functions.objects import Desc_container
from user_functions.wildcards import WILDCARD_GRACE_ALL
Exemplo n.º 5
0
# Python module imports.
from os import sep
import dep_check

if dep_check.wx_module:
    from wx import FD_OPEN, FD_SAVE
else:
    FD_OPEN = -1
    FD_SAVE = -1

# relax module imports.
from graphics import WIZARD_IMAGE_PATH
from pipe_control import pipes, value
from specific_analyses.consistency_tests.parameter_object import Consistency_tests_params

consistency_test_params = Consistency_tests_params()
from specific_analyses.frame_order.parameter_object import Frame_order_params

frame_order_params = Frame_order_params()
from specific_analyses.jw_mapping.parameter_object import Jw_mapping_params

jw_mapping_params = Jw_mapping_params()
from specific_analyses.model_free.parameter_object import Model_free_params

model_free_params = Model_free_params()
from specific_analyses.n_state_model.parameter_object import N_state_params

n_state_params = N_state_params()
from specific_analyses.noe.parameter_object import Noe_params

noe_params = Noe_params()
Exemplo n.º 6
0
# Module docstring.
"""The grace user function definitions for controlling the Grace data viewing software."""

# Python module imports.
import dep_check
if dep_check.wx_module:
    from wx import FD_OPEN, FD_SAVE
else:
    FD_OPEN = -1
    FD_SAVE = -1

# relax module imports.
from graphics import WIZARD_IMAGE_PATH
from pipe_control import grace
from pipe_control.plotting import write_xy
from specific_analyses.consistency_tests.parameter_object import Consistency_tests_params; consistency_test_params = Consistency_tests_params()
from specific_analyses.jw_mapping.parameter_object import Jw_mapping_params; jw_mapping_params = Jw_mapping_params()
from specific_analyses.model_free.parameter_object import Model_free_params; model_free_params = Model_free_params()
from specific_analyses.noe.parameter_object import Noe_params; noe_params = Noe_params()
from specific_analyses.relax_disp.parameter_object import Relax_disp_params; relax_disp_params = Relax_disp_params()
from specific_analyses.relax_fit.parameter_object import Relax_fit_params; relax_fit_params = Relax_fit_params()
from user_functions.data import Uf_info; uf_info = Uf_info()
from user_functions.objects import Desc_container
from user_functions.wildcards import WILDCARD_GRACE_ALL


# The user function class.
uf_class = uf_info.add_class('grace')
uf_class.title = "Class for interfacing with Grace."
uf_class.menu_text = "&grace"
uf_class.gui_icon = "relax.grace_icon"