Skip to content

Commit

Permalink
All endpoints now use maggma api core
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Jun 14, 2021
1 parent 761971b commit cafbc1d
Show file tree
Hide file tree
Showing 21 changed files with 235 additions and 1,196 deletions.
26 changes: 14 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,14 @@
# Phonon
from mp_api.routes.phonon.resources import phonon_bs_resource, phonon_img_resource

resources.update({"phonon": [phonon_bs_resource(phonon_bs_store)]})
resources.update({"phonon_img": [phonon_img_resource(phonon_img_store)]})
resources.update(
{
"phonon": [
phonon_img_resource(phonon_img_store),
phonon_bs_resource(phonon_bs_store),
]
}
)

# EOS
from mp_api.routes.eos.resources import eos_resource
Expand Down Expand Up @@ -487,9 +493,11 @@
resources.update({"charge_density": [charge_density_resource(s3_chgcar)]})

# Search
from mp_api.routes.search.resources import search_resource
from mp_api.routes.search.resources import search_resource, search_stats_resource

resources.update({"search": [search_resource(search_store)]})
resources.update(
{"search": [search_stats_resource(search_store), search_resource(search_store)]}
)

# Electronic Structure
from mp_api.routes.electronic_structure.resources import (
Expand Down Expand Up @@ -518,15 +526,9 @@
resources.update({"mpcomplete": [mpcomplete_resource(mpcomplete_store)]})

# Consumers
from mp_api.routes._consumer.resources import (
get_settings_resource,
set_settings_resource,
)
from mp_api.routes._consumer.resources import settings_resource

resources.update({"user_settings": [get_settings_resource(consumer_settings_store)]})
resources.update(
{"user_settings/set": [set_settings_resource(consumer_settings_store)]}
)
resources.update({"user_settings": [settings_resource(consumer_settings_store)]})


api = MAPI(resources=resources, debug=debug)
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pydantic==1.8.2
pymatgen==2022.0.8
typing-extensions==3.10.0.0
maggma==0.27.0
maggma==0.29.0
requests==2.25.1
monty==2021.5.9
emmet-core @ git+https://github.com/materialsproject/emmet#subdirectory=emmet-core
emmet-core==0.2.2
4 changes: 2 additions & 2 deletions src/mp_api/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ def __init__(
title="Materials Project API",
version="v3.0-dev",
debug=False,
additional_meta={"pymatgen": pmg_version},
heartbeat_meta={"pymatgen": pmg_version},
):
super().__init__(
resources=resources,
title=title,
version=version,
debug=debug,
additional_meta=additional_meta,
heartbeat_meta=heartbeat_meta,
)

@property
Expand Down
2 changes: 1 addition & 1 deletion src/mp_api/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from pydantic import BaseModel
from tqdm import tqdm

from mp_api.core.utils import api_sanitize
from maggma.api.utils import api_sanitize

try:
from pymatgen.core import __version__ as pmg_version # type: ignore
Expand Down
78 changes: 0 additions & 78 deletions src/mp_api/core/models.py

This file was deleted.

205 changes: 0 additions & 205 deletions src/mp_api/core/query_operator.py

This file was deleted.

Loading

0 comments on commit cafbc1d

Please sign in to comment.