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

Remove datablock #570

Merged
merged 26 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7b2968e
Stage 1 remove datablock
graeme-winter Mar 18, 2022
882e9ec
More aggressive exceptions
graeme-winter Mar 18, 2022
e281035
If you are removing datablock; remove tests
graeme-winter Mar 21, 2022
705a80e
Remove to_datablock
graeme-winter Mar 21, 2022
4c01ad9
More traps
graeme-winter Mar 21, 2022
ea03484
Merge branch 'main' into remove-datablock
graeme-winter Oct 24, 2022
c7b2bb2
News
graeme-winter Oct 24, 2022
f17a1de
Rename newsfragments/XXX.removal to newsfragments/504.removal
DiamondLightSource-build-server Oct 24, 2022
f168150
Remove obviated xfailing test
phyy-nx Oct 25, 2022
e782dbc
Remove datablock tests: left fixtures in place
graeme-winter Nov 2, 2022
80f5a8b
Expunge Datablock class (mostly)
graeme-winter Nov 2, 2022
80ede25
Work harder at expunge
graeme-winter Nov 7, 2022
b17fce4
Remove datablocks from dxtbx.plot_detector_models
dagewa Nov 7, 2022
6775110
Make display_parallax_correction work with ExperimentList
ndevenish Nov 7, 2022
66fce0e
Remove general datablock namespace import
ndevenish Nov 7, 2022
80286ec
Remove textual reference to datablock
ndevenish Nov 7, 2022
b40ec4d
Remove ExperimentList-from-datablock function
ndevenish Nov 7, 2022
246f3c1
Reword to avoid the word 'datablock'
ndevenish Nov 7, 2022
1edd41d
Merge branch 'main' into remove-datablock
dagewa Feb 22, 2023
41d9c59
Merge remote-tracking branch 'origin/main' into remove-datablock
ndevenish May 18, 2023
004a99e
Merge branch 'main' into remove-datablock
dagewa Jul 25, 2023
0d30762
Merge branch 'main' into remove-datablock
ndevenish Aug 11, 2023
8500ebb
Move AutoEncoder to dxtbx.util
ndevenish Aug 17, 2023
325711d
Warn when trying to import datablock
ndevenish Aug 17, 2023
f46338e
Move comparison functions from datablock to experiment_list
ndevenish Aug 17, 2023
bc385e9
Remove Datablock warning from pytest.ini
ndevenish Aug 17, 2023
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
1 change: 1 addition & 0 deletions newsfragments/504.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dxtbx: remove legacy datablock object (obsolete for several years)
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ addopts = -rsxX
filterwarnings =
ignore:the matrix subclass is not the recommended way:PendingDeprecationWarning
ignore:numpy.dtype size changed:RuntimeWarning
ignore:Datablocks are deprecated:UserWarning
ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning
ignore:`product` is deprecated as of NumPy:DeprecationWarning:h5py|numpy
junit_family = legacy
Expand Down
10 changes: 6 additions & 4 deletions src/dxtbx/command_line/display_parallax_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
from scitbx.array_family import flex

import dxtbx.util
from dxtbx.datablock import DataBlockFactory
from dxtbx.model import ParallaxCorrectedPxMmStrategy
from dxtbx.model.experiment_list import ExperimentListFactory

Check warning on line 11 in src/dxtbx/command_line/display_parallax_correction.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/command_line/display_parallax_correction.py#L11

Added line #L11 was not covered by tests


def run(args=None):
dxtbx.util.encode_output_as_utf8()
datablocks = DataBlockFactory.from_args(args or sys.argv[1:])
assert len(datablocks) == 1
detectors = datablocks[0].unique_detectors()
experiments = ExperimentListFactory.from_args(

Check warning on line 16 in src/dxtbx/command_line/display_parallax_correction.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/command_line/display_parallax_correction.py#L16

Added line #L16 was not covered by tests
args or sys.argv[1:], check_format=False
)
assert len(experiments) == 1
detectors = experiments.detectors()

Check warning on line 20 in src/dxtbx/command_line/display_parallax_correction.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/command_line/display_parallax_correction.py#L19-L20

Added lines #L19 - L20 were not covered by tests
assert len(detectors) == 1
detector = detectors[0]
assert len(detector) == 1
Expand Down
19 changes: 7 additions & 12 deletions src/dxtbx/command_line/plot_detector_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
from scitbx.matrix import col

import dxtbx.util
from dxtbx.datablock import DataBlockFactory
from dxtbx.model.detector_helpers import get_detector_projection_2d_axes
from dxtbx.model.experiment_list import ExperimentListFactory

usage = """Plot dxtbx detector models. Provide multiple json files if desired
Example: dxtbx.plot_detector_models datablock1.json datablock2.json
Example: dxtbx.plot_detector_models experiments1.json experiments2.json
"""


Expand Down Expand Up @@ -181,16 +180,12 @@

# read the data and get the detector models
try:
datablocks = DataBlockFactory.from_json_file(file_name, check_format=False)
detectors = sum((db.unique_detectors() for db in datablocks), [])
except Exception:
try:
experiments = ExperimentListFactory.from_json_file(
file_name, check_format=False
)
except ValueError:
experiments = ExperimentListFactory.from_filenames([file_name])
detectors = experiments.detectors()
experiments = ExperimentListFactory.from_json_file(

Check warning on line 183 in src/dxtbx/command_line/plot_detector_models.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/command_line/plot_detector_models.py#L183

Added line #L183 was not covered by tests
file_name, check_format=False
)
except ValueError:
experiments = ExperimentListFactory.from_filenames([file_name])
detectors = experiments.detectors()

Check warning on line 188 in src/dxtbx/command_line/plot_detector_models.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/command_line/plot_detector_models.py#L186-L188

Added lines #L186 - L188 were not covered by tests
if not params.plot_all_detectors:
detectors = detectors[0:1]
for detector in detectors:
Expand Down
Loading
Loading