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

Avoid crashes on Windows when printing unicode #1602

Merged
merged 3 commits into from
Feb 22, 2021
Merged

Avoid crashes on Windows when printing unicode #1602

merged 3 commits into from
Feb 22, 2021

Conversation

Anthchirp
Copy link
Member

where the output is redirected away from the console into a pipe or
file. For this we need to ensure that stdout/stderr are UTF-8 encoded.

Anthchirp and others added 2 commits February 20, 2021 00:32
where the output is redirected away from the console into a pipe or
file. For this we need to ensure that stdout/stderr are UTF-8 encoded.
@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #1602 (2ba929d) into master (a682cc8) will decrease coverage by 0.01%.
The diff coverage is 14.28%.

@@            Coverage Diff             @@
##           master    #1602      +/-   ##
==========================================
- Coverage   66.62%   66.61%   -0.02%     
==========================================
  Files         614      614              
  Lines       68725    68734       +9     
  Branches     9567     9568       +1     
==========================================
- Hits        45789    45788       -1     
- Misses      21007    21017      +10     
  Partials     1929     1929              

@dagewa
Copy link
Member

dagewa commented Feb 21, 2021

It's a big improvement! Before:

=============================================== short test summary info ===============================================
FAILED algorithms/scaling/test_scale.py::test_targeted_scaling_against_mtz - assert (not 0 and not b'--- Logging erro...
FAILED algorithms/scaling/test_scale.py::test_scale_single_dataset_with_options[None] - assert (not 0 and not b'--- L...
FAILED algorithms/scaling/test_scale.py::test_scale_single_dataset_with_options[reflection_selection.method=random]
FAILED algorithms/scaling/test_scale.py::test_scale_single_dataset_with_options[reflection_selection.method=intensity_ranges]
FAILED algorithms/scaling/test_scale.py::test_scale_single_dataset_with_options[reflection_selection.method=use_all]
FAILED algorithms/scaling/test_scale.py::test_scale_single_dataset_with_options[intensity_choice=sum] - assert (not 0...
FAILED algorithms/scaling/test_scale.py::test_scale_single_dataset_with_options[intensity=profile] - assert (not 0 an...
FAILED algorithms/scaling/test_scale.py::test_error_model_options[options1-expected1-tolerances1] - assert (not 0 and...
FAILED algorithms/scaling/test_scale.py::test_error_model_options[options2-expected2-tolerances2] - assert (not 0 and...
FAILED algorithms/scaling/test_scale.py::test_error_model_options[options3-expected3-tolerances3] - assert (not 0 and...
FAILED algorithms/scaling/test_scale.py::test_error_model_options[options5-expected5-tolerances5] - assert (not 0 and...
FAILED algorithms/scaling/test_scale.py::test_error_model_options[options6-expected6-tolerances6] - assert (not 0 and...
FAILED algorithms/scaling/test_scale.py::test_error_model_options[options7-expected7-tolerances7] - assert (not 0 and...
FAILED algorithms/scaling/test_scale.py::test_scale_multiple_datasets_with_options[None] - assert (not 0 and not b'--...
FAILED algorithms/scaling/test_scale.py::test_scale_multiple_datasets_with_options[combine.joint_analysis=False] - as...
FAILED algorithms/scaling/test_scale.py::test_scale_multiple_datasets_with_options[reflection_selection.method=quasi_random]
FAILED algorithms/scaling/test_scale.py::test_scale_multiple_datasets_with_options[reflection_selection.method=random]
FAILED algorithms/scaling/test_scale.py::test_scale_multiple_datasets_with_options[reflection_selection.method=intensity_ranges]
FAILED algorithms/scaling/test_scale.py::test_scale_multiple_datasets_with_options[reflection_selection.method=use_all]
FAILED algorithms/scaling/test_scale.py::test_scale_multiple_datasets_with_options[anomalous=True] - assert (not 0 an...
FAILED algorithms/scaling/test_scale.py::test_scale_physical - assert (not 0 and not b'--- Logging error ---\r\nTrace...
FAILED algorithms/scaling/test_scale.py::test_scale_and_filter_image_group_mode - assert (not 0 and not b'--- Logging...
FAILED algorithms/scaling/test_scale.py::test_scale_and_filter_image_group_single_dataset - assert (not 0 and not b'-...
FAILED algorithms/scaling/test_scale.py::test_scale_dose_decay_model - assert (not 0 and not b'--- Logging error ---\...
FAILED algorithms/scaling/test_scale.py::test_scale_best_unit_cell_d_min - assert (not 0 and not b'--- Logging error ...
FAILED algorithms/scaling/test_scale.py::test_scale_and_filter_dataset_mode - assert (not 0 and not b'--- Logging err...
FAILED algorithms/scaling/test_scale.py::test_scale_array - assert (not 0 and not b'--- Logging error ---\r\nTracebac...
FAILED algorithms/scaling/test_scale.py::test_multi_scale - AssertionError: assert (not 1)
FAILED algorithms/scaling/test_scale.py::test_targeted_scaling - assert (not 0 and not b'--- Logging error ---\r\nTra...
FAILED algorithms/scaling/test_scale.py::test_incremental_scale_workflow - assert (not 0 and not b'--- Logging error ...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P2-None-None-10-False-False-True] - Runti...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P3-None-None-20-False-False-True] - Runti...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I23-None-dimensions2-10-False-False-True]
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I23-None-dimensions3-10-True-False-True]
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P422-unit_cell4-None-20-True-True-True]
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P321-unit_cell5-None-5-False-False-True]
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[C121-unit_cell6-None-5-False-False-False]
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[C121-unit_cell7-None-5-True-True-False]
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I121-unit_cell8-None-5-False-False-True]
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I121-unit_cell9-None-5-True-True-True] - ...
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[P2] - RuntimeError: Unsupported numpy.ndarra...
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[P3] - RuntimeError: Unsupported numpy.ndarra...
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[P6] - RuntimeError: Unsupported numpy.ndarra...
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[R3:h] - RuntimeError: Unsupported numpy.ndar...
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[I23] - RuntimeError: Unsupported numpy.ndarr...
FAILED test/algorithms/refinement/test_prediction_parameters.py::test - assert <scitbx_array_family_flex_ext.double o...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\connection.py:811: KeyboardInterrupt
(to show a full traceback on KeyboardInterrupt use --full-trace)
=================== 46 failed, 543 passed, 1 skipped, 3 xpassed, 246 warnings in 6939.75s (1:55:39) ===================

After:

===================================================================== short test summary info =====================================================================
FAILED algorithms/scaling/test_scale.py::test_multi_scale - AssertionError: assert (not 1)
FAILED algorithms/scaling/test_scale.py::test_incremental_scale_workflow - AssertionError: assert (not 1)
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P2-None-None-10-False-False-True] - RuntimeError: Unsupported numpy.ndarray element type
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P3-None-None-20-False-False-True] - RuntimeError: Unsupported numpy.ndarray element type
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I23-None-dimensions2-10-False-False-True] - RuntimeError: Unsupported numpy.ndarray e...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I23-None-dimensions3-10-True-False-True] - RuntimeError: Unsupported numpy.ndarray el...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P422-unit_cell4-None-20-True-True-True] - RuntimeError: Unsupported numpy.ndarray ele...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[P321-unit_cell5-None-5-False-False-True] - RuntimeError: Unsupported numpy.ndarray el...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[C121-unit_cell6-None-5-False-False-False] - RuntimeError: Unsupported numpy.ndarray e...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[C121-unit_cell7-None-5-True-True-False] - RuntimeError: Unsupported numpy.ndarray ele...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I121-unit_cell8-None-5-False-False-True] - RuntimeError: Unsupported numpy.ndarray el...
FAILED algorithms/symmetry/cosym/test_cosym_analyse_datasets.py::test_cosym[I121-unit_cell9-None-5-True-True-True] - RuntimeError: Unsupported numpy.ndarray elem...
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[P2] - RuntimeError: Unsupported numpy.ndarray element type
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[P3] - RuntimeError: Unsupported numpy.ndarray element type
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[P6] - RuntimeError: Unsupported numpy.ndarray element type
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[R3:h] - RuntimeError: Unsupported numpy.ndarray element type
FAILED algorithms/symmetry/cosym/test_cosym_target.py::test_cosym_target[I23] - RuntimeError: Unsupported numpy.ndarray element type
FAILED test/test_plot_reflections.py::test_run - FileNotFoundError: [WinError 2] The system cannot find the file specified
FAILED test/algorithms/refinement/test_prediction_parameters.py::test - assert <scitbx_array_family_flex_ext.double object at 0x000001CD80BB1340> == approx([0.28...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c:\Users\fcx32934\sw\cctbx\conda_base\lib\multiprocessing\connection.py:811: KeyboardInterrupt
(to show a full traceback on KeyboardInterrupt use --full-trace)
========================================= 19 failed, 570 passed, 1 skipped, 3 xpassed, 246 warnings in 1806.75s (0:30:06) =========================================

I'm mainly left with cosym test failures, but these seem new to me - maybe related to #1581. I'll look into more details on Monday. The KeyboardInterrupt is because pytest has started hanging at the end of the test runs. I'm not sure why, that's something that's only appeared in the last few days too.

@Anthchirp Anthchirp merged commit 6efab8e into master Feb 22, 2021
@Anthchirp Anthchirp deleted the utf8-win branch February 22, 2021 08:39
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

4 participants