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

Adding a theano shim to point to pymc3 and emit deprecation warning #92

Merged
merged 3 commits into from
Nov 20, 2023
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
12 changes: 12 additions & 0 deletions python/celerite2/theano/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
__all__ = ["terms", "GaussianProcess"]

import warnings

warnings.warn(
"The `celerite2.theano` submodule is deprecated; "
"use `celerite2.pymc3` instead",
DeprecationWarning,
)

from celerite2.pymc3.celerite2 import GaussianProcess
from celerite2.theano import terms
25 changes: 25 additions & 0 deletions python/celerite2/theano/terms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
__all__ = [
"Term",
"TermSum",
"TermProduct",
"TermDiff",
"TermConvolution",
"RealTerm",
"ComplexTerm",
"SHOTerm",
"Matern32Term",
"RotationTerm",
]

from celerite2.pymc3.terms import (
ComplexTerm,
Matern32Term,
RealTerm,
RotationTerm,
SHOTerm,
Term,
TermConvolution,
TermDiff,
TermProduct,
TermSum,
)
7 changes: 7 additions & 0 deletions python/test/pymc3/test_pymc3_celerite2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
)


def test_theano_import_warns():
with pytest.deprecated_call():
import celerite2.theano

del celerite2.theano


@pytest.fixture
def data():
np.random.seed(40582)
Expand Down
Loading