Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace external "simplejson" backport from Py3 to Py3 with plain "json" module #454

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ multiprocess
click
asciitree
pyyaml
simplejson
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ dependencies = [
"pyfaidx",
"asciitree",
"pyyaml",
"simplejson",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/cooler/api.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import annotations

import json
import os

import h5py
import numpy as np
import pandas as pd
import simplejson as json
from pandas.api.types import is_integer_dtype
from scipy.sparse import coo_matrix

Expand Down
2 changes: 1 addition & 1 deletion src/cooler/cli/cload.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import sys

import click
import h5py
import numpy as np
import pandas as pd
import simplejson as json
from cytoolz import compose
from multiprocess import Pool

Expand Down
2 changes: 1 addition & 1 deletion src/cooler/cli/info.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import sys

import click
import simplejson as json

from ..api import Cooler
from ..util import attrs_to_jsonable
Expand Down
2 changes: 1 addition & 1 deletion src/cooler/cli/load.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
import sys

import click
import numpy as np
import pandas as pd
import simplejson as json

from ..create import (
BIN_DTYPE,
Expand Down
2 changes: 1 addition & 1 deletion src/cooler/create/_create.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import json
import os
import os.path as op
import posixpath
Expand All @@ -12,7 +13,6 @@
import h5py
import numpy as np
import pandas as pd
import simplejson as json

from .._logging import get_logger
from .._typing import Tabular
Expand Down
13 changes: 3 additions & 10 deletions src/cooler/fileops.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
from __future__ import annotations

import os

# from textwrap import dedent
import json
import os
import warnings
from collections.abc import Callable
from datetime import datetime
from numbers import Number
from typing import Any, Literal

import simplejson as json

try:
from simplejson import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError # PY35+

import h5py
import numpy as np
from asciitree import BoxStyle, LeftAligned
Expand Down Expand Up @@ -56,7 +49,7 @@ def decode_attr_value(
except ValueError:
try:
o = json.loads(obj)
except JSONDecodeError:
except ValueError:
o = obj
else:
o = obj
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli_ingest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# from io import StringIO
import json
import os.path as op
import tempfile
from glob import glob

import numpy as np
import pandas as pd
import pytest
import simplejson as json

# from _common import cooler_cmp
from click.testing import CliRunner
Expand Down
Loading