Skip to content

Commit

Permalink
Update optimade[mongo] requirement from ~=0.17.2 to ~=0.18.0 (#357)
Browse files Browse the repository at this point in the history
* Update optimade[mongo] requirement from ~=0.17.2 to ~=0.18.0

Updates the requirements on [optimade[mongo]](https://github.com/Materials-Consortia/optimade-python-tools) to permit the latest version.
- [Release notes](https://github.com/Materials-Consortia/optimade-python-tools/releases)
- [Changelog](https://github.com/Materials-Consortia/optimade-python-tools/blob/master/CHANGELOG.md)
- [Commits](Materials-Consortia/optimade-python-tools@v0.17.2...v0.18.0)

---
updated-dependencies:
- dependency-name: optimade[mongo]
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update AiiDA/OPTIMADE

* Use "default" instead of "const"

* Use new `x-optimade-` prefixed extra schema keys

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: The AiiDA Team <developers@aiida.net>
Co-authored-by: Casper Welzel Andersen <casper.w.andersen@sintef.no>
  • Loading branch information
3 people committed Jun 7, 2022
1 parent 1859c8e commit e49337c
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:3.8
WORKDIR /app

# Install specific optimade and aiida-core versions
ARG OPTIMADE_TOOLS_VERSION=0.17.2
ARG OPTIMADE_TOOLS_VERSION=0.18.0
ARG AIIDA_VERSION=1.6.8

# Copy repo contents
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Latest release | Build status | Activity |
|:--------------:|:------------:|:--------:|
| [![AiiDA](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/aiidateam/aiida-optimade/develop/.ci/aiida-version.json)](https://github.com/aiidateam/aiida-core/)<br>[![PyPI](https://img.shields.io/pypi/v/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![OPTIMADE](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/v0.17.2/optimade-version.json)](https://github.com/Materials-Consortia/OPTIMADE/) | [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/aiidateam/aiida-optimade/aiida-optimade)](https://github.com/aiidateam/aiida-optimade/actions/)<br>[![Codecov](https://img.shields.io/codecov/c/gh/aiidateam/aiida-optimade)](https://codecov.io/gh/aiidateam/aiida-optimade) | [![GitHub last commit](https://img.shields.io/github/last-commit/aiidateam/aiida-optimade)](https://github.com/aiidateam/aiida-optimade) |
| [![AiiDA](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/aiidateam/aiida-optimade/develop/.ci/aiida-version.json)](https://github.com/aiidateam/aiida-core/)<br>[![PyPI](https://img.shields.io/pypi/v/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aiida-optimade)](https://pypi.org/project/aiida-optimade/)<br>[![OPTIMADE](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/v0.18.0/optimade-version.json)](https://github.com/Materials-Consortia/OPTIMADE/) | [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/aiidateam/aiida-optimade/aiida-optimade)](https://github.com/aiidateam/aiida-optimade/actions/)<br>[![Codecov](https://img.shields.io/codecov/c/gh/aiidateam/aiida-optimade)](https://codecov.io/gh/aiidateam/aiida-optimade) | [![GitHub last commit](https://img.shields.io/github/last-commit/aiidateam/aiida-optimade)](https://github.com/aiidateam/aiida-optimade) |

This is a RESTful API server created with [FastAPI](https://fastapi.tiangolo.com/) that exposes an AiiDA database according to the [OPTIMADE specification](https://github.com/Materials-Consortia/OPTIMADE/blob/develop/optimade.rst).

Expand Down
4 changes: 2 additions & 2 deletions aiida_optimade/routers/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def get_info(request: Request):
return InfoResponse(
meta=meta_values(str(request.url), 1, 1, more_data_available=False),
data=BaseInfoResource(
id=BaseInfoResource.schema()["properties"]["id"]["const"],
type=BaseInfoResource.schema()["properties"]["type"]["const"],
id=BaseInfoResource.schema()["properties"]["id"]["default"],
type=BaseInfoResource.schema()["properties"]["type"]["default"],
attributes=BaseInfoAttributes(
api_version=__api_version__,
available_api_versions=[
Expand Down
14 changes: 10 additions & 4 deletions aiida_optimade/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,21 @@ def retrieve_queryable_properties(
else:
all_properties[name] = value
properties[name] = {"description": value.get("description", "")}
for extra_key in ["unit"]:
if extra_key in value:
properties[name][extra_key] = value[extra_key]
for extra_key in (
"x-optimade-unit",
"x-optimade-queryable",
"x-optimade-support",
):
if value.get(extra_key) is not None:
properties[name][extra_key.replace("x-optimade-", "")] = value[
extra_key
]
# AiiDA's QueryBuilder can sort everything that isn't a list (array)
# or dict (object)
properties[name]["sortable"] = value.get("type", "") not in [
"array",
"object",
]
] and value.get("x-optimade-sortable", True)
# Try to get OpenAPI-specific "format" if possible,
# else get "type"; a mandatory OpenAPI key.
properties[name]["type"] = DataType.from_json_type(
Expand Down
2 changes: 1 addition & 1 deletion profiles/docker-compose-mongo.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.17.2
OPTIMADE_TOOLS_VERSION: 0.18.0
AIIDA_VERSION: 1.6.8
CONFIG_FILE: aiida_optimade/config.json
environment:
Expand Down
2 changes: 1 addition & 1 deletion profiles/docker-compose-mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.17.2
OPTIMADE_TOOLS_VERSION: 0.18.0
AIIDA_VERSION: 1.6.8
CONFIG_FILE: aiida_optimade/config.json
environment:
Expand Down
2 changes: 1 addition & 1 deletion profiles/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.17.2
OPTIMADE_TOOLS_VERSION: 0.18.0
AIIDA_VERSION: 1.6.8
CONFIG_FILE: aiida_optimade/config.json
environment:
Expand Down
2 changes: 1 addition & 1 deletion profiles/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.17.2
OPTIMADE_TOOLS_VERSION: 0.18.0
AIIDA_VERSION: 1.6.8
CONFIG_FILE: aiida_optimade/config.json
environment:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiida-core~=1.6.8
optimade[mongo]~=0.17.2
optimade[mongo]~=0.18.0
pymatgen~=2021.3
uvicorn~=0.17.6

Expand Down

0 comments on commit e49337c

Please sign in to comment.