Skip to content

Commit

Permalink
Make pymc optional (#42)
Browse files Browse the repository at this point in the history
* make pymc optional

* up version and add test dep

* accidental file
  • Loading branch information
wd60622 authored Jan 22, 2024
1 parent 8dbe4a6 commit 9bfddd2
Show file tree
Hide file tree
Showing 3 changed files with 645 additions and 696 deletions.
22 changes: 19 additions & 3 deletions latent_calendar/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@
import numpy as np
import pandas as pd

import pymc as pm
from pytensor.tensor import TensorVariable

from latent_calendar.const import FULL_VOCAB

try:
import pymc as pm
from pytensor.tensor import TensorVariable
except ImportError:

class TensorVariable:
pass

class PyMC:
def __getattr__(self, name):
msg = (
"PyMC is not installed."
" Please install it directly or"
" with extra installs: pip install 'latent-calendar[pymc]'"
)
raise ImportError(msg)

pm = PyMC()


def wide_format_dataframe(
n_rows: int, rate: float = 1.0, random_state: Optional[int] = None
Expand Down
Loading

0 comments on commit 9bfddd2

Please sign in to comment.