Closed Michel-Heinz closed 2 months ago
The recent update in the Molara project introduces a "Structure Customizer" feature, enhancing user interaction by enabling customization of molecular structures through new UI components and settings. This update involves adjustments in GUI actions, dialog implementations, and backend modifications to support these new functionalities.
File Path | Change Summary |
---|---|
.../Settings/Structure/Default.json , src/molara/Gui/structure_widget.py |
Introduced settings for stick mode, bonds, ball size, and stick size. Updated bond handling methods and removed toggle_bonds method. |
src/molara/Gui/structure_customizer_dialog.py , src/molara/Gui/structure_widget.py |
Introduced a dialog for manipulating structure appearance in the GUI. Users can customize ball and stick sizes, toggle stick and ball modes, show/hide bonds, save/load settings, and delete saved settings. |
src/molara/Structure/drawer.py , tests/molara/Structure/test_drawer.py |
Updated properties initialization and added methods for handling cylinder dimensions and properties in drawer.py . Increased sphere subdivisions in test setup. |
tests/molara/gui/test_main_window.py |
Modified test case to call toggle_bonds from structure_customizer_dialog instead of structure_widget . |
🐇💻✨ In the digital burrow, beneath the code's deep layer, A rabbit hopped with joy, for changes debonair. "Click and tweak," it squeaked, with glee, "For molecules, as vast as sea!" Customise your view, let structures freely sway, In Molara's land, where atoms dance and play. 🌟🔬
codecov/patch success (10)
src/molara/Gui/structure_customizer_dialog.py: [warning] 82-84: src/molara/Gui/structure_customizer_dialog.py#L82-L84 Added lines #L82 - L84 were not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 102-102: src/molara/Gui/structure_customizer_dialog.py#L102 Added line #L102 was not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 116-118: src/molara/Gui/structure_customizer_dialog.py#L116-L118 Added lines #L116 - L118 were not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 133-136: src/molara/Gui/structure_customizer_dialog.py#L133-L136 Added lines #L133 - L136 were not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 155-155: src/molara/Gui/structure_customizer_dialog.py#L155 Added line #L155 was not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 167-167: src/molara/Gui/structure_customizer_dialog.py#L167 Added line #L167 was not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 169-171: src/molara/Gui/structure_customizer_dialog.py#L169-L171 Added lines #L169 - L171 were not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 194-204: src/molara/Gui/structure_customizer_dialog.py#L194-L204 Added lines #L194 - L204 were not covered by tests --- src/molara/Gui/structure_customizer_dialog.py: [warning] 206-210: src/molara/Gui/structure_customizer_dialog.py#L206-L210 Added lines #L206 - L210 were not covered by tests
src/molara/Gui/structure_customizer_dialog.py (3)
`77-84`: Ensure that the `delete_settings` method is covered by tests, especially since it involves file operations which can be prone to errors. --- `86-99`: Consider adding error handling for file operations and JSON parsing in the `load_settings` method to manage exceptions such as missing files or invalid JSON data gracefully. --- `192-210`: Verify the presence of structures and that they have bonds before toggling stick mode to prevent potential errors from accessing properties on an empty list or structures without bonds.
Attention: Patch coverage is 85.89744%
with 33 lines
in your changes are missing coverage. Please review.
Project coverage is 71.72%. Comparing base (
7f83c43
) to head (2a230c6
).
Files | Patch % | Lines |
---|---|---|
src/molara/Gui/structure_customizer_dialog.py | 76.29% | 32 Missing :warning: |
src/molara/Structure/drawer.py | 93.33% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Nice feature, looks really good so far. I have four minor issues to address.
Nice feature, looks really good so far. I have four minor issues to address.
- The names of the settings are not case sensitive. Is this intended?
- You cannot change the settings without a molecule imported. Again, is this intended?
- I think it would be good if we add a query, whether a setting should be deleted. This is not big of an issue atm. However, if we increases the variety of settings, this will be crucial.
- The json for the settings is currently in a structures folder, I guess you intend to use several json for differing settings. I think we should actually put it in one. Imo, as this is in a dictionary style, it is still clearly arranged and you will not get lost in several setting files.
1 Interesting, i thought the would cas sensitive, I ll have a look 2 Never thoguht about that, but makes sense, how do you want to change something if you don t see what you are doing? 3 Already implemented, but not pushed 4 Thought about that decided not to do that, in order for user to exchange single setting files without much work :)
@GereonFeldmann
The pull request for the structure customizer is here. You can open the menu under view->Open Structure Customizer You can save, delete, and load presets. The Default preset is loaded upon starting and can be overwritten.
Summary by CodeRabbit
New Features
Enhancements
drawer.py
file to enhance customization of molecular structures.