Skip to content

[RomApp] [Fast PR] Add empty list parameter to CustomizeSimulation calls - #14852

Merged
Rbravo555 merged 3 commits into
masterfrom
RomManager_InitializeDummySimulation_CustomizeSimulation_fix
Oct 9, 2026
Merged

Rbravo555 merged 3 commits into
masterfrom
RomManager_InitializeDummySimulation_CustomizeSimulation_fix

Conversation

@Marco1410

Copy link
Copy Markdown
Contributor

📝 Description

An empty list is added to calls to CustomizeSimulation in InitializeDummySimulation's to avoid the missing argument error "CustomizeSimulation() missing 1 required positional argument: 'mu'" when starting a simulation with RomManager.

@Marco1410
Marco1410 requested a review from a team as a code owner October 8, 2026 19:27
@Marco1410 Marco1410 added FastPR This Pr is simple and / or has been already tested and the revision should be fast Bugfix ROM labels Oct 8, 2026
@Rbravo555

Copy link
Copy Markdown
Member

Hi @Marco1410, thanks for catching this. I pushed two commits top of yours, hope that's OK.

Passing [] fixes the missing-argument error, but it breaks users who follow the documented signature and guard on None:

def CustomizeSimulation(cls, global_model, parameters, mu=None):
    ...
    def Initialize(self):
        super().Initialize()
        if mu is not None:
            self.value = mu[0]   # IndexError with mu=[]

This works on master and fails with [], since the dummy simulations call Initialize().

Instead of a placeholder, the dummy simulations now receive an actual parameter, mu_train[0], which is already available in every caller:

  • the three InitializeDummySimulationFor* methods take mu=None and forward it to CustomizeSimulation
  • _LaunchTrainHROM, _LaunchTrainPG and _PrintRomBasis (via _LaunchComputeSolutionBasis / _LoadSolutionBasis) pass mu_train[0]

This fixes your case and also the case where mu is used unguarded in Initialize, which fails on master, with [] and with None.

@Rbravo555

Copy link
Copy Markdown
Member

It passes all the tests including the edge case. We move forward by approcing this Fast PR

@Rbravo555
Rbravo555 merged commit ec8adbe into master Oct 9, 2026
10 checks passed
@Rbravo555
Rbravo555 deleted the RomManager_InitializeDummySimulation_CustomizeSimulation_fix branch October 9, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix FastPR This Pr is simple and / or has been already tested and the revision should be fast ROM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants