Skip to content

Fix parameter inspection for dynamic MicroSimulation class#255

Merged
IshaanDesai merged 3 commits into
developfrom
fix-init-args
May 12, 2026
Merged

Fix parameter inspection for dynamic MicroSimulation class#255
IshaanDesai merged 3 commits into
developfrom
fix-init-args

Conversation

@Snapex2409
Copy link
Copy Markdown
Collaborator

@Snapex2409 Snapex2409 commented May 5, 2026

As encountered in issue #248, the initialize method
of the dynamically created CompatibilityWrapper class passes parameters as *args, **kwargs.
Subsequent inspection using inspect.getfullargspec does not recognize that positional parameters are required.
This results in no input data being provided to the initialize method.

The provided implementation remedies that by exposing positional parameters.

Checklist:

  • I made sure that the CI passed before I ask for a review.
  • I added a summary of the changes (compared to the last release) in the CHANGELOG.md.
  • If necessary, I made changes to the documentation and/or added new content.
  • I will remember to squash-and-merge, providing a useful summary of the changes of this PR.

@Snapex2409 Snapex2409 requested a review from IshaanDesai May 5, 2026 15:58
@IshaanDesai IshaanDesai marked this pull request as ready for review May 6, 2026 14:25
Copy link
Copy Markdown
Member

@IshaanDesai IshaanDesai left a comment

Choose a reason for hiding this comment

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

Looks good 👍 I haven't tested this yet, but I assume it works. I want to add a variant of the integration test that uses initial macro data in the micro simulation.

@IshaanDesai IshaanDesai linked an issue May 8, 2026 that may be closed by this pull request
@steffenger
Copy link
Copy Markdown

I tested it, so the issue #248 was resolved:D

@IshaanDesai IshaanDesai merged commit 93735d2 into develop May 12, 2026
10 checks passed
@IshaanDesai IshaanDesai deleted the fix-init-args branch May 12, 2026 14:39
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.

Cannot use MicroSimulation.initialize() with macro_data anymore

3 participants