test_algorithm_choices

wield.control.SISO.test.test_algorithm_choices

This is a pytest module needing documentation

pytest-html report

Functions

test_algorithm_choices_laub()

This is a test of the numerical stability of a very large ZPK filter that spans 18 orders of magnitude

test_algorithm_choices_zpk2ss()

This is a test of the numerical stability of a very large ZPK filter that spans 18 orders of magnitude

Details

test_algorithm_choices_laub()[source][github]

This is a test of the numerical stability of a very large ZPK filter that spans 18 orders of magnitude

code
docstring
"""
This is a test of the numerical stability of a very large ZPK filter that spans 18 orders of magnitude
"""
 1def test_algorithm_choices_laub():
 2
 3    return
 4    zpk2ss_ranks = algorithm_choice.algorithm_choices_defaults['zpk2ss']
 5    dprint(zpk2ss_ranks)
 6    for k, r in zpk2ss_ranks.items():
 7        algorithm_choices = {'zpk2ss': {k: 1000}}
 8        print("Rank top: ", k)
 9
10        filt = SISO.zpk(
11            [], [], 1,
12            algorithm_choices=algorithm_choices
13        )
14        filtss = filt.asSS
15
16        dprint(filt.algorithm_choices)
17        dprint(filt.algorithm_ranking)
18
19        func = algorithm_choice.algorithm_mappings_name2func[k]
20        assert (filt.algorithm_ranking['zpk2ss'][0] == func)
21        assert (filtss.algorithm_ranking['zpk2ss'][0] == func)
22
23
24    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.SISO.test.test_algorithm_choices.test_algorithm_choices_laub

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_algorithm_choices_laub
output
status: passed
duration: 0.000s
test_algorithm_choices_zpk2ss()[source][github]

This is a test of the numerical stability of a very large ZPK filter that spans 18 orders of magnitude

