Skip to content

Commit

Permalink
Addding a theano shim to point to pymc3 and emit deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
dfm committed Nov 2, 2023
1 parent b045496 commit 618c0f1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
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.theano` instead",
DeprecationWarning,
)

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

from celerite2.pymc3.terms import (
ComplexTerm,
Matern32Term,
OriginalCeleriteTerm,
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

0 comments on commit 618c0f1

Please sign in to comment.