Skip to content

Commit

Permalink
Release v0.21.0 - Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
bot-optimade committed Feb 20, 2023
1 parent eee40df commit c3ed95d
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 8 deletions.
89 changes: 87 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion docs/static/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
},
Expand Down
2 changes: 1 addition & 1 deletion openapi/index_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion optimade/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.20.3"
__version__ = "0.21.0"
__api_version__ = "1.1.0"

0 comments on commit c3ed95d

Please sign in to comment.