diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 42f48c05d..d14feddb5 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.16.0 +current_version = 3.16.1 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P[a-z]+)?(?P\d+)? diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6e5f63187..ea40d73ab 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,13 @@ +DIALS 3.16.1 (2023-08-29) +========================= + +Bugfixes +-------- + +- Fix situation where a bad ``Beam.probe`` could cause undefined behaviour. (`#656 `_) +- Fix performance regression loading large experiment lists containing profile/scaling models. (`#658 `_) + + dxtbx 3.16.0 (2023-08-14) ========================= diff --git a/setup.py b/setup.py index 8d6f78679..0f9cdb4fa 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ # Static version number which is updated by bump2version # Do not change this manually - use 'bump2version ' -__version_tag__ = "3.16.0" +__version_tag__ = "3.16.1" setup_kwargs = { "name": "dxtbx", diff --git a/src/dxtbx/model/beam.h b/src/dxtbx/model/beam.h index 6df5325d1..7f9cefb37 100644 --- a/src/dxtbx/model/beam.h +++ b/src/dxtbx/model/beam.h @@ -319,7 +319,7 @@ namespace dxtbx { namespace model { case neutron: return std::string("neutron"); default: - DXTBX_ERROR("Unknown probe type"); + throw DXTBX_ERROR("Unknown probe type"); } } @@ -335,7 +335,7 @@ namespace dxtbx { namespace model { return Probe::neutron; } - DXTBX_ERROR("Unknown probe " + probe); + throw DXTBX_ERROR("Unknown probe " + probe); } void set_probe(Probe probe) { diff --git a/src/dxtbx/model/experiment_list.py b/src/dxtbx/model/experiment_list.py index ec836614f..92298851d 100644 --- a/src/dxtbx/model/experiment_list.py +++ b/src/dxtbx/model/experiment_list.py @@ -64,6 +64,14 @@ class InvalidExperimentListError(RuntimeError): """ +try: + scaling_model_entry_points = importlib.metadata.entry_points()[ + "dxtbx.scaling_model_ext" + ] +except KeyError: + scaling_model_entry_points = [] + + class ExperimentListDict: """A helper class for serializing the experiment list to dictionary (needed to save the experiment list to JSON format.""" @@ -465,7 +473,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()["dxtbx.scaling_model_ext"]: + for entry_point in scaling_model_entry_points: if entry_point.name == obj["__id__"]: return entry_point.load().from_dict(obj) diff --git a/src/dxtbx/model/profile.py b/src/dxtbx/model/profile.py index ba3852586..20ead45f2 100644 --- a/src/dxtbx/model/profile.py +++ b/src/dxtbx/model/profile.py @@ -3,6 +3,11 @@ import importlib.metadata import logging +try: + profile_entry_points = importlib.metadata.entry_points()["dxtbx.profile_model"] +except KeyError: + profile_entry_points = [] + class ProfileModelFactory: """ @@ -16,7 +21,7 @@ def from_dict(obj): """ if obj is None: return None - for entry_point in importlib.metadata.entry_points()["dxtbx.profile_model"]: + for entry_point in profile_entry_points: if entry_point.name == obj["__id__"]: return entry_point.load().from_dict(obj) logging.getLogger("dxtbx.model.profile").warn(