Closed DanicaSTFC closed 7 months ago
TO DO: (DONE 05/12/2023)
insertWidgetToVerticalLayout
._addWidget
so it invokes insertWidgetToFormLayout
.@lauramurgatroyd I still need to fix the example "Insert widget" and "Remove widget" and the unit tests. Could you start having a look at it because I have made a lot of changes in this PR, please?
Note after meeting (07/12/2023): for the first review, please do not look at example insert widget yet.
(DONE ON 09/01/2024) After group discussion, we decided to change the state format to have widget number in both roles: field and label.
After first review:
Closes issue #107. Partially resolves issue #108.
getWidgetFromVerticalLayout
removeWidgetFromVerticalLayout
test_get_name_and_role_from_key_or_widget
.adaptFormToStates
. This is not included in this PR and will be saved in a separate branch. Its unit test has also been removed.TO DO (12/01/2024):
TO DO (19/01/2024):
before I submit a detailed review... some high-level points after meeting with @DanicaSTFC @lauramurgatroyd @paskino:
removed_widgets_dictionary
unless we have a use-case for it
removeWidget
return the removed widget (similar to list.pop()
, so the user can save it themselves if they want)widget_number_dictionary
a list
... or even merge it with widgets
@casperdcl Thank you for your commits. When I pulled them 128 tests failed and 8 passed. I do not see a red cross in the checks above. Could you look into why the checks have passed in GitHub? Also, would you like to fix the code or should I do it?
128 tests failed and 8 passed. I do not see a red cross in the checks above. Could you look into why the checks have passed in GitHub? Also, would you like to fix the code or should I do it?
Please do push any fixes! It might help me find the problem(s) with the tests :/
128 tests failed and 8 passed. I do not see a red cross in the checks above. Could you look into why the checks have passed in GitHub? Also, would you like to fix the code or should I do it?
Please do push any fixes! It might help me find the problem(s) with the tests :/
I fixed most errors. The screenshot shows a a recurring error in the tests. If I delete the folder they run again.
I fixed most errors. The screenshot shows a a recurring error in the tests. If I delete the folder they run again.
unrelated #128 lol. Issue number 128 for 128 failing tests :D
TL;DR you probably had 1 failing test which didn't clean up after itself so it causes the rest to fail.
@casperdcl Regarding the style of the docstring I am trying to use the CIL convention (with the spaces around ":"). Ideally we would change all of them to be consistent.
spaces around ":"
ah ok sure https://numpydoc.readthedocs.io/en/latest/format.html#parameters no problem.
Closes #103 closes #105 closes #95 Closes issue https://github.com/TomographicImaging/eqt/issues/107. Partially resolves 108.
Full summary:
INSERT WIDGET CHANGES
insertWidgetToFormLayout
toUIFormWidget
,FormDockWidget
andFormDialog
.insertWidget
toinsertWidgetToVerticalLayout
in FormDialog.insertWidgetToFormLayout
.insertWidgetToVerticalLayout
.list_all_widgets
to the unit test classFormsCommonTests
.add_every_spanning_widget
to the unit test classFormsCommonTests
._addWidget
so it invokesinsertWidgetToFormLayout
.insert_widgets_example
DICTIONARY CHANGES
popWidgetFromDictionary
.getWidgetRow
.STATE SAVING CHANGES
getWidgetState
so it reads the widget row too.applyWidgetState
so it sets the widget row.getNameAndRoleFromNameKey
and_getNameAndRoleFromWidget
applyWidgetStates
so it checks states are the same as in the form.OTHER CHANGES
setDefaultWidgetStatesVisibleTrue
Before first review.
INSERT WIDGET CHANGES
insertWidget
toinsertWidgetToVerticalLayout
in FormDialog.insertWidgetToVerticalLayout
.insertWidgetToFormLayout
toUIFormWidget
,FormDockWidget
andFormDialog
.insertWidgetToFormLayout
.list_all_widgets
to the unit test classFormsCommonTests
.add_every_spanning_widget
to the unit test classFormsCommonTests
._addWidget
so it invokesinsertWidgetToFormLayout
.insert_widgets_example
DICTIONARY CHANGES
increaseNumWidgets
anddecreaseNumWidgets
.populateWidgetDictionary
.removeWidgetFromDictionary
.removeWidget
so that it creates and populatesself.removed_widget_dictionary
.getRemovedWidgets
_addWidget
.getWidgetNumber
._populateWidgetNumberDictionary
and_popWidgetNumberDictionary
.STATE SAVING CHANGES
getWidgetState
so it reads the widget number too.applyWidgetState
so it sets the widget number.getNameAndRoleFromNameKey
and_getNameAndRoleFromWidget
applyWidgetStates
so it removes/inserts the widgets in the form in accordance with the widgets present in the stateOTHER CHANGES
setDefaultWidgetStatesVisibleTrue