Skip to content

Commit

Permalink
migrate get_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Dec 21, 2024
1 parent 6cd7044 commit 704af12
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/pyhf/cli/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from pyhf.infer import hypotest
from pyhf.infer import mle
from pyhf.workspace import Workspace
from pyhf import get_backend, set_backend, optimize
from pyhf.tensor.manager import get_backend, set_backend
from pyhf import optimize

log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/infer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Inference for Statistical Models."""

from pyhf.infer import utils
from pyhf import get_backend
from pyhf.tensor.manager import get_backend
from pyhf import exceptions


Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/infer/calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""

from pyhf.infer.mle import fixed_poi_fit
from pyhf import get_backend
from pyhf.tensor.manager import get_backend
from pyhf.infer import utils
import tqdm

Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/infer/intervals/upper_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from scipy.optimize import toms748

from pyhf import get_backend
from pyhf.tensor.manager import get_backend
from pyhf.infer import hypotest

__all__ = ["linear_grid_scan", "toms748_scan", "upper_limit"]
Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/infer/mle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module for Maximum Likelihood Estimation."""

from pyhf import get_backend
from pyhf.tensor.manager import get_backend
from pyhf.exceptions import UnspecifiedPOI

__all__ = ["fit", "fixed_poi_fit", "twice_nll"]
Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/infer/test_statistics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pyhf import get_backend
from pyhf.tensor.manager import get_backend
from pyhf.infer.mle import fixed_poi_fit, fit
from pyhf.exceptions import UnspecifiedPOI

Expand Down
3 changes: 2 additions & 1 deletion src/pyhf/modifiers/lumi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging

import pyhf
from pyhf import get_backend, events
from pyhf.tensor.manager import get_backend
from pyhf import events
from pyhf.parameters import ParamViewer

log = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion src/pyhf/modifiers/normfactor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging

import pyhf
from pyhf import get_backend, events
from pyhf.tensor.manager import get_backend
from pyhf import events
from pyhf.parameters import ParamViewer

log = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion src/pyhf/modifiers/normsys.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging

import pyhf
from pyhf import get_backend, events
from pyhf.tensor.manager import get_backend
from pyhf import events
from pyhf import interpolators
from pyhf.parameters import ParamViewer

Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/optimize/opt_jax.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""JAX Backend Function Shim."""

from pyhf import get_backend
from pyhf.tensor.manager import get_backend
from pyhf.tensor.common import _TensorViewer
import jax
import logging
Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/optimize/opt_numpy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Numpy Backend Function Shim."""

from pyhf import get_backend
from pyhf.tensor.manager import get_backend
from pyhf import exceptions


Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/optimize/opt_pytorch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""PyTorch Backend Function Shim."""

from pyhf import get_backend
from pyhf.tensor.manager import get_backend
import torch


Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/optimize/opt_tflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Tensorflow Backend Function Shim."""

from pyhf import get_backend
from pyhf.tensor.manager import get_backend
import tensorflow as tf


Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/probability.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The probability density function module."""

from pyhf import get_backend
from pyhf.tensor.manager import get_backend

__all__ = ["Independent", "Normal", "Poisson", "Simultaneous"]

Expand Down

0 comments on commit 704af12

Please sign in to comment.