From c3ed95d61ed8de3e6500a6a71ee2c3f63cacbd78 Mon Sep 17 00:00:00 2001 From: OPTIMADE Developers Date: Mon, 20 Feb 2023 20:53:22 +0000 Subject: [PATCH] Release v0.21.0 - Changelog --- CHANGELOG.md | 89 ++++++++++++++++++++++++++++++++- docs/static/default_config.json | 2 +- openapi/index_openapi.json | 2 +- openapi/openapi.json | 6 +-- optimade/__init__.py | 2 +- 5 files changed, 93 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df4a2abc0..e358df8d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,94 @@ ## [Unreleased](https://github.com/Materials-Consortia/optimade-python-tools/tree/HEAD) -[Full Changelog](https://github.com/Materials-Consortia/optimade-python-tools/compare/v0.20.3...HEAD) +[Full Changelog](https://github.com/Materials-Consortia/optimade-python-tools/compare/v0.21.0...HEAD) -This release primarily adds compatibility for the newest FastAPI releases (`>=0.87`) by updating our test client to work with both `httpx` and `requests`. +This minor release contains new client functionality and improved support for ASE. + +## New features: + +- Ability to specify async callback functions that are called after every client response. + This can be used for e.g., iteratively saving to file or a database. For example: + + ```python + from optimade.client import OptimadeClient + + DATABASE = pymongo.MongoClient().database.collection + + def save_callback(url, results) -> None: + for structure in results["data"]: + DATABASE.insert_one(structure) + + client = OptimadeClient(callbacks=[save_callback]) + client.get() + ``` + +- Ability to create OPTIMADE structure objects from ASE atoms: + ```python + from optimade.adapters import Structure + from ase import Atoms + + co = Atoms('CO', positions=[(0, 0, 0), (0, 0, 1.1)]) + + structure = Structure.from_ase_atoms(co) + ``` + +- Added ability to mute the client progress bars with `--silent`/`silent=True` and increased default response timeouts to better reflect those required for practical queries. + +## [v0.21.0](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.21.0) (2023-02-20) + +[Full Changelog](https://github.com/Materials-Consortia/optimade-python-tools/compare/v0.20.3...v0.21.0) + +This minor release contains new client functionality and improved support for ASE. + +## New features: + +- Ability to specify async callback functions that are called after every client response. + This can be used for e.g., iteratively saving to file or a database. For example: + + ```python + from optimade.client import OptimadeClient + + DATABASE = pymongo.MongoClient().database.collection + + def save_callback(url, results) -> None: + for structure in results["data"]: + DATABASE.insert_one(structure) + + client = OptimadeClient(callbacks=[save_callback]) + client.get() + ``` + +- Ability to create OPTIMADE structure objects from ASE atoms: + ```python + from optimade.adapters import Structure + from ase import Atoms + + co = Atoms('CO', positions=[(0, 0, 0), (0, 0, 1.1)]) + + structure = Structure.from_ase_atoms(co) + ``` + +- Added ability to mute the client progress bars with `--silent`/`silent=True` and increased default response timeouts to better reflect those required for practical queries. + +**Implemented enhancements:** + +- Add customisable callback functions to client [\#1515](https://github.com/Materials-Consortia/optimade-python-tools/issues/1515) +- Add ability to specify callbacks to run after each client request [\#1519](https://github.com/Materials-Consortia/optimade-python-tools/pull/1519) ([ml-evs](https://github.com/ml-evs)) +- Increase client timeouts and tweak `response_fields` behaviour [\#1514](https://github.com/Materials-Consortia/optimade-python-tools/pull/1514) ([ml-evs](https://github.com/ml-evs)) +- Add ASE ingester and generalize other ingestion utilities [\#1509](https://github.com/Materials-Consortia/optimade-python-tools/pull/1509) ([ml-evs](https://github.com/ml-evs)) + +**Closed issues:** + +- Increase default client timeouts [\#1513](https://github.com/Materials-Consortia/optimade-python-tools/issues/1513) +- Provide basic support for older pymatgen versions in adapters [\#1490](https://github.com/Materials-Consortia/optimade-python-tools/issues/1490) + +**Merged pull requests:** + +- Replace several linters and fixers \(flake8, isort etc.\) with ruff [\#1526](https://github.com/Materials-Consortia/optimade-python-tools/pull/1526) ([ml-evs](https://github.com/ml-evs)) +- Add `--silent` option to suppress client output until results [\#1518](https://github.com/Materials-Consortia/optimade-python-tools/pull/1518) ([ml-evs](https://github.com/ml-evs)) +- Update tests and client to properly test async mode [\#1517](https://github.com/Materials-Consortia/optimade-python-tools/pull/1517) ([ml-evs](https://github.com/ml-evs)) +- Refresh docs style and associated tweaks [\#1516](https://github.com/Materials-Consortia/optimade-python-tools/pull/1516) ([ml-evs](https://github.com/ml-evs)) ## [v0.20.3](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.20.3) (2023-01-09) diff --git a/docs/static/default_config.json b/docs/static/default_config.json index fae0eb919..fea2f47eb 100644 --- a/docs/static/default_config.json +++ b/docs/static/default_config.json @@ -13,7 +13,7 @@ "base_url": null, "implementation": { "name": "OPTIMADE Python Tools", - "version": "0.20.3", + "version": "0.21.0", "source_url": "https://github.com/Materials-Consortia/optimade-python-tools", "maintainer": {"email": "dev@optimade.org"} }, diff --git a/openapi/index_openapi.json b/openapi/index_openapi.json index ffe4713ae..5f3af6eba 100644 --- a/openapi/index_openapi.json +++ b/openapi/index_openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.2", "info": { "title": "OPTIMADE API - Index meta-database", - "description": "The [Open Databases Integration for Materials Design (OPTIMADE) consortium](https://www.optimade.org/) aims to make materials databases interoperational by developing a common REST API.\nThis is the \"special\" index meta-database.\n\nThis specification is generated using [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.20.3) v0.20.3.", + "description": "The [Open Databases Integration for Materials Design (OPTIMADE) consortium](https://www.optimade.org/) aims to make materials databases interoperational by developing a common REST API.\nThis is the \"special\" index meta-database.\n\nThis specification is generated using [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.21.0) v0.21.0.", "version": "1.1.0" }, "paths": { diff --git a/openapi/openapi.json b/openapi/openapi.json index ffa2ed363..2688ce432 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.2", "info": { "title": "OPTIMADE API", - "description": "The [Open Databases Integration for Materials Design (OPTIMADE) consortium](https://www.optimade.org/) aims to make materials databases interoperational by developing a common REST API.\n\nThis specification is generated using [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.20.3) v0.20.3.", + "description": "The [Open Databases Integration for Materials Design (OPTIMADE) consortium](https://www.optimade.org/) aims to make materials databases interoperational by developing a common REST API.\n\nThis specification is generated using [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.21.0) v0.21.0.", "version": "1.1.0" }, "paths": { @@ -3360,8 +3360,8 @@ }, "description": "If present MUST be a list of floats expressed in a.m.u.\nElements denoting vacancies MUST have masses equal to 0.", "x-optimade-support": "optional", - "x-optimade-queryable": "optional", - "x-optimade-unit": "a.m.u." + "x-optimade-unit": "a.m.u.", + "x-optimade-queryable": "optional" }, "original_name": { "title": "Original Name", diff --git a/optimade/__init__.py b/optimade/__init__.py index d495ba7f5..0c4154437 100644 --- a/optimade/__init__.py +++ b/optimade/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.20.3" +__version__ = "0.21.0" __api_version__ = "1.1.0"