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
3 changes: 2 additions & 1 deletion pymc_extras/inference/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import arviz as az


def fit(method, **kwargs):
def fit(method: str, **kwargs) -> az.InferenceData:
"""
Fit a model with an inference algorithm

Expand Down
6 changes: 2 additions & 4 deletions pymc_extras/inference/pathfinder/pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
from collections.abc import Callable, Iterator
from dataclasses import asdict, dataclass, field, replace
from enum import Enum, auto
from importlib.util import find_spec
from typing import Literal, TypeAlias

import arviz as az
import blackjax
import filelock
import jax
import numpy as np
Expand Down Expand Up @@ -1736,8 +1734,8 @@ def fit_pathfinder(
)
pathfinder_samples = mp_result.samples
elif inference_backend == "blackjax":
if find_spec("blackjax") is None:
raise RuntimeError("Need BlackJAX to use `pathfinder`")
import blackjax

if version.parse(blackjax.__version__).major < 1:
raise ImportError("fit_pathfinder requires blackjax 1.0 or above")

Expand Down