test_h_infinity

wield.control.fitting.SISO.test.v2.test_h_infinity

This is a pytest module needing documentation

pytest-html report

Functions

test_simple1()

This is a pytest needing documentation

test_simple1_callable()

This is a pytest needing documentation

test_simple1_vec()

This is a pytest needing documentation

Details

test_simple1()[source][github]

This is a pytest needing documentation

code
 1@pytest.mark.skipif(module_import_skip, reason="cannot import IIRrational_test_data")
 2def test_simple1():
 3    data_name = "PUM_long"
 4    data = testing_data_dev(
 5        data_name,
 6        instance_num=1,
 7        set_num=1,
 8    )
 9    out = v2.data2filter(
10        xfer=data.data,
11        F_Hz=data.F_Hz,
12        SNR=data.SNR,
13        order_initial=10,
14        delay_s=0,
15        F_nyquist_Hz=None,
16        poles=(-100, -50),
17        zeros=(-10, -50),
18        mode="fit",
19        delay_s_max=0.01,
20        h_infinity=0.99,
21        h_infinity_deweight=0.1,
22        # hints = [
23        #    testing.validate_plot_log(__file__, request),
24        # ],
25    )
26
27    print(out.as_scipy_signal_ZPKsw())
28    print(out.as_foton_ZPKsf())
29    print(out.as_foton_str_ZPKsf())
30    print(out.as_foton_ZPKsn())
31    print(out.as_foton_str_ZPKsn())
32    return
pytest information

This code is wrapped in a pytest function using conventions detailed in Pytest Conventions. The full name of this test, as known by the documentation, is:

wield.control.fitting.SISO.test.v2.test_h_infinity.test_simple1

The full name is useful when building documentation, to link a reference to this page using :func:`name`, or directly include it with an autofunction directive. The collapse nodes below show every instance of the test run. There may only be one, but if the test was run multiple times through pytest parametrizations, the list can be longer.

test_simple1
output
{'xfer': array([0.99991943+0.01269363j, 0.99898695+0.01334339j,
       1.0004262 +0.01652516j, ..., 8.50155565-4.1056289j ,
       8.52711202-4.10887446j, 8.55579045-4.08723171j]), 'F_Hz': array([1.0000000e-01, 1.3644214e-01, 1.8616456e-01, ..., 6.9980000e+03,
       6.9990000e+03, 7.0000000e+03]), 'SNR': 1, 'order_initial': 10, 'delay_s': 0, 'F_nyquist_Hz': None, 'poles': (-100, -50), 'zeros': (-10, -50), 'mode': 'fit', 'delay_s_max': 0.01, 'h_infinity': 0.99, 'h_infinity_deweight': 0.1}
TEE_LOGFILE None
A [-100.  -50.]
B [-100.  -50.]
4P   0.82  activating delay fitting
2A   1.74  Baseline fit delay:  7.177075180649361e-06
2A   1.74  Baseline fit residuals: 2.70e-04, at order 2
BASELINE:  2
------------:investigations:
2I   1.76    max(z, p)       ChiSq.
                   order    avg. res.    med. res.    max. res.
             -----------  -----------  -----------  -----------
                       2   0.00026968  0.000569439   0.00471985
(array([-6.98378337e+04, -6.95307289e+01]), array([-51042.14747562,   -729.42430678]), 7.605285243065826)
([-11115.036451404907, -11.066159203373445], [-8123.610076770266, -116.09148403560093], 7.605285243065826)
ZPK([
  -11115.036451404907; -11.066159203373445;
],[
  -8123.610076770266; -116.09148403560093;
], 7.605285243065826, "f")
([11115.036451404907, 11.066159203373445], [8123.610076770266, 116.09148403560093], 0.9919136800339822)
ZPK([
  11115.036451404907; 11.066159203373445;
],[
  8123.610076770266; 116.09148403560093;
], 0.9919136800339822, "n")
Captured stderr call
3W   1.20  Fitter_checkup improvement succeed
3W   1.72  Fitter_checkpoint improvement succeed, None
test_simple1_callable()[source][github]

