1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 """Module containing the 'eliminate' user function for removing failed models."""
25 __docformat__ = 'plaintext'
26
27
28 from base_class import Basic_class, _build_doc
29 import arg_check
30 from generic_fns import eliminate
31 from relax_errors import RelaxFunctionError, RelaxListStrError, RelaxNoneStrListError, RelaxNoneTupleError
32 from specific_fns.model_free import Model_free
33
34
36 """Class containing the function for model elimination."""
37
38 - def eliminate(self, function=None, args=None):
53
54
55 eliminate._doc_title = "Elimination or rejection of models."
56 eliminate._doc_title_short = "Model elimination."
57 eliminate._doc_args = [
58 ["function", "A user supplied function for model elimination."],
59 ["args", "A tuple of arguments for model elimination."]
60 ]
61 eliminate._doc_desc = """
62 This is used for model validation to eliminate or reject models prior to model selection. Model validation is a part of mathematical modelling whereby models are either accepted or rejected.
63
64 Empirical rules are used for model rejection and are listed below. However these can be overridden by supplying a function in the prompt and scripting modes. The function should accept five arguments, a string defining a certain parameter, the value of the parameter, the minimisation instance (ie the residue index if the model is residue specific), and the function arguments. If the model is rejected, the function should return True, otherwise it should return False. The function will be executed multiple times, once for each parameter of the model.
65
66 The 'args' keyword argument should be a tuple, a list enclosed in round brackets, and will be passed to the user supplied function or the inbuilt function. For a description of the arguments accepted by the inbuilt functions, see below.
67
68 Once a model is rejected, the select flag corresponding to that model will be set to False so that model selection, or any other function, will then skip the model.
69 """
70 eliminate._doc_additional = []
71 for i in range(len(Model_free.eliminate_doc)):
72 eliminate._doc_additional.append(Model_free.eliminate_doc[i])
73 _build_doc(eliminate)
74