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

DIALS 3.16.1 #189

Merged
merged 4 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
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
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-05)
=========================

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
Loading