This is a pytest needing documentation

code
 1@pytest.mark.skipif(module_import_skip, reason="cannot import IIRrational_test_data")
 2def test_simple1_callable():
 3    data_name = "PUM_long"
 4    data = testing_data_dev(
 5        data_name,
 6        instance_num=1,
 7        set_num=1,
 8    )
 9    out = v2.data2filter(
10        xfer=data.data,
11        F_Hz=data.F_Hz,
12        SNR=data.SNR,
13        order_initial=10,
14        delay_s=0,
15        F_nyquist_Hz=None,
16        poles=(-100, -50),
17        zeros=(-10, -50),
18        mode="fit",
19        delay_s_max=0.01,
20        h_infinity=lambda L: abs(1 / (1 + 1j * np.linspace(0, 100, L))),
21        # hints = [
22        #    testing.validate_plot_log(__file__, request),
23        # ],
24    )
25
26    print(out.as_scipy_signal_ZPKsw())
27    print(out.as_foton_ZPKsf())
28    print(out.as_foton_str_ZPKsf())
29    print(out.as_foton_ZPKsn())
30    print(out.as_foton_str_ZPKsn())
31    return
pytest information

This code is wrapped in a pytest function using conventions detailed in Pytest Conventions. The full name of this test, as known by the documentation, is:

wield.control.fitting.SISO.test.v2.test_h_infinity.test_simple1_callable

The full name is useful when building documentation, to link a reference to this page using :func:`name`, or directly include it with an autofunction directive. The collapse nodes below show every instance of the test run. There may only be one, but if the test was run multiple times through pytest parametrizations, the list can be longer.

test_simple1_callable
output
{'xfer': array([0.99991943+0.01269363j, 0.99898695+0.01334339j,
       1.0004262 +0.01652516j, ..., 8.50155565-4.1056289j ,
       8.52711202-4.10887446j, 8.55579045-4.08723171j]), 'F_Hz': array([1.0000000e-01, 1.3644214e-01, 1.8616456e-01, ..., 6.9980000e+03,
       6.9990000e+03, 7.0000000e+03]), 'SNR': 1, 'order_initial': 10, 'delay_s': 0, 'F_nyquist_Hz': None, 'poles': (-100, -50), 'zeros': (-10, -50), 'mode': 'fit', 'delay_s_max': 0.01, 'h_infinity': <function test_simple1_callable.<locals>.<lambda> at 0x7fbb5ebee3e0>}
TEE_LOGFILE None
A [-100.  -50.]
B [-100.  -50.]
4P  10.46  activating delay fitting
2A  16.38  Baseline fit delay:  1.0245333695667047e-05
2A  16.38  Baseline fit residuals: 1.36e-04, at order 2
BASELINE:  2
------------:investigations:
2I  16.39    max(z, p)       ChiSq.
                   order    avg. res.    med. res.    max. res.
             -----------  -----------  -----------  -----------
                       2  0.000136275  0.000252919   0.00115756
(array([-7732.94418908,   -73.62437924]), array([-7254.95088734,  -765.47147379]), 9.647882210497768)
([-1230.7362923451456, -11.717683887886823], [-1154.661295608988, -121.82856884973086], 9.647882210497768)
ZPK([
  -1230.7362923451456; -11.717683887886823;
],[
  -1154.661295608988; -121.82856884973086;
], 9.647882210497768, "f")
([1230.7362923451456, 11.717683887886823], [1154.661295608988, 121.82856884973086], 0.9890882138872209)
ZPK([
  1230.7362923451456; 11.717683887886823;
],[
  1154.661295608988; 121.82856884973086;
], 0.9890882138872209, "n")
Captured stderr call
3W  10.45  Fitter_checkpoint improvement succeed, None
3W  15.12  Fitter_checkup improvement succeed
3W  16.37  Fitter_checkpoint improvement succeed, None
test_simple1_vec()[source][github]

This is a pytest needing documentation

