Skip to content

Commit

Permalink
Charge density, client, and MPRester updates (#302)
Browse files Browse the repository at this point in the history
* Formula query added to thermo endpoint

* Major client updates

* MPRester materials and thermo funcs update

* Pymatgen verion bump

* Remove last mentions of version

* Charge density endpoint bug fix

* Fix materials_id change lookup in core client

* Charge density endpoint changes

* General client improvements

* Linting
  • Loading branch information
munrojm committed Jun 22, 2021
1 parent d153286 commit 2abeead
Show file tree
Hide file tree
Showing 45 changed files with 383 additions and 553 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
s3_chgcar_index = MongoURIStore(
uri=f"mongodb+srv://{db_uri}",
database="mp_core",
key="task_id",
key="fs_id",
collection_name="atomate_chgcar_fs_index",
)

Expand All @@ -282,7 +282,7 @@
bucket="mp-volumetric",
sub_dir="atomate_chgcar_fs/",
compress=True,
key="task_id",
key="fs_id",
searchable_fields=["task_id", "fs_id"],
)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pydantic==1.8.2
pymatgen==2022.0.8
pymatgen==2022.0.9
typing-extensions==3.10.0.0
maggma==0.29.2
requests==2.25.1
Expand Down
14 changes: 4 additions & 10 deletions src/mp_api/core/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Dict, List
from maggma.api.resource.core import Resource
from pymatgen.core import __version__ as pmg_version # type: ignore
from mp_api import __version__ as api_version
from mp_api.core.settings import MAPISettings
from fastapi.openapi.utils import get_openapi
from maggma.api.API import API

Expand All @@ -17,14 +17,10 @@ def __init__(
title="Materials Project API",
version="v3.0-dev",
debug=False,
heartbeat_meta={"pymatgen": pmg_version},
heartbeat_meta={"pymatgen": pmg_version, "db_version": MAPISettings().db_version},
):
super().__init__(
resources=resources,
title=title,
version=version,
debug=debug,
heartbeat_meta=heartbeat_meta,
resources=resources, title=title, version=version, debug=debug, heartbeat_meta=heartbeat_meta,
)

@property
Expand All @@ -35,9 +31,7 @@ def app(self):
app = super().app

def custom_openapi():
openapi_schema = get_openapi(
title=self.title, version=self.version, routes=app.routes
)
openapi_schema = get_openapi(title=self.title, version=self.version, routes=app.routes)

openapi_schema["components"]["securitySchemes"] = {
"ApiKeyAuth": {
Expand Down
Loading

0 comments on commit 2abeead

Please sign in to comment.