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

Clean up dials.array_family.flex #1158

Merged
merged 10 commits into from
Feb 24, 2020
Merged

Clean up dials.array_family.flex #1158

merged 10 commits into from
Feb 24, 2020

Conversation

Anthchirp
Copy link
Member

@Anthchirp Anthchirp commented Feb 17, 2020

  • Explicitly import symbols from dials flex_ext instead of importing/exporting everything and the kitchen sink.
  • Avoids unsupported use of locals()
  • Removes unused symbols
    • dials.array_family.flex.BinIndexer²
    • dials.array_family.flex.Reflection²
    • dials.array_family.flex.ShoeboxExtractor
    • dials.array_family.flex.centroid²
    • dials.array_family.flex.experiment_id_map²
    • dials.array_family.flex.get_real_type
    • dials.array_family.flex.intensity²
    • dials.array_family.flex.prediction¹
    • dials.array_family.flex.unit_cell²

The ones marked with ¹ appear to be unused in Python land, and could potentially be removed from C++ land altogether. Discuss.

Edit: The ones now marked with ² may appear to be unused, but are in fact used.

instead of importing everything and the kitchen sink.
Also avoids using 'locals()' in an unsupported manner.
@Anthchirp
Copy link
Member Author

discussed: tidy up. If we need to put it back then we know where to find it

@Anthchirp
Copy link
Member Author

Rebuilt dials from scratch and tests still pass.

Anthchirp and others added 4 commits February 19, 2020 13:11
Move all code from flex.py to flex_ext.py
and turn flex.py into a pure importer.

This way there is no mangling of builtins in flex_ext.py,
and there is a full list of defined symbols in flex.py.

Even though LGTM complains about new alerts in the
pull request it will honour the suppression once merged.

Co-authored-by: Nicholas Devenish <ndevenish@gmail.com>
since we no longer clobber our namespace
@Anthchirp Anthchirp changed the title Clean up array_family_flex_ext Clean up dials.array_family.flex Feb 20, 2020
as they are set from outside the class.

flex.strategy is removed, functools.partial can be used as a drop-in
replacement.
.as_miller_array() raises KeyError instead of Sorry

.extract_shoeboxes() lost its verbosity parameter, use log levels
instead.
@Anthchirp
Copy link
Member Author

Think this is ready to go.

Co-authored-by: Richard Gildea <richard.gildea@diamond.ac.uk>
@Anthchirp Anthchirp merged commit 030c706 into master Feb 24, 2020
@Anthchirp Anthchirp deleted the delocal branch February 24, 2020 12:23
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

1 participant