Skip to content

Commit

Permalink
Use the pre-3.10 compatibility form
Browse files Browse the repository at this point in the history
  • Loading branch information
ndevenish committed Jun 29, 2023
1 parent 6c74e3e commit 3859957
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/dxtbx/format/Registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_format_class_index() -> dict[str, tuple[Callable[[], type[Format]], list
"""
if not hasattr(get_format_class_index, "cache"):
class_index = {}
for e in importlib.metadata.entry_points(group="dxtbx.format"):
for e in importlib.metadata.entry_points()["dxtbx.format"]:
if ":" in e.name:
format_name, base_classes_str = e.name.split(":", 1)
base_classes = tuple(base_classes_str.split(","))
Expand Down
5 changes: 1 addition & 4 deletions src/dxtbx/model/experiment_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ def decode(self):
# a sensible experiment.
el = ExperimentList()
for eobj in self._obj["experiment"]:

# Get the models
identifier = eobj.get("identifier", "")
beam = self._lookup_model("beam", eobj)
Expand Down Expand Up @@ -466,9 +465,7 @@ def _lookup_model(self, name, experiment_dict):
@staticmethod
def _scaling_model_from_dict(obj):
"""Get the scaling model from a dictionary."""
for entry_point in importlib.metadata.entry_points(
group="dxtbx.scaling_model_ext"
):
for entry_point in importlib.metadata.entry_points()["dxtbx.scaling_model_ext"]:
if entry_point.name == obj["__id__"]:
return entry_point.load().from_dict(obj)

Expand Down
2 changes: 1 addition & 1 deletion src/dxtbx/model/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def from_dict(obj):
"""
if obj is None:
return None
for entry_point in importlib.metadata.entry_points(group="dxtbx.profile_model"):
for entry_point in importlib.metadata.entry_points()["dxtbx.profile_model"]:
if entry_point.name == obj["__id__"]:
return entry_point.load().from_dict(obj)
logging.getLogger("dxtbx.model.profile").warn(
Expand Down

0 comments on commit 3859957

Please sign in to comment.