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

3.11 release: all viewers broken (wxPython incompatible) #2216

Closed
graeme-winter opened this issue Aug 30, 2022 · 6 comments · Fixed by #2219
Closed

3.11 release: all viewers broken (wxPython incompatible) #2216

graeme-winter opened this issue Aug 30, 2022 · 6 comments · Fixed by #2219
Assignees
Labels
bug dials.image_viewer dials.reciprocal_lattice_viewer Issues relating to dials.reciprocal_lattice_viewer.

Comments

@graeme-winter
Copy link
Contributor

wxPython error:

sleeper-service work :( $ sleeper-service work :) $ dials.reciprocal_lattice_viewer indexed.*
DIALS (2018) Acta Cryst. D74, 85-97. https://doi.org/10.1107/S2059798317017235
The following parameters have been modified:

input {
  experiments = indexed.expt
  reflections = indexed.refl
}

Gtk-Message: 16:01:02.265: Failed to load module "atk-bridge"
Gtk-Message: 16:01:02.267: Failed to load module "canberra-gtk-module"
TypeError: Please report this error to dials-support@lists.sourceforge.net: Timer.Start(): argument 1 has unexpected type 'float'
Traceback (most recent call last):
  File "/home/graeme/x/dials-v3-11-0/build/../modules/dials/src/dials/command_line/reciprocal_lattice_viewer.py", line 79, in <module>
    run()
  File "/home/graeme/x/dials-v3-11-0/conda_base/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/home/graeme/x/dials-v3-11-0/build/../modules/dials/src/dials/command_line/reciprocal_lattice_viewer.py", line 65, in run
    f = ReciprocalLatticeViewer(
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/reciprocal_lattice/viewer.py", line 78, in __init__
    self.create_viewer_panel()
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/reciprocal_lattice/viewer.py", line 150, in create_viewer_panel
    self.viewer = RLVWindow(
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/reciprocal_lattice/viewer.py", line 487, in __init__
    super().__init__(*args, **kwds)
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/wx_viewer.py", line 810, in __init__
    wxGLWindow.__init__(self, *args, **keyword_args)
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/wx_viewer.py", line 148, in __init__
    self.spintimer.Start(1000 / self.spintimer_maxfps)
TypeError: Please report this error to dials-support@lists.sourceforge.net: Timer.Start(): argument 1 has unexpected type 'float'

@graeme-winter
Copy link
Contributor Author

If I patch that one with / -> // to do integer division I get a bunch of other errors...

sleeper-service work :) $ dials.reciprocal_lattice_viewer indexed.*
DIALS (2018) Acta Cryst. D74, 85-97. https://doi.org/10.1107/S2059798317017235
The following parameters have been modified:

input {
  experiments = indexed.expt
  reflections = indexed.refl
}

Gtk-Message: 16:03:18.607: Failed to load module "atk-bridge"
Gtk-Message: 16:03:18.609: Failed to load module "canberra-gtk-module"
TypeError: DC.DrawRectangle(): arguments did not match any overloaded call:
  overload 1: argument 3 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'int'
  overload 3: argument 1 has unexpected type 'int'
Traceback (most recent call last):
  File "/home/graeme/x/dials-v3-11-0/modules/cctbx_project/wxtbx/segmentedctrl.py", line 60, in <lambda>
    self.Bind(wx.EVT_PAINT, lambda evt: self.__DrawButtons())
  File "/home/graeme/x/dials-v3-11-0/modules/cctbx_project/wxtbx/segmentedctrl.py", line 224, in __DrawButtons
    gc.DrawRectangle(current_x, current_y, seg_w, seg_h)
TypeError: DC.DrawRectangle(): arguments did not match any overloaded call:
  overload 1: argument 3 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'int'
  overload 3: argument 1 has unexpected type 'int'

TypeError: DC.DrawRectangle(): arguments did not match any overloaded call:
  overload 1: argument 3 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'int'
  overload 3: argument 1 has unexpected type 'int'
Traceback (most recent call last):
  File "/home/graeme/x/dials-v3-11-0/modules/cctbx_project/wxtbx/segmentedctrl.py", line 60, in <lambda>
    self.Bind(wx.EVT_PAINT, lambda evt: self.__DrawButtons())
  File "/home/graeme/x/dials-v3-11-0/modules/cctbx_project/wxtbx/segmentedctrl.py", line 224, in __DrawButtons
    gc.DrawRectangle(current_x, current_y, seg_w, seg_h)
TypeError: DC.DrawRectangle(): arguments did not match any overloaded call:
  overload 1: argument 3 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'int'
  overload 3: argument 1 has unexpected type 'int'

@graeme-winter
Copy link
Contributor Author

Similar situation for image viewer

sleeper-service work :( $ dials.image_viewer indexed.*
DIALS (2018) Acta Cryst. D74, 85-97. https://doi.org/10.1107/S2059798317017235
The following parameters have been modified:

input {
  experiments = indexed.expt
  reflections = indexed.refl
}

Gtk-Message: 16:05:21.985: Failed to load module "atk-bridge"
Gtk-Message: 16:05:21.987: Failed to load module "canberra-gtk-module"
Traceback (most recent call last):
  File "/home/graeme/x/dials-v3-11-0/build/../modules/dials/src/dials/command_line/image_viewer.py", line 217, in <module>
    run()
  File "/home/graeme/x/dials-v3-11-0/conda_base/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/home/graeme/x/dials-v3-11-0/build/../modules/dials/src/dials/command_line/image_viewer.py", line 213, in run
    show_image_viewer(params=params, reflections=reflections, experiments=experiments)
  File "/home/graeme/x/dials-v3-11-0/build/../modules/dials/src/dials/command_line/image_viewer.py", line 178, in show_image_viewer
    wrapper.display(experiments=experiments, reflections=reflections)
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/image_viewer/spotfinder_wrap.py", line 82, in display
    self.frame.load_image(chooser_wrapper(imagesets[0], 0))
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/image_viewer/spotfinder_frame.py", line 638, in load_image
    super().load_image(
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/image_viewer/slip_viewer/frame.py", line 498, in load_image
    self.update_settings()
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/image_viewer/spotfinder_frame.py", line 1482, in update_settings
    self.pyslip.Update()
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/image_viewer/slip_viewer/pyslip.py", line 166, in Update
    self.Draw(dc)
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/image_viewer/slip_viewer/pyslip.py", line 2425, in Draw
    l.painter(dc, l.data, map_rel=l.map_rel)
  File "/home/graeme/x/dials-v3-11-0/modules/dials/src/dials/util/image_viewer/slip_viewer/pyslip.py", line 1705, in DrawPointLayer
    dc.DrawCircle(x + x_off, y + y_off, radius)
TypeError: Please report this error to dials-support@lists.sourceforge.net: DC.DrawCircle(): arguments did not match any overloaded call:
  overload 1: argument 1 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'float'
Fatal Python error: Segmentation fault

Current thread 0x00007f90181f9740 (most recent call first):
  <no Python frame>

@graeme-winter graeme-winter self-assigned this Aug 30, 2022
@graeme-winter
Copy link
Contributor Author

OK, this looks to be a Python 3.10 behaviour change. In 3.10 it will no longer truncate float to int in function arguments which expect an int. Looking for audit trail now.

@graeme-winter
Copy link
Contributor Author

python/cpython#80229

@graeme-winter
Copy link
Contributor Author

python/cpython#82180

@graeme-winter
Copy link
Contributor Author

x GW
o CCP4BB

"Hello everyone including brave souls who are keen to use the latest greatest version of DIALS - the recently released 3.11

Sorry

Please don’t

We have had a couple of reports of issues with the graphical utilities in here caused by upstream changes in Python which have completely broken the graphical libraries on which we depend

Locally detailed at

#2216

For anyone who wants to see the gory details which are a side-effect of

python/cpython#82180

As this is in our graphical interface tools it is not subject to automated testing and it would appear that those of us who are developing on 3.10 did not stumble across the problem

We will make a .1 release in the next couple of days - it would appear that the nightly builds are also affected by the same issue.

In the meantime I recommend people download the previous latest release 3.10.3

https://github.com/dials/dials/releases/tag/v3.10.3

I would like to emphasise that the algorithms are still fine (I believe) this is just an error with the viewers but fixing this in the longer term could be a substantial body of work.

For those who get their DIALS from CCP4 you will be fine as that is still on Python 3.7 or 3.8 so will not be affected by these issues.

Best wishes Graeme"

@graeme-winter graeme-winter added bug dials.image_viewer dials.reciprocal_lattice_viewer Issues relating to dials.reciprocal_lattice_viewer. labels Aug 30, 2022
@graeme-winter graeme-winter changed the title 3.11 release: reciprocal lattice viewer broken 3.11 release: all viewers broken (wxPython incompatible) Aug 30, 2022
ndevenish added a commit that referenced this issue Sep 2, 2022
This is to avoid a WXPython error that isn't fixed in the
currently available version on conda-forge.

Fixes #2216.
ndevenish added a commit that referenced this issue Sep 2, 2022
This is to avoid a WXPython error that isn't fixed in the
currently available version on conda-forge.

Fixes #2216.
ndevenish added a commit that referenced this issue Sep 2, 2022
This is to avoid a WXPython error that isn't fixed in the
currently available version on conda-forge.

Fixes #2216.
ndevenish added a commit that referenced this issue Sep 2, 2022
This is to avoid a WXPython error that isn't fixed in the
currently available version on conda-forge.

Fixes #2216.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dials.image_viewer dials.reciprocal_lattice_viewer Issues relating to dials.reciprocal_lattice_viewer.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant