dagghe / pyOMA2

Python module for conducting operational modal analysis
MIT License
14 stars 4 forks source link

Error after recent update #13

Open Ayubirad opened 3 months ago

Ayubirad commented 3 months ago

Dear @dagghe

I hope you are donig well. Unfortunately after the recent update the following error has occured: This is the code I run:

ssicov = SSIcov_algo(name="SSIcov", br=60, method='cov_mm' , ordmin=2, ordmax=200, step=2, err_fn=0.01,
                     err_xi=0.05, err_phi=0.02, xi_max=0.05, mpc_lim=(0.7,), mpd_lim=(0.3,))
SS.add_algorithms(ssicov)
SS.run_by_name("SSIcov")

The error occurs in this part of the Gen_funct.py:

    # Checking MPC AND MPD
    if mpc_lim is not None:
        Mask1 = []
        for o in range(Fn1.shape[0]):
            for i in range(Fn1.shape[1]):
                try:
                    Mask1.append((MPC(Ms1[o, i, :]) >= mpc_lim).astype(int))

and here's the error:

numpy.linalg.LinAlgError: Array must not contain infs or NaNs

  File ~\anaconda3\Lib\site-packages\pyoma2\functions\Gen_funct.py:106 in lab_stab
    Mask1 = np.array(Mask1).reshape(Fn1.shape)

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (20200,) + inhomogeneous part.
dagghe commented 3 months ago

Dear @Ayubirad I haven’t done any testing yet but as a first thing I would try using floats instead of tuples for mpc and mpd. Then I should mention that I found a bug that could compromise the results when using different values from ordmin=0 and step!=1. I have fixed this and other things in the branch pushed recently, which will become a release on the main branch soon.

Ayubirad commented 3 months ago

Dear @dagghe Thanks for the quick reply. You're right, I think the issue was from the recent update in the run_params.py:

mpc_lim: typing.Optional[typing.Tuple] = 0.7
mpd_lim: typing.Optional[typing.Tuple] = 0.3

These lines should be changes to:

mpc_lim: typing.Optional[float] = 0.7
mpd_lim: typing.Optional[float] = 0.3

I genuinely appreciate your support and expertise!