Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Jul 27, 2023
1 parent fc4e615 commit 3d1c2a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cvx/bson/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ def from_bson(bson_str: bytes) -> MATRICES:
data = bson.loads(bson_str)

# for name, value in data.items():
return {name: pa.ipc.read_tensor(value).to_numpy() for name, value in
data.items()}
return {name: pa.ipc.read_tensor(value).to_numpy() for name, value in data.items()}
4 changes: 3 additions & 1 deletion tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from cvx.json import read_json, write_json


@pytest.mark.parametrize("shape", [(50, 50), (1000, 50), (50, 1000), (1000, 1000), (5000, 2000)])
@pytest.mark.parametrize(
"shape", [(50, 50), (1000, 50), (50, 1000), (1000, 1000), (5000, 2000)]
)
def test_read_and_write_json(tmp_path, shape):
data = {"a": np.random.rand(*shape), "b": 3.0, "c": "test"}
write_json(tmp_path / "test.json", data)
Expand Down

0 comments on commit 3d1c2a3

Please sign in to comment.