Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
test_wf_property_lists.py
Go to the documentation of this file.
1# -*- coding: utf-8 -*-
2#
3# Copyright (C) 2020 Nathan K. Johnson-McDaniel
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http: //www.gnu.org/licenses/>.
17
18"""
19This script checks that all implemented waveform
20models have entries in:
21
22XLALSimInspiralGetSpinSupportFromApproximant()
23XLALSimInspiralGetSpinFreqFromApproximant()
24XLALSimInspiralApproximantAcceptTestGRParams()
25"""
26
27import sys
28import pytest
29import lalsimulation as lalsim
30
31# Function to get the name of a function
32def get_name(f):
33 return f.__name__
34
35# Set of functions to test
36func_list = [
37 lalsim.SimInspiralGetSpinSupportFromApproximant,
38 lalsim.SimInspiralGetSpinFreqFromApproximant,
39 lalsim.SimInspiralApproximantAcceptTestGRParams
40]
41
42# Loop over all implemented TD or FD approximants
43
44IMPLEMENTED = [
45 k for k in range(lalsim.NumApproximants) if
46 lalsim.SimInspiralImplementedTDApproximants(k) or
47 lalsim.SimInspiralImplementedFDApproximants(k)
48]
49
50@pytest.mark.parametrize("func", func_list, ids=get_name)
51@pytest.mark.parametrize("k", IMPLEMENTED, ids=lalsim.GetStringFromApproximant)
53 func(k)
54
55if __name__ == '__main__':
56 args = sys.argv[1:] or ["-v", "-rs", "--junit-xml=junit-wf_property_lists.xml"]
57 sys.exit(pytest.main(args=[__file__] + args))