How to use PyDMD - 10 common examples

To help you get started, we’ve selected a few PyDMD examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_partial_dynamics1(self):
        max_level = 5
        level = 2
        rank = 2
        dmd = MrDMD(svd_rank=rank, max_level=max_level, max_cycles=2)
        dmd.fit(X=sample_data)
        pdynamics = dmd.partial_dynamics(level)
        assert pdynamics.shape == (2**level * rank, sample_data.shape[1])
github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_shape_modes(self):
        level = 5
        dmd = MrDMD(svd_rank=1, max_level=level, max_cycles=2)
        dmd.fit(X=sample_data)
        assert dmd.modes.shape == (sample_data.shape[0], 2**level - 1)
github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_partial_eigs2(self):
        max_level = 5
        level = 2
        rank = 2
        dmd = MrDMD(svd_rank=rank, max_level=max_level, max_cycles=2)
        dmd.fit(X=sample_data)
        peigs = dmd.partial_eigs(level, 3)
        assert peigs.shape == (rank, )
github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_partial_eigs1(self):
        max_level = 5
        level = 2
        rank = 2
        dmd = MrDMD(svd_rank=rank, max_level=max_level, max_cycles=2)
        dmd.fit(X=sample_data)
        peigs = dmd.partial_eigs(level)
        assert peigs.shape == (rank * 2**level, )
github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_plot_eig3(self):
        dmd = MrDMD(svd_rank=-1, max_level=7, max_cycles=1)
        dmd.fit(X=sample_data)
        dmd.plot_eigs(show_axes=False, show_unit_circle=False, level=1, node=0)
        plt.close()
github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_partial_reconstructed2(self):
        max_level = 5
        level = 2
        rank = 2
        dmd = MrDMD(svd_rank=rank, max_level=max_level, max_cycles=2)
        dmd.fit(X=sample_data)
        pdata = dmd.partial_reconstructed_data(level, 3)
        assert pdata.shape == (sample_data.shape[0], old_div(
            sample_data.shape[1], 2**level))
github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_partial_dynamics2(self):
        max_level = 5
        level = 2
        rank = 2
        dmd = MrDMD(svd_rank=rank, max_level=max_level, max_cycles=2)
        dmd.fit(X=sample_data)
        pdynamics = dmd.partial_dynamics(level, 3)
        assert pdynamics.shape == (rank, old_div(sample_data.shape[1], 2**level)
                                   )
github mathLab / PyDMD / tests / test_mrdmd.py View on Github external
def test_time_window_growth_rate(self):
        level = 3
        dmd = MrDMD(svd_rank=1, max_level=level, max_cycles=2)
        dmd.fit(X=sample_data)
        assert len(dmd.time_window_growth_rate(0, dmd._snapshots.shape[1])) == 7
github mathLab / PyDMD / tests / test_dmd.py View on Github external
def test_truncation_shape(self):
        dmd = DMD(svd_rank=3)
        dmd.fit(X=sample_data)
        assert dmd.modes.shape[1] == 3
github mathLab / PyDMD / tests / test_dmd.py View on Github external
def test_dynamics_opt_1(self):
        dmd = DMD(svd_rank=5, opt=True)
        dmd.fit(X=sample_data)
        assert dmd.dynamics.shape == (5, sample_data.shape[1])