Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test_src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 10 additions & 0 deletions docs/literature.bib
Original file line number Diff line number Diff line change
Expand Up @@ -656,3 +656,13 @@ @article{vijaywargiya2025tensoropinf
doi = {10.48550/arXiv.2502.10888},
category = {structure}
}

@article{kang2025semiconductor,
title = {Parametric {O}perator {I}nference to simulate the purging process in semiconductor manufacturing},
author = {Seunghyon Kang and Hyeonghun Kim and Boris Kramer},
journal = {arXiv},
volume = {2504.03990},
year = {2025},
doi = {10.48550/arXiv.2504.03990},
category = {application}
}
7 changes: 7 additions & 0 deletions docs/source/opinf/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
New versions may introduce substantial new features or API adjustments.
:::

## Version 0.5.14

- Catch any errors in `fit_regselect*()` that occur when the model uses `refit()`.
- Tikhonov-type least-squares solvers do not require the regularizer in the constructor but will raise an `AttributeError` in `solve()` (and other methods) if the regularizer is not set. This makes using `fit_regselect_*()` much less cumbersome.
- `PODBasis.fit(Q)` raises a warning when using the `"method-of-snapshots"`/`"eigh"` strategy if $n < k$ for $\mathbf{Q}\in\mathbb{R}^{n \times k}.$ In this case, calculating the $n \times k$ SVD is likely more efficient than the $k \times k$ eigenvalue problem.
- Added Python 3.13 to list of tests.

## Version 0.5.13

Bayesian operator inference:
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ dependencies = [
[project.optional-dependencies]
dev = [
"bibtexparser>=2.0.0b7",
"tox>=4",
"pre-commit>=3.7.1",
"flake8==7.0.0",
"black==24.4.2",
"flake8==7.0.0",
"jupyterlab",
"pandas",
"notebook",
"pandas",
"pre-commit>=3.7.1",
"tox>=4",
]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion src/opinf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
https://github.com/Willcox-Research-Group/rom-operator-inference-Python3
"""

__version__ = "0.5.13"
__version__ = "0.5.14"

from . import (
basis,
Expand Down
11 changes: 9 additions & 2 deletions src/opinf/basis/_pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def method_of_snapshots(
----------
states : (n, k) ndarray,
Snapshot matrix :math:`\Q` from which to compute the POD vectors.
This method is computationally efficient when n >> k.
inner_product_matrix : (n, n) sparse SPD matrix or None
Spatial inner product matrix :math:`\W` for measuring how different
indices in the snapshot matrix interact with each other.
Expand Down Expand Up @@ -100,7 +101,13 @@ def method_of_snapshots(
any negative eigenvalues, then ``minthresh`` is increased to the absolute
value of the most negative eigenvalue.
"""
n_states = states.shape[1]
state_dimension, n_states = states.shape
if n_states > state_dimension:
warnings.warn(
"state dimension < number of states, "
"method-of-snapshots / eigh may be inefficient",
errors.OpInfWarning,
)
if inner_product_matrix is None:
gramian = states.T @ (states / n_states)
else:
Expand All @@ -113,7 +120,7 @@ def method_of_snapshots(
eigvals = eigvals[::-1]
eigvecs = eigvecs[:, ::-1]

# NOTE: By definition the Gramian is symmetric positive semi-definite.
# By definition the Gramian is symmetric positive semi-definite.
# If any eigenvalues are smaller than zero, they are only measuring
# numerical error and can be truncated.
positives = eigvals > max(minthresh, abs(np.min(eigvals)))
Expand Down
Loading