Skip to content

Commit

Permalink
CLN run isort on source code files (#4239)
Browse files Browse the repository at this point in the history
  • Loading branch information
chandan5362 authored Dec 7, 2020
1 parent a5d1697 commit 218dd4a
Show file tree
Hide file tree
Showing 149 changed files with 1,079 additions and 806 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ repos:
additional_dependencies: [isort==5.6.4]
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade==2.7.4]

- repo: https://github.com/PyCQA/isort
rev: 5.6.4
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
hooks:
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

import numpy as np
import pandas as pd
import pymc3 as pm
import theano
import theano.tensor as tt

import pymc3 as pm


def glm_hierarchical_model(random_seed=123):
"""Sample glm hierarchical model to use in benchmarks"""
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys

import pymc3

Expand Down
4 changes: 2 additions & 2 deletions docs/source/sphinxext/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
Modified from the seaborn project, which modified the mpld3 project.
"""
import base64
import glob
import json
import os
import glob
import shutil
import runpy
import shutil

import matplotlib

Expand Down
31 changes: 13 additions & 18 deletions pymc3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,33 @@ 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 . import gp
from .math import (
expand_packed_triangular,
invlogit,
invprobit,
logaddexp,
logsumexp,
logit,
invlogit,
expand_packed_triangular,
logsumexp,
probit,
invprobit,
)
from .model import *
from .model_graph import model_to_graphviz
from . import ode
from .stats import *
from .plots import *
from .sampling import *
from .step_methods 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 .exceptions import *
from . import sampling

from .backends.tracetab import *
from .backends import save_trace, load_trace

from .plots import *
from .tests import test

from .data import *
2 changes: 1 addition & 1 deletion pymc3/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
Saved backends can be loaded using `arviz.from_netcdf`
"""
from ..backends.ndarray import NDArray, save_trace, load_trace, point_list_to_multitrace
from ..backends.ndarray import NDArray, load_trace, point_list_to_multitrace, save_trace
7 changes: 4 additions & 3 deletions pymc3/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
"""
import itertools as itl
import logging
from typing import List
import warnings

from abc import ABC
from typing import List

import numpy as np
import warnings
import theano.tensor as tt

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

logger = logging.getLogger("pymc3")

Expand Down
6 changes: 4 additions & 2 deletions pymc3/backends/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
import json
import os
import shutil
from typing import Optional, Dict, Any, List
import warnings

from typing import Any, Dict, List, Optional

import numpy as np

from pymc3.backends import base
from pymc3.backends.base import MultiTrace
from pymc3.model import Model, modelcontext
from pymc3.exceptions import TraceDirectoryError
from pymc3.model import Model, modelcontext


def save_trace(trace: MultiTrace, directory: Optional[str] = None, overwrite=False) -> str:
Expand Down
9 changes: 5 additions & 4 deletions pymc3/backends/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import logging
import enum
from typing import Any, Optional
import dataclasses
import enum
import logging

from ..util import is_transformed_name, get_untransformed_name
from typing import Any, Optional

import arviz

from ..util import get_untransformed_name, is_transformed_name

logger = logging.getLogger("pymc3")


Expand Down
3 changes: 2 additions & 1 deletion pymc3/backends/tracetab.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
"""Functions for converting traces into a table-like format
"""

import warnings

import numpy as np
import pandas as pd
import warnings

from ..util import get_default_varnames

Expand Down
3 changes: 2 additions & 1 deletion pymc3/blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
Classes for working with subsets of parameters.
"""
import collections
import copy

import numpy as np
import collections

from .util import get_var_name

Expand Down
10 changes: 6 additions & 4 deletions pymc3/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@
# limitations under the License.

import collections
from copy import copy
import io
import os
import pkgutil
from typing import Dict, List, Any

from copy import copy
from typing import Any, Dict, List

import numpy as np
import pandas as pd
import pymc3 as pm
import theano.tensor as tt
import theano
import theano.tensor as tt

import pymc3 as pm

__all__ = [
"get_data",
Expand Down
Loading

0 comments on commit 218dd4a

Please sign in to comment.