Skip to content

Commit

Permalink
Suppress conditional ujson/json import-related mypy errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi committed Jan 9, 2021
1 parent 0495e84 commit a27b0fa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion arviz/data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
try:
import ujson as json
except ImportError:
import json
# mypy struggles with conditional imports expressed as catching ImportError:
# https://github.com/python/mypy/issues/1153
import json # type: ignore

from .. import __version__, utils

Expand Down
4 changes: 3 additions & 1 deletion arviz/data/inference_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
try:
import ujson as json
except ImportError:
import json
# mypy struggles with conditional imports expressed as catching ImportError:
# https://github.com/python/mypy/issues/1153
import json # type: ignore

SUPPORTED_GROUPS = [
"posterior",
Expand Down
4 changes: 3 additions & 1 deletion arviz/data/io_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import ujson as json
except ImportError:
# Can't find ujson using json
import json
# mypy struggles with conditional imports expressed as catching ImportError:
# https://github.com/python/mypy/issues/1153
import json # type: ignore


def from_json(filename):
Expand Down
4 changes: 3 additions & 1 deletion arviz/data/io_pystan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import ujson as json
except ImportError:
# Can't find ujson using json
import json
# mypy struggles with conditional imports expressed as catching ImportError:
# https://github.com/python/mypy/issues/1153
import json # type: ignore


class PyStanConverter:
Expand Down

0 comments on commit a27b0fa

Please sign in to comment.