code
 1@pytest.mark.skipif(module_import_skip, reason="cannot import IIRrational_test_data")
 2def test_simple1_vec():
 3    data_name = "PUM_long"
 4    data = testing_data_dev(
 5        data_name,
 6        instance_num=1,
 7        set_num=1,
 8    )
 9    out = v2.data2filter(
10        xfer=data.data,
11        F_Hz=data.F_Hz,
12        SNR=data.SNR,
13        order_initial=10,
14        delay_s=0,
15        F_nyquist_Hz=None,
16        poles=(-100, -50),
17        zeros=(-10, -50),
18        mode="fit",
19        delay_s_max=0.01,
20        h_infinity=abs(1 / (1 + 1j * data.F_Hz / 1)),
21        # hints = [
22        #    testing.validate_plot_log(__file__, request),
23        # ],
24    )
25
26    print(out.as_scipy_signal_ZPKsw())
27    print(out.as_foton_ZPKsf())
28    print(out.as_foton_str_ZPKsf())
29    print(out.as_foton_ZPKsn())
30    print(out.as_foton_str_ZPKsn())
31    return
pytest information

This code is wrapped in a pytest function using conventions detailed in Pytest Conventions. The full name of this test, as known by the documentation, is:

wield.control.fitting.SISO.test.v2.test_h_infinity.test_simple1_vec

The full name is useful when building documentation, to link a reference to this page using :func:`name`, or directly include it with an autofunction directive. The collapse nodes below show every instance of the test run. There may only be one, but if the test was run multiple times through pytest parametrizations, the list can be longer.

test_simple1_vec
output
{'xfer': array([0.99991943+0.01269363j, 0.99898695+0.01334339j,
       1.0004262 +0.01652516j, ..., 8.50155565-4.1056289j ,
       8.52711202-4.10887446j, 8.55579045-4.08723171j]), 'F_Hz': array([1.0000000e-01, 1.3644214e-01, 1.8616456e-01, ..., 6.9980000e+03,
       6.9990000e+03, 7.0000000e+03]), 'SNR': 1, 'order_initial': 10, 'delay_s': 0, 'F_nyquist_Hz': None, 'poles': (-100, -50), 'zeros': (-10, -50), 'mode': 'fit', 'delay_s_max': 0.01, 'h_infinity': array([9.95037190e-01, 9.90819752e-01, 9.83109174e-01, ...,
       1.42897969e-04, 1.42877552e-04, 1.42857141e-04])}
TEE_LOGFILE None
A [-100.  -50.]
B [-100.  -50.]
4P   0.57  activating delay fitting
2A   1.76  Baseline fit delay:  1.0600173044228445e-05
2A   1.76  Baseline fit residuals: 2.41e-04, at order 2
BASELINE:  2
------------:investigations:
2I   1.77    max(z, p)       ChiSq.
                   order    avg. res.    med. res.    max. res.
             -----------  -----------  -----------  -----------
                       2  0.000241448  0.000444568   0.00137803
(array([-536.18294694,  -73.73401598]), array([-614.01331158+125.54640259j, -614.01331158-125.54640259j]), 9.754924568656998)
([-85.33616640760984, -11.735133116679568], [(-97.7232536628839+19.98133055941362j), (-97.7232536628839-19.98133055941362j)], 9.754924568656998)
ZPK([
  -85.33616640760984; -11.735133116679568;
],[
  -97.7232536628839 + 19.98133055941362*i; -97.7232536628839 - 19.98133055941362*i;
], 9.754924568656998, "f")
([85.33616640760984, 11.735133116679568], [(97.7232536628839+19.98133055941362j), (97.7232536628839-19.98133055941362j)], 0.981887650801746)
ZPK([
  85.33616640760984; 11.735133116679568;
],[
  97.7232536628839 + 19.98133055941362*i; 97.7232536628839 - 19.98133055941362*i;
], 0.981887650801746, "n")
Captured stderr call
3W   1.42  Fitter_checkup improvement succeed
3W   1.74  Fitter_checkpoint improvement succeed, None