Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in test_dmd.test_predict_exact() #435

Open
sichinaga opened this issue Jul 27, 2023 · 2 comments
Open

Bug in test_dmd.test_predict_exact() #435

sichinaga opened this issue Jul 27, 2023 · 2 comments
Assignees

Comments

@sichinaga
Copy link
Contributor

Describe the bug
The test_predict_exact() test in the test_dmd.py file ends up comparing two empty arrays, which doesn't seem to correctly assess for accurate dmd.predict outputs when exact=True. It seems that the expected array, which is used as the ground truth, is just an empty array. This array is then compared against dmd.predict(sample_data[:, 20:40]) when sample_data is only a (400, 15) array.

To Reproduce
Below is the test_predict_exact() test, with an additional print statement in order to highlight the issue.

import numpy as np
from pytest import raises

from pydmd.dmd import DMD

sample_data = np.load("tests/test_datasets/input_sample.npy")

def test_predict_exact():
    dmd = DMD(exact=True)
    expected = np.load("tests/test_datasets/input_sample_predict_exact.npy")

    np.testing.assert_almost_equal(
        dmd.fit(sample_data).predict(sample_data[:, 20:40]), expected, decimal=6
    )
    print(expected)

test_predict_exact()

Expected behavior
dmd.predict(sample_data) and expected should be non-empty arrays so that test_predict_exact() actually tests for accurate dmd.predict outputs when exact=True.

Output
expected turns out to be an empty array.

>>> []
@ayeankit
Copy link

ayeankit commented Mar 5, 2024

hey @sichinaga, I would like to work on this. Can you assign me this issue?

@mtezzele
Copy link
Contributor

mtezzele commented Mar 5, 2024

Hi @ayeankit! I assigned you to this issue. Let us know if you need help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants