61 def makeConfig(self, funcOptions):
62 """
63 Parameters
64 ----------
65 funcName: str
66 name associated with the algorithm. This name must have been added to the
67 list of available algorithms
68 funcOptions: dict
69 dictionary containing options for the algorithm read from the YAML file
70
71 Returns
72 -------
73 configSequence
74 """
75 configSeq = ConfigSequence()
76
77 func = self.alg
78 funcName = self.algName
79 funcDefaults = getDefaultArgs(func)
80 defaults = self.defaults
81
82 args = {}
83
84 for arg in getFuncArgs(func):
85
86 if arg in funcOptions:
87 args[arg] = funcOptions[arg]
88
89 elif arg in funcDefaults:
90 args[arg] = funcDefaults[arg]
91
92 elif defaults is not None and arg in defaults:
93 args[arg] = defaults[arg]
94 elif arg == 'seq':
95
96 args[arg] = configSeq
97 elif arg == 'kwargs':
98
99 continue
100 else:
101 raise ValueError(f"{arg} is required for {funcName}")
102 if inspect.isclass(func):
103 configSeq.append(func(**args))
104 else:
105 func(**args)
106 configSeq.setFactoryName(self.factoryName)
107 return configSeq, args.keys()
108
109