Closed Michel-Heinz closed 2 months ago
The recent updates focus on enhancing the GUI to support multiple structures, adjusting OpenGL and shader versions for wider compatibility, and refining tests to accommodate these changes. These modifications span across various components of the application, including GUI elements, rendering processes, and associated test suites.
Files | Change Summary |
---|---|
.../structure_widget.py |
Updated to handle multiple structures; renamed variables and methods from singular to plural. |
.../shaders.py , .../__main__.py , .../Rendering/rendering.py |
Shader versions downgraded from 410 to 330 core; OpenGL version set to 3.3; adjusted rendering logic. |
.../test_shaders.py |
Renamed test function and updated expected hash values for shader sources. |
.../test_measurement_dialog.py , .../test_main_window.py |
Tests updated to handle lists of structures instead of single objects; modified assertions and initializations. |
🐇✨ In the realm of code, where shaders glow, Changes abound, the structures grow. Lists now hold what once was one, Compatibility's tune, sweetly sung. Hop, hop, hurray, let's render the show! 🌟 🐇✨
codecov/patch success (28)
src/molara/Gui/structure_widget.py: [warning] 81-81: src/molara/Gui/structure_widget.py#L81 Added line #L81 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 88-88: src/molara/Gui/structure_widget.py#L88 Added line #L88 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 111-111: src/molara/Gui/structure_widget.py#L111 Added line #L111 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 113-113: src/molara/Gui/structure_widget.py#L113 Added line #L113 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 163-163: src/molara/Gui/structure_widget.py#L163 Added line #L163 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 429-429: src/molara/Gui/structure_widget.py#L429 Added line #L429 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 438-439: src/molara/Gui/structure_widget.py#L438-L439 Added lines #L438 - L439 were not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 469-469: src/molara/Gui/structure_widget.py#L469 Added line #L469 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 488-489: src/molara/Gui/structure_widget.py#L488-L489 Added lines #L488 - L489 were not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 515-516: src/molara/Gui/structure_widget.py#L515-L516 Added lines #L515 - L516 were not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 524-525: src/molara/Gui/structure_widget.py#L524-L525 Added lines #L524 - L525 were not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 529-529: src/molara/Gui/structure_widget.py#L529 Added line #L529 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 574-575: src/molara/Gui/structure_widget.py#L574-L575 Added lines #L574 - L575 were not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 583-584: src/molara/Gui/structure_widget.py#L583-L584 Added lines #L583 - L584 were not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 588-588: src/molara/Gui/structure_widget.py#L588 Added line #L588 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 611-611: src/molara/Gui/structure_widget.py#L611 Added line #L611 was not covered by tests --- src/molara/Gui/structure_widget.py: [warning] 616-616: src/molara/Gui/structure_widget.py#L616 Added line #L616 was not covered by tests
src/molara/Gui/structure_widget.py (3)
`43-43`: Initialization of `structures` as an empty list is a good practice to avoid potential `AttributeError`. --- `110-115`: The `reset_view` method has several checks for the presence and properties of structures, which is good for robustness. However, consider simplifying the checks to improve readability. Consider merging some of the conditions to reduce complexity and improve code readability. --- `203-240`: The `set_vertex_attribute_objects` method updates vertex attribute objects for multiple structures. Ensure that the method handles empty or null structures to prevent runtime errors.Verification successful
--- The verification process has confirmed that the `set_vertex_attribute_objects` method includes checks for empty or null structures before accessing `structures[0]`. This is evident from the conditional check `if not len(self.structures) or not self.structures[0]:` found in the code. This implementation should effectively prevent runtime errors related to accessing null or non-existent elements in the `structures` list. - Location: `src/molara/Gui/structure_widget.py`Scripts Executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Check for null or empty checks in the method handling multiple structures. rg "structures\[0\]" src/molara/Gui/structure_widget.py ``` Length of output: 2777
What happened to code cov?
Attention: Patch coverage is 71.31148%
with 35 lines
in your changes are missing coverage. Please review.
Project coverage is 70.83%. Comparing base (
5fc6739
) to head (40470e9
). Report is 3 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What happened to code cov?
It's there now. I think it can be delayed from time to time, depending on traffic.
The measurement tool does not work correctly with the new code architecture. If you import a trajectory, you are not able to use the measurement tool anymore.
One receives the following error:
File "/Users/gfeldmann/GitHub/Molara/src/molara/Gui/main_window.py", line 168, in show_measurement_dialog if self.structure_widget.structure_is_set: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'StructureWidget' object has no attribute 'structure_is_set'. Did you mean: 'structures_is_set'?
I ll take a look at it. It sounds like a straight forward fix tho
@adrianusler Any idea why tests on ubuntu are failing? I cannot figure it out
I added a feature, where when a trajectory is loaded, all structures can be displayed at once. Therefore I enable loading multiple structures into the structure_widget. Please have a look and test a bit!
Summary by CodeRabbit
New Features
Refactor
Bug Fixes