Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache entrypoints in group #3622

Merged
merged 2 commits into from
Dec 10, 2019
Merged
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
5 changes: 3 additions & 2 deletions aiida/plugins/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import enum
import traceback
import functools

try:
from reentry.default_manager import PluginManager
Expand Down Expand Up @@ -185,7 +186,6 @@ def load_entry_point_from_string(entry_point_string):
group, name = parse_entry_point_string(entry_point_string)
return load_entry_point(group, name)


def load_entry_point(group, name):
"""
Load the class registered under the entry point for a given name and group
Expand Down Expand Up @@ -234,6 +234,7 @@ def get_entry_point_names(group, sort=True):
return entry_point_names


@functools.lru_cache(maxsize=None)
def get_entry_points(group):
"""
Return a list of all the entry points within a specific group
Expand All @@ -243,7 +244,7 @@ def get_entry_points(group):
"""
return [ep for ep in ENTRYPOINT_MANAGER.iter_entry_points(group=group)]


@functools.lru_cache(maxsize=None)
def get_entry_point(group, name):
"""
Return an entry point with a given name within a specific group
Expand Down