File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
import warnings
2
- import pkg_resources
2
+ import entrypoints
3
3
import textwrap
4
4
from collections .abc import Mapping
5
5
@@ -36,7 +36,7 @@ class ParameterSets(Mapping):
36
36
def __init__ (self ):
37
37
# Dict of entry points for parameter sets, lazily load entry points as
38
38
self .__all_parameter_sets = dict ()
39
- for entry_point in pkg_resources . iter_entry_points ("pybamm_parameter_sets" ):
39
+ for entry_point in entrypoints . get_group_all ("pybamm_parameter_sets" ):
40
40
self .__all_parameter_sets [entry_point .name ] = entry_point
41
41
42
42
def __new__ (cls ):
@@ -55,7 +55,7 @@ def __load_entry_point__(self, key) -> callable:
55
55
if key not in self .__all_parameter_sets :
56
56
raise KeyError (f"Unknown parameter set: { key } " )
57
57
ps = self .__all_parameter_sets [key ]
58
- if isinstance (ps , pkg_resources .EntryPoint ):
58
+ if isinstance (ps , entrypoints .EntryPoint ):
59
59
ps = self .__all_parameter_sets [key ] = ps .load ()
60
60
return ps
61
61
You can’t perform that action at this time.
0 commit comments