code
docstring
"""
This is a test of the numerical stability of a very large ZPK filter that spans 18 orders of magnitude

"""
 1def test_algorithm_choices_zpk2ss():
 2
 3    zpk2ss_ranks = algorithm_choice.algorithm_choices_defaults['zpk2ss']
 4    dprint(zpk2ss_ranks)
 5    for k, r in zpk2ss_ranks.items():
 6        algorithm_choices = {'zpk2ss': {k: 1000}}
 7        print("Rank top: ", k)
 8
 9        filt = SISO.zpk(
10            [], [-1], 1,
11            algorithm_choices=algorithm_choices
12        )
13        filtss = filt.asSS
14
15        dprint(filt.algorithm_choices)
16        dprint(filt.algorithm_ranking)
17
18        func = algorithm_choice.algorithm_mappings_name2func[k]
19        assert (filt.algorithm_ranking['zpk2ss'][0] == func)
20        assert (filtss.algorithm_ranking['zpk2ss'][0] == func)
21
22    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.SISO.test.test_algorithm_choices.test_algorithm_choices_zpk2ss

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_algorithm_choices_zpk2ss
output
Rank top:  zpk2ss_cheby
Rank top:  zpk2ss_chain_poly
Rank top:  zpk2ss_chainE_poly
Rank top:  zpk2ss_cheby_lower
Rank top:  zpk2ss_chain_poly_lower
Rank top:  zpk2ss_chainE_poly_lower
Captured stderr call
{'zpk2ss_cheby': 80,
 'zpk2ss_chain_poly': 100,
 'zpk2ss_chainE_poly': 60,
 'zpk2ss_cheby_lower': -80,
 'zpk2ss_chain_poly_lower': -100,
 'zpk2ss_chainE_poly_lower': -60}
{'print_nonzero': {},
 'ss2fresponse': {'ss2fresponse_laub': 100,
  'ss2fresponse_horner': 50,
  'ss2fresponse_testing': 80},
 'ss2poles': {},
 'feedback': {},
 'zpk2fresponse': {},
 'zpk2domainpts': {},
 'ssreduce': {},
 'ss2domainpts': {},
 'domainpts_join': {},
 'ss2zpk': {},
 'zpk2ss': {'zpk2ss_chainE_poly_lower': -60,
  'zpk2ss_chain_poly_lower': -100,
  'zpk2ss_cheby_lower': -80,
  'zpk2ss_chain_poly': 100,
  'zpk2ss_chainE_poly': 60,
  'zpk2ss_cheby': 1000}}
{'print_nonzero': [],
 'ss2fresponse': [<function wield.control.ss_bare.algorithms_xfers.ss2fresponse_laub(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_testing(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_horner(ss, sorz, **kwargs)>],
 'ss2poles': [],
 'feedback': [],
 'zpk2fresponse': [],
 'zpk2domainpts': [],
 'ssreduce': [],
 'ss2domainpts': [],
 'domainpts_join': [],
 'ss2zpk': [],
 'zpk2ss': [<function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly_lower(zpk)>]}
{'print_nonzero': {},
 'ss2fresponse': {'ss2fresponse_laub': 100,
  'ss2fresponse_horner': 50,
  'ss2fresponse_testing': 80},
 'ss2poles': {},
 'feedback': {},
 'zpk2fresponse': {},
 'zpk2domainpts': {},
 'ssreduce': {},
 'ss2domainpts': {},
 'domainpts_join': {},
 'ss2zpk': {},
 'zpk2ss': {'zpk2ss_chainE_poly_lower': -60,
  'zpk2ss_chain_poly_lower': -100,
  'zpk2ss_cheby_lower': -80,
  'zpk2ss_chain_poly': 1000,
  'zpk2ss_chainE_poly': 60,
  'zpk2ss_cheby': 80}}
{'print_nonzero': [],
 'ss2fresponse': [<function wield.control.ss_bare.algorithms_xfers.ss2fresponse_laub(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_testing(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_horner(ss, sorz, **kwargs)>],
 'ss2poles': [],
 'feedback': [],
 'zpk2fresponse': [],
 'zpk2domainpts': [],
 'ssreduce': [],
 'ss2domainpts': [],
 'domainpts_join': [],
 'ss2zpk': [],
 'zpk2ss': [<function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly_lower(zpk)>]}
{'print_nonzero': {},
 'ss2fresponse': {'ss2fresponse_laub': 100,
  'ss2fresponse_horner': 50,
  'ss2fresponse_testing': 80},
 'ss2poles': {},
 'feedback': {},
 'zpk2fresponse': {},
 'zpk2domainpts': {},
 'ssreduce': {},
 'ss2domainpts': {},
 'domainpts_join': {},
 'ss2zpk': {},
 'zpk2ss': {'zpk2ss_chainE_poly_lower': -60,
  'zpk2ss_chain_poly_lower': -100,
  'zpk2ss_cheby_lower': -80,
  'zpk2ss_chain_poly': 100,
  'zpk2ss_chainE_poly': 1000,
  'zpk2ss_cheby': 80}}
{'print_nonzero': [],
 'ss2fresponse': [<function wield.control.ss_bare.algorithms_xfers.ss2fresponse_laub(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_testing(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_horner(ss, sorz, **kwargs)>],
 'ss2poles': [],
 'feedback': [],
 'zpk2fresponse': [],
 'zpk2domainpts': [],
 'ssreduce': [],
 'ss2domainpts': [],
 'domainpts_join': [],
 'ss2zpk': [],
 'zpk2ss': [<function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly_lower(zpk)>]}
{'print_nonzero': {},
 'ss2fresponse': {'ss2fresponse_laub': 100,
  'ss2fresponse_horner': 50,
  'ss2fresponse_testing': 80},
 'ss2poles': {},
 'feedback': {},
 'zpk2fresponse': {},
 'zpk2domainpts': {},
 'ssreduce': {},
 'ss2domainpts': {},
 'domainpts_join': {},
 'ss2zpk': {},
 'zpk2ss': {'zpk2ss_chainE_poly_lower': -60,
  'zpk2ss_chain_poly_lower': -100,
  'zpk2ss_chainE_poly': 60,
  'zpk2ss_cheby_lower': 1000,
  'zpk2ss_chain_poly': 100,
  'zpk2ss_cheby': 80}}
{'print_nonzero': [],
 'ss2fresponse': [<function wield.control.ss_bare.algorithms_xfers.ss2fresponse_laub(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_testing(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_horner(ss, sorz, **kwargs)>],
 'ss2poles': [],
 'feedback': [],
 'zpk2fresponse': [],
 'zpk2domainpts': [],
 'ssreduce': [],
 'ss2domainpts': [],
 'domainpts_join': [],
 'ss2zpk': [],
 'zpk2ss': [<function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly_lower(zpk)>]}
{'print_nonzero': {},
 'ss2fresponse': {'ss2fresponse_laub': 100,
  'ss2fresponse_horner': 50,
  'ss2fresponse_testing': 80},
 'ss2poles': {},
 'feedback': {},
 'zpk2fresponse': {},
 'zpk2domainpts': {},
 'ssreduce': {},
 'ss2domainpts': {},
 'domainpts_join': {},
 'ss2zpk': {},
 'zpk2ss': {'zpk2ss_chainE_poly_lower': -60,
  'zpk2ss_chain_poly_lower': 1000,
  'zpk2ss_cheby_lower': -80,
  'zpk2ss_chain_poly': 100,
  'zpk2ss_chainE_poly': 60,
  'zpk2ss_cheby': 80}}
{'print_nonzero': [],
 'ss2fresponse': [<function wield.control.ss_bare.algorithms_xfers.ss2fresponse_laub(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_testing(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_horner(ss, sorz, **kwargs)>],
 'ss2poles': [],
 'feedback': [],
 'zpk2fresponse': [],
 'zpk2domainpts': [],
 'ssreduce': [],
 'ss2domainpts': [],
 'domainpts_join': [],
 'ss2zpk': [],
 'zpk2ss': [<function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby_lower(zpk)>]}
{'print_nonzero': {},
 'ss2fresponse': {'ss2fresponse_laub': 100,
  'ss2fresponse_horner': 50,
  'ss2fresponse_testing': 80},
 'ss2poles': {},
 'feedback': {},
 'zpk2fresponse': {},
 'zpk2domainpts': {},
 'ssreduce': {},
 'ss2domainpts': {},
 'domainpts_join': {},
 'ss2zpk': {},
 'zpk2ss': {'zpk2ss_chainE_poly_lower': 1000,
  'zpk2ss_chain_poly_lower': -100,
  'zpk2ss_cheby_lower': -80,
  'zpk2ss_chain_poly': 100,
  'zpk2ss_chainE_poly': 60,
  'zpk2ss_cheby': 80}}
{'print_nonzero': [],
 'ss2fresponse': [<function wield.control.ss_bare.algorithms_xfers.ss2fresponse_laub(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_testing(ss, sorz, **kwargs)>,
  <function wield.control.ss_bare.algorithms_xfers.ss2fresponse_horner(ss, sorz, **kwargs)>],
 'ss2poles': [],
 'feedback': [],
 'zpk2fresponse': [],
 'zpk2domainpts': [],
 'ssreduce': [],
 'ss2domainpts': [],
 'domainpts_join': [],
 'ss2zpk': [],
 'zpk2ss': [<function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chainE_poly(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_cheby_lower(zpk)>,
  <function wield.control.SISO.algorithms_zpk2ss.zpk2ss_chain_poly_lower(zpk)>]}