Skip to content

Commit

Permalink
Adding a theano shim to point to pymc3 and emit deprecation warning (#92
Browse files Browse the repository at this point in the history
)

* Addding a theano shim to point to pymc3 and emit deprecation warning

* Fixing imports in shim

* Update __init__.py
  • Loading branch information
dfm authored Nov 20, 2023
1 parent 863c472 commit 9550538
Show file tree
Hide file tree
Showing 3 changed files with 44 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.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

0 comments on commit 9550538

Please sign in to comment.