gstlal 1.13.0
Loading...
Searching...
No Matches
element_registry.py
1"""Utilities for registering elements to a mixin class that can call elements as methods
2
3Motivation:
4 1. Inspectability
5 By making each method statically as opposed to dynamically (from registry list), the full traceback is inspectable
6 before runtime, allowing for easier development and clearer, more concise readability.
7 1. Performance
8 Dynamically setting methods on import is inefficient, though it is clever
9"""
10import inspect
11import types
12from typing import List
13
14from gstlal import pipeparts
15from gstlal.pipeparts import condition as pipeparts_condition
16
17try:
18 from gstlal import lloidparts
19except ImportError:
20 lloidparts = None
21
22
24 """Class that defines the pass-through behavior of registered pipeparts elements that are called
25 as methods of an instance (as opposed to calling the pipeparts functions directly)
26
27 All methods of this class are procedurally generated (except _attach_element), by running the following code
28 from the test_stream module:
29
30 print(test_stream.generate_element_mixin())
31
32 Notes:
33 Motivation:
34 A alternate implementation set attributes dynamically, which though a smaller amount of code, was not
35 inspectable before runtime (bad). This mixin class may be less fancy, but it allows for inspection
36 which will improve development workflow (and demystify the pass-through methods of Stream class)
37
38 New Elements:
39 Since registration happens statically (before runtime), adding a new element to the elements registries will not
40 have an effect unless a similar method is added to this Mixin class. However, thanks to the test suite, adding a
41 new element will raise a test failure unless this Mixin class is rebuilt.
42 """
43
44 def _attach_element(self, func: types.FunctionType, *srcs, **kwargs):
45 """Utility function for calling the registered element
46
47 Args:
48 func:
49 *srcs:
50 **kwargs:
51
52 Returns:
53 RegisteredElementMixin instance (or subclass instance) with newly attached element
54 """
55 head = func(self.pipeline, self.head, *srcs, **kwargs)
56 cls = type(self)
57 return cls(
58 name=self.name,
59 mainloop=self.mainloop,
60 pipeline=self.pipeline,
61 handler=self.handler,
62 source=self.source,
63 head=head,
64 )
65
66 def channelgram(self, *srcs, **kwargs):
67 """Automatically generated pass-through method for function pipeparts.mkchannelgram"""
68 return self._attach_element(pipeparts.mkchannelgram, *srcs, **kwargs)
69
70 def spectrumplot(self, *srcs, **kwargs):
71 """Automatically generated pass-through method for function pipeparts.mkspectrumplot"""
72 return self._attach_element(pipeparts.mkspectrumplot, *srcs, **kwargs)
73
74 def histogram(self, *srcs, **kwargs):
75 """Automatically generated pass-through method for function pipeparts.mkhistogram"""
76 return self._attach_element(pipeparts.mkhistogram, *srcs, **kwargs)
77
78 def uridecodebin(self, *srcs, **kwargs):
79 """Automatically generated pass-through method for function pipeparts.mkuridecodebin"""
80 return self._attach_element(pipeparts.mkuridecodebin, *srcs, **kwargs)
81
82 def framecppchanneldemux(self, *srcs, **kwargs):
83 """Automatically generated pass-through method for function pipeparts.mkframecppchanneldemux"""
84 return self._attach_element(pipeparts.mkframecppchanneldemux, *srcs, **kwargs)
85
86 def framecppchannelmux(self, *srcs, **kwargs):
87 """Automatically generated pass-through method for function pipeparts.mkframecppchannelmux_from_list"""
88 return self._attach_element(pipeparts.mkframecppchannelmux_from_list, *srcs, **kwargs)
89
90 def framecppfilesink(self, *srcs, **kwargs):
91 """Automatically generated pass-through method for function pipeparts.mkframecppfilesink"""
92 return self._attach_element(pipeparts.mkframecppfilesink, *srcs, **kwargs)
93
94 def multifilesink(self, *srcs, **kwargs):
95 """Automatically generated pass-through method for function pipeparts.mkmultifilesink"""
96 return self._attach_element(pipeparts.mkmultifilesink, *srcs, **kwargs)
97
98 def capsfilter(self, *srcs, **kwargs):
99 """Automatically generated pass-through method for function pipeparts.mkcapsfilter"""
100 return self._attach_element(pipeparts.mkcapsfilter, *srcs, **kwargs)
101
102 def capssetter(self, *srcs, **kwargs):
103 """Automatically generated pass-through method for function pipeparts.mkcapssetter"""
104 return self._attach_element(pipeparts.mkcapssetter, *srcs, **kwargs)
105
106 def statevector(self, *srcs, **kwargs):
107 """Automatically generated pass-through method for function pipeparts.mkstatevector"""
108 return self._attach_element(pipeparts.mkstatevector, *srcs, **kwargs)
109
110 def taginject(self, *srcs, **kwargs):
111 """Automatically generated pass-through method for function pipeparts.mktaginject"""
112 return self._attach_element(pipeparts.mktaginject, *srcs, **kwargs)
113
114 def firfilter(self, *srcs, **kwargs):
115 """Automatically generated pass-through method for function pipeparts.mkfirfilter"""
116 return self._attach_element(pipeparts.mkfirfilter, *srcs, **kwargs)
117
118 def iirfilter(self, *srcs, **kwargs):
119 """Automatically generated pass-through method for function pipeparts.mkiirfilter"""
120 return self._attach_element(pipeparts.mkiirfilter, *srcs, **kwargs)
121
122 def shift(self, *srcs, **kwargs):
123 """Automatically generated pass-through method for function pipeparts.mkshift"""
124 return self._attach_element(pipeparts.mkshift, *srcs, **kwargs)
125
126 def progressreport(self, *srcs, **kwargs):
127 """Automatically generated pass-through method for function pipeparts.mkprogressreport"""
128 return self._attach_element(pipeparts.mkprogressreport, *srcs, **kwargs)
129
130 def injections(self, *srcs, **kwargs):
131 """Automatically generated pass-through method for function pipeparts.mkinjections"""
132 return self._attach_element(pipeparts.mkinjections, *srcs, **kwargs)
133
134 def audiochebband(self, *srcs, **kwargs):
135 """Automatically generated pass-through method for function pipeparts.mkaudiochebband"""
136 return self._attach_element(pipeparts.mkaudiochebband, *srcs, **kwargs)
137
138 def audiocheblimit(self, *srcs, **kwargs):
139 """Automatically generated pass-through method for function pipeparts.mkaudiocheblimit"""
140 return self._attach_element(pipeparts.mkaudiocheblimit, *srcs, **kwargs)
141
142 def audioamplify(self, *srcs, **kwargs):
143 """Automatically generated pass-through method for function pipeparts.mkaudioamplify"""
144 return self._attach_element(pipeparts.mkaudioamplify, *srcs, **kwargs)
145
146 def audioundersample(self, *srcs, **kwargs):
147 """Automatically generated pass-through method for function pipeparts.mkaudioundersample"""
148 return self._attach_element(pipeparts.mkaudioundersample, *srcs, **kwargs)
149
150 def resample(self, *srcs, **kwargs):
151 """Automatically generated pass-through method for function pipeparts.mkresample"""
152 return self._attach_element(pipeparts.mkresample, *srcs, **kwargs)
153
154 def interpolator(self, *srcs, **kwargs):
155 """Automatically generated pass-through method for function pipeparts.mkinterpolator"""
156 return self._attach_element(pipeparts.mkinterpolator, *srcs, **kwargs)
157
158 def whiten(self, *srcs, **kwargs):
159 """Automatically generated pass-through method for function pipeparts.mkwhiten"""
160 return self._attach_element(pipeparts.mkwhiten, *srcs, **kwargs)
161
162 def integrate(self, *srcs, **kwargs):
163 """Automatically generated pass-through method for function pipeparts.mkintegrate"""
164 return self._attach_element(pipeparts.mkintegrate, *srcs, **kwargs)
165
166 def tee(self, *srcs, **kwargs):
167 """Automatically generated pass-through method for function pipeparts.mktee"""
168 return self._attach_element(pipeparts.mktee, *srcs, **kwargs)
169
170 def adder(self, *srcs, **kwargs):
171 """Automatically generated pass-through method for function pipeparts.mkadder"""
172 return self._attach_element(pipeparts.mkadder, *srcs, **kwargs)
173
174 def multiplier(self, *srcs, **kwargs):
175 """Automatically generated pass-through method for function pipeparts.mkmultiplier"""
176 return self._attach_element(pipeparts.mkmultiplier, *srcs, **kwargs)
177
178 def queue(self, *srcs, **kwargs):
179 """Automatically generated pass-through method for function pipeparts.mkqueue"""
180 return self._attach_element(pipeparts.mkqueue, *srcs, **kwargs)
181
182 def drop(self, *srcs, **kwargs):
183 """Automatically generated pass-through method for function pipeparts.mkdrop"""
184 return self._attach_element(pipeparts.mkdrop, *srcs, **kwargs)
185
186 def nofakedisconts(self, *srcs, **kwargs):
187 """Automatically generated pass-through method for function pipeparts.mknofakedisconts"""
188 return self._attach_element(pipeparts.mknofakedisconts, *srcs, **kwargs)
189
190 def firbank(self, *srcs, **kwargs):
191 """Automatically generated pass-through method for function pipeparts.mkfirbank"""
192 return self._attach_element(pipeparts.mkfirbank, *srcs, **kwargs)
193
194 def tdwhiten(self, *srcs, **kwargs):
195 """Automatically generated pass-through method for function pipeparts.mktdwhiten"""
196 return self._attach_element(pipeparts.mktdwhiten, *srcs, **kwargs)
197
198 def trim(self, *srcs, **kwargs):
199 """Automatically generated pass-through method for function pipeparts.mktrim"""
200 return self._attach_element(pipeparts.mktrim, *srcs, **kwargs)
201
202 def mean(self, *srcs, **kwargs):
203 """Automatically generated pass-through method for function pipeparts.mkmean"""
204 return self._attach_element(pipeparts.mkmean, *srcs, **kwargs)
205
206 def abs(self, *srcs, **kwargs):
207 """Automatically generated pass-through method for function pipeparts.mkabs"""
208 return self._attach_element(pipeparts.mkabs, *srcs, **kwargs)
209
210 def pow(self, *srcs, **kwargs):
211 """Automatically generated pass-through method for function pipeparts.mkpow"""
212 return self._attach_element(pipeparts.mkpow, *srcs, **kwargs)
213
214 def reblock(self, *srcs, **kwargs):
215 """Automatically generated pass-through method for function pipeparts.mkreblock"""
216 return self._attach_element(pipeparts.mkreblock, *srcs, **kwargs)
217
218 def sumsquares(self, *srcs, **kwargs):
219 """Automatically generated pass-through method for function pipeparts.mksumsquares"""
220 return self._attach_element(pipeparts.mksumsquares, *srcs, **kwargs)
221
222 def gate(self, *srcs, **kwargs):
223 """Automatically generated pass-through method for function pipeparts.mkgate"""
224 return self._attach_element(pipeparts.mkgate, *srcs, **kwargs)
225
226 def bitvectorgen(self, *srcs, **kwargs):
227 """Automatically generated pass-through method for function pipeparts.mkbitvectorgen"""
228 return self._attach_element(pipeparts.mkbitvectorgen, *srcs, **kwargs)
229
230 def matrixmixer(self, *srcs, **kwargs):
231 """Automatically generated pass-through method for function pipeparts.mkmatrixmixer"""
232 return self._attach_element(pipeparts.mkmatrixmixer, *srcs, **kwargs)
233
234 def togglecomplex(self, *srcs, **kwargs):
235 """Automatically generated pass-through method for function pipeparts.mktogglecomplex"""
236 return self._attach_element(pipeparts.mktogglecomplex, *srcs, **kwargs)
237
238 def autochisq(self, *srcs, **kwargs):
239 """Automatically generated pass-through method for function pipeparts.mkautochisq"""
240 return self._attach_element(pipeparts.mkautochisq, *srcs, **kwargs)
241
242 def fakesink(self, *srcs, **kwargs):
243 """Automatically generated pass-through method for function pipeparts.mkfakesink"""
244 return self._attach_element(pipeparts.mkfakesink, *srcs, **kwargs)
245
246 def filesink(self, *srcs, **kwargs):
247 """Automatically generated pass-through method for function pipeparts.mkfilesink"""
248 return self._attach_element(pipeparts.mkfilesink, *srcs, **kwargs)
249
250 def nxydump(self, *srcs, **kwargs):
251 """Automatically generated pass-through method for function pipeparts.mknxydump"""
252 return self._attach_element(pipeparts.mknxydump, *srcs, **kwargs)
253
254 def nxydumpsink(self, *srcs, **kwargs):
255 """Automatically generated pass-through method for function pipeparts.mknxydumpsink"""
256 return self._attach_element(pipeparts.mknxydumpsink, *srcs, **kwargs)
257
258 def nxydumpsinktee(self, *srcs, **kwargs):
259 """Automatically generated pass-through method for function pipeparts.mknxydumpsinktee"""
260 return self._attach_element(pipeparts.mknxydumpsinktee, *srcs, **kwargs)
261
262 def triggergen(self, *srcs, **kwargs):
263 """Automatically generated pass-through method for function pipeparts.mktriggergen"""
264 return self._attach_element(pipeparts.mktriggergen, *srcs, **kwargs)
265
266 def triggerxmlwritersink(self, *srcs, **kwargs):
267 """Automatically generated pass-through method for function pipeparts.mktriggerxmlwritersink"""
268 return self._attach_element(pipeparts.mktriggerxmlwritersink, *srcs, **kwargs)
269
270 def wavenc(self, *srcs, **kwargs):
271 """Automatically generated pass-through method for function pipeparts.mkwavenc"""
272 return self._attach_element(pipeparts.mkwavenc, *srcs, **kwargs)
273
274 def vorbisenc(self, *srcs, **kwargs):
275 """Automatically generated pass-through method for function pipeparts.mkvorbisenc"""
276 return self._attach_element(pipeparts.mkvorbisenc, *srcs, **kwargs)
277
278 def colorspace(self, *srcs, **kwargs):
279 """Automatically generated pass-through method for function pipeparts.mkcolorspace"""
280 return self._attach_element(pipeparts.mkcolorspace, *srcs, **kwargs)
281
282 def theoraenc(self, *srcs, **kwargs):
283 """Automatically generated pass-through method for function pipeparts.mktheoraenc"""
284 return self._attach_element(pipeparts.mktheoraenc, *srcs, **kwargs)
285
286 def oggmux(self, *srcs, **kwargs):
287 """Automatically generated pass-through method for function pipeparts.mkoggmux"""
288 return self._attach_element(pipeparts.mkoggmux, *srcs, **kwargs)
289
290 def avimux(self, *srcs, **kwargs):
291 """Automatically generated pass-through method for function pipeparts.mkavimux"""
292 return self._attach_element(pipeparts.mkavimux, *srcs, **kwargs)
293
294 def audioconvert(self, *srcs, **kwargs):
295 """Automatically generated pass-through method for function pipeparts.mkaudioconvert"""
296 return self._attach_element(pipeparts.mkaudioconvert, *srcs, **kwargs)
297
298 def audiorate(self, *srcs, **kwargs):
299 """Automatically generated pass-through method for function pipeparts.mkaudiorate"""
300 return self._attach_element(pipeparts.mkaudiorate, *srcs, **kwargs)
301
302 def flacenc(self, *srcs, **kwargs):
303 """Automatically generated pass-through method for function pipeparts.mkflacenc"""
304 return self._attach_element(pipeparts.mkflacenc, *srcs, **kwargs)
305
306 def ogmvideosink(self, *srcs, **kwargs):
307 """Automatically generated pass-through method for function pipeparts.mkogmvideosink"""
308 return self._attach_element(pipeparts.mkogmvideosink, *srcs, **kwargs)
309
310 def videosink(self, *srcs, **kwargs):
311 """Automatically generated pass-through method for function pipeparts.mkvideosink"""
312 return self._attach_element(pipeparts.mkvideosink, *srcs, **kwargs)
313
314 def autoaudiosink(self, *srcs, **kwargs):
315 """Automatically generated pass-through method for function pipeparts.mkautoaudiosink"""
316 return self._attach_element(pipeparts.mkautoaudiosink, *srcs, **kwargs)
317
318 def playbacksink(self, *srcs, **kwargs):
319 """Automatically generated pass-through method for function pipeparts.mkplaybacksink"""
320 return self._attach_element(pipeparts.mkplaybacksink, *srcs, **kwargs)
321
322 def deglitcher(self, *srcs, **kwargs):
323 """Automatically generated pass-through method for function pipeparts.mkdeglitcher"""
324 return self._attach_element(pipeparts.mkdeglitcher, *srcs, **kwargs)
325
326 def appsink(self, *srcs, **kwargs):
327 """Automatically generated pass-through method for function pipeparts.mkappsink"""
328 return self._attach_element(pipeparts.mkappsink, *srcs, **kwargs)
329
330 def checktimestamps(self, *srcs, **kwargs):
331 """Automatically generated pass-through method for function pipeparts.mkchecktimestamps"""
332 return self._attach_element(pipeparts.mkchecktimestamps, *srcs, **kwargs)
333
334 def peak(self, *srcs, **kwargs):
335 """Automatically generated pass-through method for function pipeparts.mkpeak"""
336 return self._attach_element(pipeparts.mkpeak, *srcs, **kwargs)
337
338 def itac(self, *srcs, **kwargs):
339 """Automatically generated pass-through method for function pipeparts.mkitac"""
340 return self._attach_element(pipeparts.mkitac, *srcs, **kwargs)
341
342 def itacac(self, *srcs, **kwargs):
343 """Automatically generated pass-through method for function pipeparts.mkitacac"""
344 return self._attach_element(pipeparts.mkitacac, *srcs, **kwargs)
345
346 def trigger(self, *srcs, **kwargs):
347 """Automatically generated pass-through method for function pipeparts.mktrigger"""
348 return self._attach_element(pipeparts.mktrigger, *srcs, **kwargs)
349
350 def latency(self, *srcs, **kwargs):
351 """Automatically generated pass-through method for function pipeparts.mklatency"""
352 return self._attach_element(pipeparts.mklatency, *srcs, **kwargs)
353
354 def computegamma(self, *srcs, **kwargs):
355 """Automatically generated pass-through method for function pipeparts.mkcomputegamma"""
356 return self._attach_element(pipeparts.mkcomputegamma, *srcs, **kwargs)
357
358 def bursttriggergen(self, *srcs, **kwargs):
359 """Automatically generated pass-through method for function pipeparts.mkbursttriggergen"""
360 return self._attach_element(pipeparts.mkbursttriggergen, *srcs, **kwargs)
361
362 def odctodqv(self, *srcs, **kwargs):
363 """Automatically generated pass-through method for function pipeparts.mkodctodqv"""
364 return self._attach_element(pipeparts.mkodctodqv, *srcs, **kwargs)
365
366 def tcpserversink(self, *srcs, **kwargs):
367 """Automatically generated pass-through method for function pipeparts.mktcpserversink"""
368 return self._attach_element(pipeparts.mktcpserversink, *srcs, **kwargs)
369
370 def htgate(self, *srcs, **kwargs):
371 """Automatically generated pass-through method for function pipeparts_condition.mkhtgate"""
372 return self._attach_element(pipeparts_condition.mkhtgate, *srcs, **kwargs)
373
374 def condition(self, *srcs, **kwargs):
375 """Automatically generated pass-through method for function pipeparts_condition.mkcondition"""
376 return self._attach_element(pipeparts_condition.mkcondition, *srcs, **kwargs)
377
378 def multiband(self, *srcs, **kwargs):
379 """Automatically generated pass-through method for function pipeparts_condition.mkmultiband"""
380 return self._attach_element(pipeparts_condition.mkmultiband, *srcs, **kwargs)
381
382 def controlsnksrc(self, *srcs, **kwargs):
383 """Automatically generated pass-through method for function lloidparts.mkcontrolsnksrc"""
384 return self._attach_element(lloidparts.mkcontrolsnksrc, *srcs, **kwargs)
385
386 def lloid_branch(self, *srcs, **kwargs):
387 """Automatically generated pass-through method for function lloidparts.mkLLOIDbranch"""
388 return self._attach_element(lloidparts.mkLLOIDbranch, *srcs, **kwargs)
389
390 def lloid_snr_slices_to_timeslice_chisq(self, *srcs, **kwargs):
391 """Automatically generated pass-through method for function lloidparts.mkLLOIDSnrSlicesToTimeSliceChisq"""
392 return self._attach_element(lloidparts.mkLLOIDSnrSlicesToTimeSliceChisq, *srcs, **kwargs)
393
394 def lloid_snr_chisq_to_triggers(self, *srcs, **kwargs):
395 """Automatically generated pass-through method for function lloidparts.mkLLOIDSnrChisqToTriggers"""
396 return self._attach_element(lloidparts.mkLLOIDSnrChisqToTriggers, *srcs, **kwargs)
397
398 def lloid_hoft_to_snr_slices(self, *srcs, **kwargs):
399 """Automatically generated pass-through method for function lloidparts.mkLLOIDhoftToSnrSlices"""
400 return self._attach_element(lloidparts.mkLLOIDhoftToSnrSlices, *srcs, **kwargs)
401
402
403####################################################################################################
404# #
405# ELEMENT REGISTRATION TOOLS BELOW #
406# #
407# Note: this registry is only used in the test suite to verify that the above ElementRegistry #
408# has all the expected methods with the desired names #
409# #
410####################################################################################################
411
412
413def module_name(func: types.FunctionType) -> str:
414 """Get a functions module name
415
416 Args:
417 func:
418 Function, the function for which to find module name
419
420 Returns:
421 str, the name of the module where the function is defined
422 """
423 names = inspect.getmodule(func).__name__.split('.')
424 if names[-1] == '__init__.py': # booo code defined in __init__.py....
425 return names[-2]
426 return names[-1]
427
428
429class RegisteredElement:
430 """A function to register as a method"""
431 LEGACY_PREFIX = 'mk'
432
433 def __init__(self, func: types.FunctionType, base_name: str = None, mod_name: str = None):
434 self.func = func
435 self.base_name = func.__name__ if base_name is None else base_name
436 self.module_name = module_name(self.func) if mod_name is None else mod_name
437
438 def __repr__(self):
439 """Repr for nice test formatting"""
440 return 'RegisteredElement({}.{})'.format(self.module_name, self.func.__name__)
441
442 @property
443 def name(self):
444 """Method that can be overridden by subclasses for special naming behavior"""
445 formatted_name = self.base_name
446 if formatted_name.startswith(self.LEGACY_PREFIX):
447 formatted_name = formatted_name.replace(self.LEGACY_PREFIX, '')
448
449 return formatted_name.lower()
450
451 def format_method_source(self):
452 """Utility for automatically generate method source"""
453 return ("\tdef {name}(self, *srcs, **kwargs):"
454 '\n\t\t"""Automatically generated pass-through method for function {mod}.{func}"""'
455 "\n\t\treturn self._attach_element({mod}.{func}, *srcs, **kwargs)").format(name=self.name,
456 mod=self.module_name,
457 func=self.func.__name__, )
458
459
460def generate_registered_method_source(elements: List[RegisteredElement] = None) -> str:
461 """This function is only to be used when making changes to the element registry, though it is also
462 allowed to edit the ElementRegistry class directly. This function helps automatically generate the method
463 source code for the ElementRegistry class using the attributes of the registered elements.
464
465 Args:
466 elements:
467 List[RegisteredElement], default None, if None use ALL_ELEMENTS registered below
468
469 Returns:
470 str
471 """
472 if elements is None:
473 elements = ALL_ELEMENTS
474 return '\n\n'.join(e.format_method_source() for e in elements)
475
476
477PIPEPARTS_ELEMENTS = [
478 RegisteredElement(pipeparts.mkchannelgram),
479 RegisteredElement(pipeparts.mkspectrumplot),
480 RegisteredElement(pipeparts.mkhistogram),
481 RegisteredElement(pipeparts.mkuridecodebin),
482 RegisteredElement(pipeparts.mkframecppchanneldemux),
483 RegisteredElement(pipeparts.mkframecppchannelmux_from_list, base_name='mkframecppchannelmux'),
484 RegisteredElement(pipeparts.mkframecppfilesink),
485 RegisteredElement(pipeparts.mkmultifilesink),
486 RegisteredElement(pipeparts.mkcapsfilter),
487 RegisteredElement(pipeparts.mkcapssetter),
488 RegisteredElement(pipeparts.mkstatevector),
489 RegisteredElement(pipeparts.mktaginject),
490 RegisteredElement(pipeparts.mkfirfilter),
491 RegisteredElement(pipeparts.mkiirfilter),
492 RegisteredElement(pipeparts.mkshift),
493 RegisteredElement(pipeparts.mkprogressreport),
494 RegisteredElement(pipeparts.mkinjections),
495 RegisteredElement(pipeparts.mkaudiochebband),
496 RegisteredElement(pipeparts.mkaudiocheblimit),
497 RegisteredElement(pipeparts.mkaudioamplify),
498 RegisteredElement(pipeparts.mkaudioundersample),
499 RegisteredElement(pipeparts.mkresample),
500 RegisteredElement(pipeparts.mkinterpolator),
501 RegisteredElement(pipeparts.mkwhiten),
502 RegisteredElement(pipeparts.mkintegrate),
503 RegisteredElement(pipeparts.mktee),
504 RegisteredElement(pipeparts.mkadder),
505 RegisteredElement(pipeparts.mkmultiplier),
506 RegisteredElement(pipeparts.mkqueue),
507 RegisteredElement(pipeparts.mkdrop),
508 RegisteredElement(pipeparts.mknofakedisconts),
509 RegisteredElement(pipeparts.mkfirbank),
510 RegisteredElement(pipeparts.mktdwhiten),
511 RegisteredElement(pipeparts.mktrim),
512 RegisteredElement(pipeparts.mkmean),
513 RegisteredElement(pipeparts.mkabs),
514 RegisteredElement(pipeparts.mkpow),
515 RegisteredElement(pipeparts.mkreblock),
516 RegisteredElement(pipeparts.mksumsquares),
517 RegisteredElement(pipeparts.mkgate),
518 RegisteredElement(pipeparts.mkbitvectorgen),
519 RegisteredElement(pipeparts.mkmatrixmixer),
520 RegisteredElement(pipeparts.mktogglecomplex),
521 RegisteredElement(pipeparts.mkautochisq),
522 RegisteredElement(pipeparts.mkfakesink),
523 RegisteredElement(pipeparts.mkfilesink),
524 RegisteredElement(pipeparts.mknxydump),
525 RegisteredElement(pipeparts.mknxydumpsink),
526 RegisteredElement(pipeparts.mknxydumpsinktee),
527 RegisteredElement(pipeparts.mktriggergen),
528 RegisteredElement(pipeparts.mktriggerxmlwritersink),
529 RegisteredElement(pipeparts.mkwavenc),
530 RegisteredElement(pipeparts.mkvorbisenc),
531 RegisteredElement(pipeparts.mkcolorspace),
532 RegisteredElement(pipeparts.mktheoraenc),
533 RegisteredElement(pipeparts.mkoggmux),
534 RegisteredElement(pipeparts.mkavimux),
535 RegisteredElement(pipeparts.mkaudioconvert),
536 RegisteredElement(pipeparts.mkaudiorate),
537 RegisteredElement(pipeparts.mkflacenc),
538 RegisteredElement(pipeparts.mkogmvideosink),
539 RegisteredElement(pipeparts.mkvideosink),
540 RegisteredElement(pipeparts.mkautoaudiosink),
541 RegisteredElement(pipeparts.mkplaybacksink),
542 RegisteredElement(pipeparts.mkdeglitcher),
543 RegisteredElement(pipeparts.mkappsink),
544 RegisteredElement(pipeparts.mkchecktimestamps),
545 RegisteredElement(pipeparts.mkpeak),
546 RegisteredElement(pipeparts.mkitac),
547 RegisteredElement(pipeparts.mkitacac),
548 RegisteredElement(pipeparts.mktrigger),
549 RegisteredElement(pipeparts.mklatency),
550 RegisteredElement(pipeparts.mkcomputegamma),
551 RegisteredElement(pipeparts.mkbursttriggergen),
552 RegisteredElement(pipeparts.mkodctodqv),
553 RegisteredElement(pipeparts.mktcpserversink),
554]
555
556CONDITION_ELEMENTS = [
557 # In the below, we have imported condition module as 'pipeparts_condition' to avoid
558 # a name collision with the element 'mkcondition', whose method-name will become 'condition'
559 RegisteredElement(pipeparts_condition.mkhtgate, mod_name='pipeparts_condition'),
560 RegisteredElement(pipeparts_condition.mkcondition, mod_name='pipeparts_condition'),
561 RegisteredElement(pipeparts_condition.mkmultiband, mod_name='pipeparts_condition'),
562]
563
564if lloidparts is not None:
565 LLOIDPARTS_ELEMENTS = [
566 RegisteredElement(lloidparts.mkcontrolsnksrc),
567 RegisteredElement(lloidparts.mkLLOIDbranch, base_name='mklloid_branch'),
568 RegisteredElement(lloidparts.mkLLOIDSnrSlicesToTimeSliceChisq, base_name='mklloid_snr_slices_to_timeslice_chisq'),
569 RegisteredElement(lloidparts.mkLLOIDSnrChisqToTriggers, base_name='mklloid_snrchisq_to_triggers'),
570 RegisteredElement(lloidparts.mkLLOIDhoftToSnrSlices, base_name='mklloid_hoft_to_snr_slices'),
571 ]
572else:
573 LLOIDPARTS_ELEMENTS = []
574
575ALL_ELEMENTS = PIPEPARTS_ELEMENTS + CONDITION_ELEMENTS + LLOIDPARTS_ELEMENTS
_attach_element(self, types.FunctionType func, *srcs, **kwargs)