Skip to content

Commit

Permalink
Merge branch 'main' into auto-dependency-upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury authored Feb 6, 2025
2 parents 33e595b + 5fd5603 commit 9b2c4e6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 28 deletions.
54 changes: 31 additions & 23 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Changelog

## [Unreleased](https://github.com/materialsproject/maggma/tree/HEAD)
## [v0.71.3](https://github.com/materialsproject/maggma/tree/v0.71.3) (2025-02-06)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.71.2...HEAD)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.71.2...v0.71.3)

**Implemented enhancements:**

- zopen: add explicit encoding to read\_json; explicit mode [\#1030](https://github.com/materialsproject/maggma/pull/1030) ([rkingsbury](https://github.com/rkingsbury))

**Fixed bugs:**

- \[Bug\]: monty's zopen expects keyword `mode` to be set [\#1024](https://github.com/materialsproject/maggma/issues/1024)

**Merged pull requests:**

- Remove python 3.8 classifier from pyproject.toml [\#1029](https://github.com/materialsproject/maggma/pull/1029) ([Andrew-S-Rosen](https://github.com/Andrew-S-Rosen))

## [v0.71.2](https://github.com/materialsproject/maggma/tree/v0.71.2) (2025-01-21)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.71.1...v0.71.2)
Expand Down Expand Up @@ -472,19 +480,19 @@

## [v0.53.0](https://github.com/materialsproject/maggma/tree/v0.53.0) (2023-08-02)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.52.1...v0.53.0)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.52.2...v0.53.0)

**Merged pull requests:**

- allow \>5GB and turn on multi-part uploads for AWS [\#829](https://github.com/materialsproject/maggma/pull/829) ([kbuma](https://github.com/kbuma))

## [v0.52.1](https://github.com/materialsproject/maggma/tree/v0.52.1) (2023-08-02)
## [v0.52.2](https://github.com/materialsproject/maggma/tree/v0.52.2) (2023-08-02)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.52.2...v0.52.1)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.52.1...v0.52.2)

## [v0.52.2](https://github.com/materialsproject/maggma/tree/v0.52.2) (2023-08-02)
## [v0.52.1](https://github.com/materialsproject/maggma/tree/v0.52.1) (2023-08-02)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.52.0...v0.52.2)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.52.0...v0.52.1)

**Merged pull requests:**

Expand Down Expand Up @@ -672,19 +680,19 @@

## [v0.51.4](https://github.com/materialsproject/maggma/tree/v0.51.4) (2023-06-02)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.51.2...v0.51.4)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.51.3...v0.51.4)

**Merged pull requests:**

- modify JSONStore file creation [\#792](https://github.com/materialsproject/maggma/pull/792) ([gpetretto](https://github.com/gpetretto))

## [v0.51.2](https://github.com/materialsproject/maggma/tree/v0.51.2) (2023-05-29)
## [v0.51.3](https://github.com/materialsproject/maggma/tree/v0.51.3) (2023-05-29)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.51.3...v0.51.2)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.51.2...v0.51.3)

## [v0.51.3](https://github.com/materialsproject/maggma/tree/v0.51.3) (2023-05-29)
## [v0.51.2](https://github.com/materialsproject/maggma/tree/v0.51.2) (2023-05-29)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.51.1...v0.51.3)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.51.1...v0.51.2)

**Merged pull requests:**

Expand Down Expand Up @@ -821,19 +829,19 @@

## [v0.49.9](https://github.com/materialsproject/maggma/tree/v0.49.9) (2022-11-01)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.49.7...v0.49.9)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.49.8...v0.49.9)

**Merged pull requests:**

- Parse datetime with dateutil [\#741](https://github.com/materialsproject/maggma/pull/741) ([munrojm](https://github.com/munrojm))

## [v0.49.7](https://github.com/materialsproject/maggma/tree/v0.49.7) (2022-10-25)
## [v0.49.8](https://github.com/materialsproject/maggma/tree/v0.49.8) (2022-10-25)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.49.8...v0.49.7)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.49.7...v0.49.8)

## [v0.49.8](https://github.com/materialsproject/maggma/tree/v0.49.8) (2022-10-25)
## [v0.49.7](https://github.com/materialsproject/maggma/tree/v0.49.7) (2022-10-25)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.49.6...v0.49.8)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.49.6...v0.49.7)

**Merged pull requests:**

Expand Down Expand Up @@ -1042,23 +1050,23 @@

## [v0.44.1](https://github.com/materialsproject/maggma/tree/v0.44.1) (2022-03-08)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.42.0...v0.44.1)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.43.0...v0.44.1)

**Merged pull requests:**

- added localhost test for MongoURIStore [\#595](https://github.com/materialsproject/maggma/pull/595) ([jmmshn](https://github.com/jmmshn))

## [v0.42.0](https://github.com/materialsproject/maggma/tree/v0.42.0) (2022-03-07)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.43.0...v0.42.0)

## [v0.43.0](https://github.com/materialsproject/maggma/tree/v0.43.0) (2022-03-07)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.44.0...v0.43.0)

## [v0.44.0](https://github.com/materialsproject/maggma/tree/v0.44.0) (2022-03-07)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.41.1...v0.44.0)
[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.42.0...v0.44.0)

## [v0.42.0](https://github.com/materialsproject/maggma/tree/v0.42.0) (2022-03-07)

[Full Changelog](https://github.com/materialsproject/maggma/compare/v0.41.1...v0.42.0)

**Merged pull requests:**

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"ruamel.yaml>=0.17",
"pydantic>=2.0",
"pydantic-settings>=2.0.3",
"pymongo>=4.2.0",
"pymongo>=4.2.0,<4.11",
"monty>=2024.5.24",
"mongomock>=3.10.0",
"pydash>=4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/maggma/stores/file_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def query( # type: ignore
# TODO - could add more logic for detecting different file types
# and more nuanced exception handling
try:
with zopen(d["path"], "rt", encoding=self.encoding) as f:
with zopen(d["path"], mode="rt", encoding=self.encoding) as f:
data = f.read()
except Exception as e:
data = f"Unable to read: {e}"
Expand Down
6 changes: 3 additions & 3 deletions src/maggma/stores/mongolike.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def connect(self, force_reset: bool = False):

# create the .json file if it does not exist
if not self.read_only and not Path(self.paths[0]).exists():
with zopen(self.paths[0], "wt", encoding=self.encoding) as f:
with zopen(self.paths[0], mode="wt", encoding=self.encoding) as f:
data: list[dict] = []
bytesdata = orjson.dumps(data)
f.write(bytesdata.decode("utf-8"))
Expand All @@ -711,7 +711,7 @@ def read_json_file(self, path) -> list:
Args:
path: Path to the JSON file to be read
"""
with zopen(path, "rt") as f:
with zopen(path, mode="rt", encoding=self.encoding) as f:
data = f.read()
data = data.decode() if isinstance(data, bytes) else data
objects = bson.json_util.loads(data) if "$oid" in data else orjson.loads(data)
Expand Down Expand Up @@ -761,7 +761,7 @@ def update_json_file(self):
"""
Updates the json file when a write-like operation is performed.
"""
with zopen(self.paths[0], "wt", encoding=self.encoding) as f:
with zopen(self.paths[0], mode="wt", encoding=self.encoding) as f:
data = list(self.query())
for d in data:
d.pop("_id")
Expand Down

0 comments on commit 9b2c4e6

Please sign in to comment.