Closed adrianusler closed 2 months ago
The recent updates across Molara's software suite bring enhancements to the GUI components, focusing on exporting images, connecting dialogs, and adopting configurations between structure widgets. These changes aim to improve user interaction and streamline functionality within the application.
File Path | Change Summary |
---|---|
molara/Gui/export_image_dialog.py |
Updated ExportImageDialog with show_dialog and accept methods for image exporting dialog. |
molara/Gui/main_window.py |
Added ExportImageDialog import, connected export action, and modified supercell dialog usage. |
molara/Gui/structure_widget.py |
Enhanced adopt_config method in StructureWidget for adopting configurations from another widget. |
tests/molara/gui/test_export_image_dialog.py |
Added tests for ExportImageDialog class covering dialog functionality and image export. |
🐇🖌️ In the GUI's realm where dialogs dance, Exporting images with a single glance. Structures adopt configurations, a seamless view, Tests ensure all functions, shiny and new. Molara's world evolves, with changes in queue, Thanks to your code, the enhancements grew! 🌟🐾
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 90.07092%
with 28 lines
in your changes are missing coverage. Please review.
Project coverage is 74.77%. Comparing base (
79e3896
) to head (81346fa
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I tried to export an image of ferrocene. It only produced a completely white png, and in addition the upper left quadrant of the molara window turned white as well. I can still rotate the molecule and zoom around though.
This was the corresponding output:
Traceback (most recent call last):
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/export_image_dialog.py", line 39, in accept
virtual_rendering_window.export_image(self.ui.filenameInput.text(), custom_geometry=(width, height))
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/virtual_rendering_window.py", line 37, in export_image
virtual_structure_widget.adopt_config(main_structure_widget, custom_geometry)
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/structure_widget.py", line 637, in adopt_config
self.set_structure(other_widget.structure, reset_view=False)
AttributeError: 'StructureWidget' object has no attribute 'structure'
2024-05-03 18:13:11.230 Python[84535:1030879] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x16ffb0880 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
2024-05-03 18:13:11.327 Python[84535:1030597] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x128c944d0 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
Traceback (most recent call last):
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/export_image_dialog.py", line 39, in accept
virtual_rendering_window.export_image(self.ui.filenameInput.text(), custom_geometry=(width, height))
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/virtual_rendering_window.py", line 37, in export_image
virtual_structure_widget.adopt_config(main_structure_widget, custom_geometry)
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/structure_widget.py", line 637, in adopt_config
self.set_structure(other_widget.structure, reset_view=False)
AttributeError: 'StructureWidget' object has no attribute 'structure'
2024-05-03 18:13:36.747 Python[84535:1030880] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x16e6db1f0 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
2024-05-03 18:13:43.934 Python[84535:1030881] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x16ff52450 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
Traceback (most recent call last):
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/export_image_dialog.py", line 39, in accept
virtual_rendering_window.export_image(self.ui.filenameInput.text(), custom_geometry=(width, height))
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/virtual_rendering_window.py", line 37, in export_image
virtual_structure_widget.adopt_config(main_structure_widget, custom_geometry)
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/structure_widget.py", line 637, in adopt_config
self.set_structure(other_widget.structure, reset_view=False)
AttributeError: 'StructureWidget' object has no attribute 'structure'
Traceback (most recent call last):
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/export_image_dialog.py", line 39, in accept
virtual_rendering_window.export_image(self.ui.filenameInput.text(), custom_geometry=(width, height))
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/virtual_rendering_window.py", line 37, in export_image
virtual_structure_widget.adopt_config(main_structure_widget, custom_geometry)
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/structure_widget.py", line 637, in adopt_config
self.set_structure(other_widget.structure, reset_view=False)
AttributeError: 'StructureWidget' object has no attribute 'structure'
2024-05-03 18:13:49.647 Python[84535:1031499] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x16c67e320 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
2024-05-03 18:14:02.306 Python[84535:1031501] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x139c07630 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
2024-05-03 18:16:11.153 Python[84535:1033234] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x308145190 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
2024-05-03 18:16:12.254 Python[84535:1033272] GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=8 "Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)" UserInfo={NSLocalizedDescription=Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory), NSUnderlyingError=0x11fde83a0 {Error Domain=IOGPUCommandQueueErrorDomain Code=8 "(null)"}}
I just reduced the image resolution, but I still get the empty png, albeit with less stderr:
Traceback (most recent call last):
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/export_image_dialog.py", line 39, in accept
virtual_rendering_window.export_image(self.ui.filenameInput.text(), custom_geometry=(width, height))
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/virtual_rendering_window.py", line 37, in export_image
virtual_structure_widget.adopt_config(main_structure_widget, custom_geometry)
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/structure_widget.py", line 637, in adopt_config
self.set_structure(other_widget.structure, reset_view=False)
AttributeError: 'StructureWidget' object has no attribute 'structure'
Also, the "change file" button does nothing for me
Thank you for pointing these bugs out, @ab5424. It is because of the change from StructureWidget possessing a single Structure member to it now possessing a list of structures. I will fix this.
I think that the problem with the export is fixed now, @ab5424. I have not implemented the file dialog yet.
Update: "change file" now opens a file dialog @ab5424.
The export seems to work fine 👍 What did you change in the measurement tool and the trajectory dialog?
I think that the problem with the export is fixed now, @ab5424. I have not implemented the file dialog yet.
@adrianusler The image export works fine now but file export fails:
Traceback (most recent call last):
File "/Users/alexbonkowski/PycharmProjects/Molara/src/molara/Gui/main_window.py", line 170, in export_structure
if not self.structure_widget.structure:
AttributeError: 'StructureWidget' object has no attribute 'structure'
I fixed the structure export @ab5424. But it would be nice to also change the default save location for this feature to the home directory.
The export seems to work fine 👍 What did you change in the measurement tool and the trajectory dialog?
I changed the tab order.
Ready to merge @ab5424 @Michel-Heinz
Closes #326