Skip to content

Conversation

@sijiaww
Copy link
Contributor

@sijiaww sijiaww commented Nov 18, 2025

Summary

This PR includes a small set of fixes:

  1. Fix MU scaling in the VMAT SCP intermediate optimization to match Eclipse MU.
  2. Fix the clinical_criteria logic when checking and modifying criteria.

Changes

1. VMAT SCP MU scaling fix

In portpy/photon/vmat_scp/vmat_scp_optimization.py:

Adjust the lower-bound constraint on the interior beamlet intensities from:

constraints += [int_v >= self.vmat_params['mu_min']]

to

constraints += [int_v * 100 >= self.vmat_params['mu_min']]

This aligns MU handling within the SCP intermediate optimization with Eclipse’s MU scaling.

2. Clinical criteria handling

Both modify_criterion() and check_criterion_exists() contained the same logical error:
they compared a constraint key (string) to the entire constraint dictionary, which always evaluated to false.

The updated logic now:

  1. Properly matches criteria by type and parameters,
  2. Iterates through the relevant constraint keys,
  3. Updates only existing keys in the stored constraint dictionary,
  4. Raises a clear warning if no matching criterion is found.

Copy link
Collaborator

@gourav3017 gourav3017 left a comment

Choose a reason for hiding this comment

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

Changes approved

@gourav3017 gourav3017 merged commit c7c0e96 into PortPy-Project:master Nov 19, 2025
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants