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

Deprecation warnings #885

Merged
merged 8 commits into from
Aug 23, 2019
Merged

Deprecation warnings #885

merged 8 commits into from
Aug 23, 2019

Conversation

benjaminhwilliams
Copy link
Member

While working in xia2, I noticed a deprecation warning, so I did a little semi-automatic tidy-up. This PR does the following, based on the advice in the deprecation warnings:

  • Replace dials.util.halraiser with dials.util.show_mail_on_error context manager;
  • Replace dxtbx.model.experiment_list.ExperimentListDumper and dxtbx.serialize.dump with as_file method of experiment list;
  • Replace dials.algorithms.indexing.index_reflections with dials.algorithms.indexing.assign_indices.AssignIndicesGlobal;
  • Remove some unused imports and variables to satisfy flake8.

Any objections?

There is a corresponding PR in xia2 (xia2/xia2#325), and others to follow in dials_scratch & dxtbx.

@benjaminhwilliams
Copy link
Member Author

Had to leave work before the checks finished. I'll tidy up the Flake8 problems on Monday.

@benjaminhwilliams
Copy link
Member Author

@phyy-nx, I notice your 👍. Since I naturally have CCTBX as part of the DIALS build, my conversions caught lots of instances of the same sort of stuff in cctbx_project/xfel. Want me to open a corresponding PR there, or just leave it alone?

@graeme-winter
Copy link
Contributor

@benjaminhwilliams humbly suggest you leave those ones to the XFEL folks, since they will have a lot of other ongoing work there so high risk of conflicts 🙂

@benjaminhwilliams
Copy link
Member Author

Isn't Git fun?

@benjaminhwilliams
Copy link
Member Author

The final Flake8 warning command_line/analyse_background.py:68:13: F841 local variable 'mask' is assigned to but never used will be resolved by #889.

Copy link
Member

@ndevenish ndevenish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good - replacing halraiser is something I've wanted to do for a long time, so very pleased to see it.

If you disagree with the #noqa thing then feel free to merge it in anyway.

Copy link
Contributor

@rjgildea rjgildea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly outside the remit of this pull request, but since you touched this file... does the file example_experiment_data.py really need the example_ prefix, since it already is underneath the path doc/examples (the first rule of tautology club is...)?

I agree with @ndevenish's comments regarding # noqa: F841 - it would be a useful addition to the example to demonstrate printing out the objects (as it demonstrates that printing them gives some useful human-readable output).

benjaminhwilliams and others added 6 commits August 23, 2019 14:45
Replace `dials.util.halraiser` with
`dials.util.show_mail_on_error` context manager.
• Replace `dxtbx.model.experiment_list.ExperimentListDumper` and
  `dxtbx.serialize.dump` with `as_file` method of experiment list;
• Replace `dials.algorithms.indexing.index_reflections` with
  `dials.algorithms.indexing.assign_indices.AssignIndicesGlobal`;
• Remove `xia2.Applications.xia2setup.save_experiments`, which doesn't
  seem to be used anywhere;
• Remove some unused imports and variables to satisfy flake8.
  • Fix and add test for verbose behaviour of `dials.sort_reflections`;
  • Remove broken and unused method `debug_write_ccp4_map` of ;
  • Other more trivial fixes.
Print out some of the derived quantities as examples of use.
@benjaminhwilliams benjaminhwilliams merged commit 6b05972 into master Aug 23, 2019
@benjaminhwilliams benjaminhwilliams deleted the remove_halraiser branch August 23, 2019 15:06
jbeilstenedmands added a commit that referenced this pull request Aug 28, 2019
Not sure why this was in here in the first place, seems to only
have taken effect after #885
benjaminhwilliams added a commit to cctbx/cctbx_project that referenced this pull request Aug 30, 2019
Follows dials/dials#885 & dials/dials#860.
  • Replace dials.util.halraiser with dials.util.show_mail_on_error
    context manager;
  • Replace dxtbx.model.experiment_list.ExperimentListDumper and
    dxtbx.serialize.dump with as_file method of experiment list;
  • Fix "DeprecationWarning: Setting verbosity for a Refiner is
    deprecated."
rjgildea pushed a commit that referenced this pull request Sep 10, 2019
Not sure why this was in here in the first place, seems to only
have taken effect after #885
phyy-nx pushed a commit to cctbx/cctbx_project that referenced this pull request Nov 15, 2019
Follows dials/dials#885 & dials/dials#860.
  • Replace dials.util.halraiser with dials.util.show_mail_on_error
    context manager;
  • Replace dxtbx.model.experiment_list.ExperimentListDumper and
    dxtbx.serialize.dump with as_file method of experiment list;
  • Fix "DeprecationWarning: Setting verbosity for a Refiner is
    deprecated."
phyy-nx pushed a commit to cctbx/cctbx_project that referenced this pull request Nov 15, 2019
Follows dials/dials#885 & dials/dials#860.
  • Replace dials.util.halraiser with dials.util.show_mail_on_error
    context manager;
  • Replace dxtbx.model.experiment_list.ExperimentListDumper and
    dxtbx.serialize.dump with as_file method of experiment list;
  • Fix "DeprecationWarning: Setting verbosity for a Refiner is
    deprecated."
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

5 participants