Skip to content

Conversation

@adhamrait
Copy link
Contributor

Add components to change the uncertainty in alpha and beta in the gui:
image

@adhamrait adhamrait requested review from EZoni and RemiLehe December 11, 2025 23:02
@adhamrait
Copy link
Contributor Author

image Added the two separate variables and a toggle to display one or the other (currently gives an error if trying to display the inferred calibration values)

Comment on lines 108 to 110
with html.Div(
style="display: flex; align-items: center; margin: 20px; justify-content: space-between;"
):
Copy link
Member

Choose a reason for hiding this comment

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

Can you remind me/us again on why we wrap everything within a with html.Div():? What does this accomplish specifically? Just trying to understand if it's necessary, optional, if it should be used elsewhere/everywhere where we set up other graphical components, etc. I'm sure I haven't used it consistently, or at all, so far, so I want to make sure I understand why it's here and what it does.

Copy link
Member

Choose a reason for hiding this comment

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

I can also search the answer online, I'm asking just in case you have the answer ready off the top of your head.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wrapped this in a div so that the alpha and beta sections are separate and they're flexboxes, but looking at it now I can just use a VRow to be more consistent with other parts of the code

for _, value in simulation_calibration.items():
sim_name = value["name"]
exp_name = value["depends_on"]
df_sim[exp_name] = df_sim[sim_name] / value["alpha"] + value["beta"]
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we can find a way to write the formulas with formatting that looks more consistent, while keeping Ruff happy?

For sim to exp we have:

  • Lines 19-21:
df_sim[exp_name] = (
    df_sim[sim_name] / value["alpha_guess"] + value["beta_guess"]
)
  • Lines 27-30:
df_sim[exp_name] = (
    df_sim[sim_name] / value["alpha_inferred"]
    + value["beta_inferred"]
)

I think these two are okay, probably Ruff complains about having the second one on one line (does it?).



For exp to sim we have:

  • Lines 61-63:
sim_dict[sim_name] = (exp_dict[exp_name] - value["beta_guess"]) * value[
    "alpha_guess"
]
  • Lines 69-71:
sim_dict[sim_name] = (
    exp_dict[exp_name] - value["beta_inferred"]
) * value["alpha_inferred"]

I think we could fix these two. Maybe something like

sim_dict[sim_name] = (
    value["alpha_guess"]
    * (exp_dict[exp_name] - value["beta_guess"])
)

and

sim_dict[sim_name] = (
    value["alpha_inferred"]
    * (exp_dict[exp_name] - value["beta_inferred"])
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I split the conversion into its own function, how does that look?

Copy link
Member

@EZoni EZoni Dec 18, 2025

Choose a reason for hiding this comment

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

I like the idea of using functions, but I wonder if they should be declared and defined in calibration_manager.py.

They would then be used directly here, and possibly reused within the same module by convert_sim_to_exp in place of

df_sim[exp_name] = df_sim[sim_name] / value["alpha"] + value["beta"]

and by convert_exp_to_sim in place of
sim_val = (exp_dict[exp_name] - value["beta"]) * value["alpha"]

This comment was marked as outdated.

@EZoni EZoni added ml Tasks associated with training ML models dashboard Tasks associated with the Trame dashboard labels Dec 18, 2025
@EZoni EZoni self-requested a review December 19, 2025 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard Tasks associated with the Trame dashboard ml Tasks associated with training ML models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants