Skip to content

Commit

Permalink
rel to abs again
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Dec 7, 2020
1 parent 218dd4a commit 048ce59
Show file tree
Hide file tree
Showing 91 changed files with 337 additions and 329 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ repos:
language: python
name: Check no tests are ignored
pass_filenames: false
- id: reltoabs
entry: python scripts/relative-to-abs.py
language: python
name: rel to scripts/relative-to-abs.py
types: [python]

44 changes: 22 additions & 22 deletions pymc3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ def __set_compiler_flags():

__set_compiler_flags()

from . import gp, ode, sampling
from .backends import load_trace, save_trace
from .backends.tracetab import *
from .blocking import *
from .data import *
from .distributions import *
from .distributions import transforms
from .exceptions import *
from .glm import *
from .math import (
from pymc3 import gp, ode, sampling
from pymc3.backends import load_trace, save_trace
from pymc3.backends.tracetab import *
from pymc3.blocking import *
from pymc3.data import *
from pymc3.distributions import *
from pymc3.distributions import transforms
from pymc3.exceptions import *
from pymc3.glm import *
from pymc3.math import (
expand_packed_triangular,
invlogit,
invprobit,
Expand All @@ -56,15 +56,15 @@ def __set_compiler_flags():
logsumexp,
probit,
)
from .model import *
from .model_graph import model_to_graphviz
from .plots import *
from .sampling import *
from .smc import *
from .stats import *
from .step_methods import *
from .tests import test
from .theanof import *
from .tuning import *
from .variational import *
from .vartypes import *
from pymc3.model import *
from pymc3.model_graph import model_to_graphviz
from pymc3.plots import *
from pymc3.sampling import *
from pymc3.smc import *
from pymc3.stats import *
from pymc3.step_methods import *
from pymc3.tests import test
from pymc3.theanof import *
from pymc3.tuning import *
from pymc3.variational import *
from pymc3.vartypes import *
7 changes: 6 additions & 1 deletion pymc3/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@
Saved backends can be loaded using `arviz.from_netcdf`
"""
from ..backends.ndarray import NDArray, load_trace, point_list_to_multitrace, save_trace
from pymc3.backends.ndarray import (
NDArray,
load_trace,
point_list_to_multitrace,
save_trace,
)
6 changes: 3 additions & 3 deletions pymc3/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import numpy as np
import theano.tensor as tt

from ..model import modelcontext
from ..util import get_var_name
from .report import SamplerReport, merge_reports
from pymc3.backends.report import SamplerReport, merge_reports
from pymc3.model import modelcontext
from pymc3.util import get_var_name

logger = logging.getLogger("pymc3")

Expand Down
2 changes: 1 addition & 1 deletion pymc3/backends/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import arviz

from ..util import get_untransformed_name, is_transformed_name
from pymc3.util import get_untransformed_name, is_transformed_name

logger = logging.getLogger("pymc3")

Expand Down
2 changes: 1 addition & 1 deletion pymc3/backends/tracetab.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import numpy as np
import pandas as pd

from ..util import get_default_varnames
from pymc3.util import get_default_varnames

__all__ = ["trace_to_dataframe"]

Expand Down
2 changes: 1 addition & 1 deletion pymc3/blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import numpy as np

from .util import get_var_name
from pymc3.util import get_var_name

__all__ = ["ArrayOrdering", "DictToArrayBijection", "DictToVarBijection"]

Expand Down
22 changes: 11 additions & 11 deletions pymc3/distributions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from . import shape_utils, timeseries, transforms
from .bart import BART
from .bound import Bound
from .continuous import (
from pymc3.distributions import shape_utils, timeseries, transforms
from pymc3.distributions.bart import BART
from pymc3.distributions.bound import Bound
from pymc3.distributions.continuous import (
Beta,
Cauchy,
ChiSquared,
Expand Down Expand Up @@ -48,7 +48,7 @@
Wald,
Weibull,
)
from .discrete import (
from pymc3.distributions.discrete import (
Bernoulli,
BetaBinomial,
Binomial,
Expand All @@ -66,7 +66,7 @@
ZeroInflatedNegativeBinomial,
ZeroInflatedPoisson,
)
from .distribution import (
from pymc3.distributions.distribution import (
Continuous,
DensityDist,
Discrete,
Expand All @@ -76,8 +76,8 @@
draw_values,
generate_samples,
)
from .mixture import Mixture, MixtureSameFamily, NormalMixture
from .multivariate import (
from pymc3.distributions.mixture import Mixture, MixtureSameFamily, NormalMixture
from pymc3.distributions.multivariate import (
Dirichlet,
KroneckerNormal,
LKJCholeskyCov,
Expand All @@ -89,9 +89,9 @@
Wishart,
WishartBartlett,
)
from .posterior_predictive import fast_sample_posterior_predictive
from .simulator import Simulator
from .timeseries import (
from pymc3.distributions.posterior_predictive import fast_sample_posterior_predictive
from pymc3.distributions.simulator import Simulator
from pymc3.distributions.timeseries import (
AR,
AR1,
GARCH11,
Expand Down
4 changes: 2 additions & 2 deletions pymc3/distributions/bart.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import numpy as np

from .distribution import NoDistribution
from .tree import LeafNode, SplitNode, Tree
from pymc3.distributions.distribution import NoDistribution
from pymc3.distributions.tree import LeafNode, SplitNode, Tree

__all__ = ["BART"]

Expand Down
13 changes: 6 additions & 7 deletions pymc3/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@
from scipy.interpolate import InterpolatedUnivariateSpline
from scipy.special import expit

from pymc3.theanof import floatX

from ..math import invlogit, logdiffexp, logit
from . import transforms
from .dist_math import (
from pymc3.distributions import transforms
from pymc3.distributions.dist_math import (
SplineWrapper,
alltrue_elemwise,
betaln,
Expand All @@ -46,8 +43,10 @@
std_cdf,
zvalue,
)
from .distribution import Continuous, draw_values, generate_samples
from .special import log_i0
from pymc3.distributions.distribution import Continuous, draw_values, generate_samples
from pymc3.distributions.special import log_i0
from pymc3.math import invlogit, logdiffexp, logit
from pymc3.theanof import floatX

__all__ = [
"Uniform",
Expand Down
16 changes: 11 additions & 5 deletions pymc3/distributions/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@

from scipy import stats

from pymc3.distributions.dist_math import (
betaln,
binomln,
bound,
factln,
logpow,
random_choice,
)
from pymc3.distributions.distribution import Discrete, draw_values, generate_samples
from pymc3.distributions.shape_utils import broadcast_distribution_samples
from pymc3.math import log1pexp, logaddexp, logit, sigmoid, tround

from ..theanof import floatX, intX, take_along_axis
from .dist_math import betaln, binomln, bound, factln, logpow, random_choice
from .distribution import Discrete, draw_values, generate_samples
from .shape_utils import broadcast_distribution_samples
from pymc3.theanof import floatX, intX, take_along_axis

__all__ = [
"Binomial",
Expand Down
5 changes: 2 additions & 3 deletions pymc3/distributions/dist_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@
from theano.scan import until
from theano.tensor.slinalg import Cholesky

from pymc3.distributions.shape_utils import to_tuple
from pymc3.distributions.special import gammaln
from pymc3.theanof import floatX

from .shape_utils import to_tuple
from .special import gammaln

f = floatX
c = -0.5 * np.log(2.0 * np.pi)
_beta_clip_values = {
Expand Down
18 changes: 9 additions & 9 deletions pymc3/distributions/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@

from theano import function

from ..memoize import memoize
from ..model import (
from pymc3.distributions.shape_utils import (
broadcast_dist_samples_shape,
get_broadcastable_dist_samples,
to_tuple,
)
from pymc3.memoize import memoize
from pymc3.model import (
ContextMeta,
FreeRV,
Model,
MultiObservedRV,
ObservedRV,
build_named_node_tree,
)
from ..util import get_repr_for_variable, get_var_name
from ..vartypes import string_types, theano_constant
from .shape_utils import (
broadcast_dist_samples_shape,
get_broadcastable_dist_samples,
to_tuple,
)
from pymc3.util import get_repr_for_variable, get_var_name
from pymc3.vartypes import string_types, theano_constant

__all__ = [
"DensityDist",
Expand Down
12 changes: 6 additions & 6 deletions pymc3/distributions/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@
import theano
import theano.tensor as tt

from ..math import logsumexp
from ..theanof import _conversion_map, take_along_axis
from .continuous import Normal, get_tau_sigma
from .dist_math import bound, random_choice
from .distribution import (
from pymc3.distributions.continuous import Normal, get_tau_sigma
from pymc3.distributions.dist_math import bound, random_choice
from pymc3.distributions.distribution import (
Discrete,
Distribution,
_DrawValuesContext,
_DrawValuesContextBlocker,
draw_values,
generate_samples,
)
from .shape_utils import (
from pymc3.distributions.shape_utils import (
broadcast_distribution_samples,
get_broadcastable_dist_samples,
to_tuple,
)
from pymc3.math import logsumexp
from pymc3.theanof import _conversion_map, take_along_axis

__all__ = ["Mixture", "NormalMixture", "MixtureSameFamily"]

Expand Down
19 changes: 9 additions & 10 deletions pymc3/distributions/multivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,21 @@

import pymc3 as pm

from pymc3.theanof import floatX

from ..math import kron_diag, kron_dot, kron_solve_lower, kronecker
from ..model import Deterministic
from . import transforms
from .continuous import ChiSquared, Normal
from .dist_math import bound, factln, logpow
from .distribution import (
from pymc3.distributions import transforms
from pymc3.distributions.continuous import ChiSquared, Normal
from pymc3.distributions.dist_math import bound, factln, logpow
from pymc3.distributions.distribution import (
Continuous,
Discrete,
_DrawValuesContext,
draw_values,
generate_samples,
)
from .shape_utils import broadcast_dist_samples_to, to_tuple
from .special import gammaln, multigammaln
from pymc3.distributions.shape_utils import broadcast_dist_samples_to, to_tuple
from pymc3.distributions.special import gammaln, multigammaln
from pymc3.math import kron_diag, kron_dot, kron_solve_lower, kronecker
from pymc3.model import Deterministic
from pymc3.theanof import floatX

__all__ = [
"MvNormal",
Expand Down
24 changes: 12 additions & 12 deletions pymc3/distributions/posterior_predictive.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@
from typing_extensions import Literal, Protocol
from xarray import Dataset

from ..backends.base import MultiTrace
from ..exceptions import IncorrectArgumentsError
from ..model import (
Model,
MultiObservedRV,
ObservedRV,
get_named_nodes_and_relations,
modelcontext,
)
from ..util import chains_and_samples, dataset_to_point_list, get_var_name
from ..vartypes import theano_constant
from .distribution import (
from pymc3.backends.base import MultiTrace
from pymc3.distributions.distribution import (
_compile_theano_function,
_DrawValuesContext,
_DrawValuesContextBlocker,
is_fast_drawable,
vectorized_ppc,
)
from pymc3.exceptions import IncorrectArgumentsError
from pymc3.model import (
Model,
MultiObservedRV,
ObservedRV,
get_named_nodes_and_relations,
modelcontext,
)
from pymc3.util import chains_and_samples, dataset_to_point_list, get_var_name
from pymc3.vartypes import theano_constant

# Failing tests:
# test_mixture_random_shape::test_mixture_random_shape
Expand Down
2 changes: 1 addition & 1 deletion pymc3/distributions/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from scipy.spatial import cKDTree

from .distribution import NoDistribution, draw_values
from pymc3.distributions.distribution import NoDistribution, draw_values

__all__ = ["Simulator"]

Expand Down
Loading

0 comments on commit 048ce59

Please sign in to comment.