Source code for wield.control.fitting.SISO.test.v2.test_oplev

# -*- coding: utf-8 -*-
"""
"""

import pytest
from os import path
from wield.pytest import tjoin

from wield.control.fitting.SISO import v2
from wield.control.fitting.SISO.testing.plots import plot_on_assert

from wield.control.fitting.SISO.testing.utilities import (
    sign_validate_and_plot_hint,
    stability_validate_and_plot_hint,
)

try:
    from wield.control.fitting.SISO.testing.test_data import matlab as matlab_test_data
except ImportError:
    module_import_skip = True
else:
    module_import_skip = False

localpath = path.split(__file__)[0]
skipdeco = pytest.mark.skipif(
    module_import_skip, reason="cannot import test_data_dev"
)


[docs] @pytest.mark.xfail(True, reason="Triggering some overflow to look into") @skipdeco def test_oplev_iy(): from wield.utilities.file_io import load_any fname = matlab_test_data.matfiles["OplevPlant.mat"] fdict = load_any(fname=fname, ftype="mat") out = v2.data2filter( F_Hz=fdict["ap"]["iy"]["ff"], data=fdict["ap"]["iy"]["plant"], F_nyquist_Hz=None, delay_s=0, hints=[sign_validate_and_plot_hint(tjoin('error'))], ) with plot_on_assert(tjoin('output'), out.fitter, plot_anyway=True): pass return
#@skipdeco #def test_oplev_iy(): # from wield.utilities.file_io import load_any # # fname = matlab_test_data.matfiles["OplevPlant.mat"] # fdict = load_any(fname=fname, ftype="mat") # # out = v2.data2filter( # F_Hz=fdict["ap"]["iy"]["ff"], # data=fdict["ap"]["iy"]["plant"], # never_unstable_poles=True, # never_unstable_zeros=True, # mode="rational", # # hints=[stability_validate_and_plot_hint(tjoin('error'))], # ) # print(out.fitter.poles) # with plot_on_assert(tjoin('output'), out.fitter, plot_anyway=True): # pass # return