Skip to content

Commit

Permalink
DIALS 3.16.1
Browse files Browse the repository at this point in the history
Bugfixes
--------

- Fix situation where a bad ``Beam.probe`` could cause undefined behaviour.
- Fix performance regression loading large experiment lists containing profile/scaling models.
  • Loading branch information
DiamondLightSource-build-server committed Sep 3, 2023
2 parents a13143c + e54135a commit 69fde79
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.16.0
current_version = 3.16.1
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<release>[a-z]+)?(?P<patch>\d+)?
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
DIALS 3.16.1 (2023-09-03)
=========================

Bugfixes
--------

- Fix situation where a bad ``Beam.probe`` could cause undefined behaviour. (`#656 <https://github.com/cctbx/dxtbx/issues/656>`_)
- Fix performance regression loading large experiment lists containing profile/scaling models. (`#658 <https://github.com/cctbx/dxtbx/issues/658>`_)


dxtbx 3.16.0 (2023-08-14)
=========================

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Static version number which is updated by bump2version
# Do not change this manually - use 'bump2version <major/minor/patch/release>'
__version_tag__ = "3.16.0"
__version_tag__ = "3.16.1"

setup_kwargs = {
"name": "dxtbx",
Expand Down
4 changes: 2 additions & 2 deletions src/dxtbx/model/beam.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand All @@ -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) {
Expand Down
10 changes: 9 additions & 1 deletion src/dxtbx/model/experiment_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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)

Expand Down
7 changes: 6 additions & 1 deletion src/dxtbx/model/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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(
Expand Down

0 comments on commit 69fde79

Please sign in to comment.