Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crystal_toolkit/alpha_mpid_cache.json

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions crystal_toolkit/components/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@


class SearchComponent(MPComponent):
def __init__(self, *args, **kwargs) -> None:
def __init__(self, use_legacy_id=True, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.create_store("results")
self._use_legacy_id = use_legacy_id

def _get_mpid_cache(self):
path = os.path.join(os.path.dirname(module_path), "mpid_cache.json")
mpid_cache_file = "mpid_cache.json"
if not self._use_legacy_id:
mpid_cache_file = "alpha_mpid_cache.json"

path = os.path.join(os.path.dirname(module_path), mpid_cache_file)

mpid_cache = loadfn(path) if os.path.isfile(path) else []
# else:
Expand Down
Loading