Skip to content

Conversation

jokasimr
Copy link
Contributor

@jokasimr jokasimr commented Jul 29, 2025

Fixes #150

First change is refactoring to make it a bit easier to understand what part of the init function deals with what components of the GUI.

Second change adds a "reference" column to the reduction table to let the user specify what reference measurement to use for that reflectivity curve.

@jokasimr jokasimr changed the title refactor: separate initialization into sub-initializers feat: add reference column to reduction table Jul 29, 2025
@github-project-automation github-project-automation bot moved this to In progress in Development Board Jul 29, 2025
@jokasimr jokasimr moved this from In progress to Selected in Development Board Jul 29, 2025
@jokasimr jokasimr requested a review from jl-wynen August 22, 2025 07:55
self.run_number_max = widgets.IntText(
value=9999, description='', layout=widgets.Layout(width='5em')

def _init_display_component(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really the intention of this PR, but since you split this into 'components', you could also make different classes and compose them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's possible. Right now I don't think they are independent enough for that. There would be tight coupling between the main GUI class and the "components" anyway, and in that case it's easier to just keep them together. Eventually maybe some of them could be refactored out as separate components.

@@ -491,6 +509,9 @@ def add_row(_):
'QBins': 391,
'QStart': 0.01,
'QStop': 0.3,
'Reference': self.reference_table.data.iloc[0]['Sample']
if len(self.reference_table.data) > 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like there can be more than 1 element in self.reference_table.data but only the first one is used in 'Reference'. What happens to the other elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets the default value of the Reference column to be the first entry in the reference table.
It's up to the user to change that to something else if there are more than one entry in the reference table.

@jokasimr jokasimr enabled auto-merge August 26, 2025 10:49
@jokasimr jokasimr merged commit 5c17fe9 into main Aug 26, 2025
4 checks passed
@jokasimr jokasimr deleted the gui-select-reference branch August 26, 2025 10:58
@github-project-automation github-project-automation bot moved this from Selected to Done in Development Board Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[GUI] How to determine what reference measurement to use?
2 participants