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

Move list splitter utility into combine_experiments.py #2092

Merged
merged 2 commits into from
Apr 23, 2022

Conversation

ndevenish
Copy link
Member

This was causing an dependency on xfel, by transitive imports:

  • combine_experiments.py
  • dxtbx.command_line.image_average (for splitit, but then pulls in...)
  • dxtbx.format.cbf_writer, which pulled in
  • xfel.cftbx.......

This version came from stackoverflow, and was tested for all input lengths i=0...1000 and for every input, every sublength from n=1..i, to be identical, with:

def test_splits():
    for i in range(1000):
        print(i)
        for n in range(1,i):
            data = list(range(i))
            a = splitit(data, n)
            b = list(_split_equal_parts_of_length(data, n))

            assert a == b

ndevenish and others added 2 commits April 22, 2022 17:16
This was causing an dependency on xfel, by transitive imports:

    combine_experiments.py
 -> dxtbx.command_line.image_average (for splitit, but then pulls in...)
 -> dxtbx.format.cbf_writer
 -> xfel.cftbx.......

This version came from stackoverflow, and was tested for all input lengths
i=0...1000 and for every input, every sublength from n=1..i, to be identical.
@ndevenish ndevenish merged commit 5438882 into dials:main Apr 23, 2022
@ndevenish ndevenish deleted the combine_experiments_split branch April 23, 2022 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants