Skip to content

Expose integer isspecular and isextdet in pMMC - #130

Merged
fangq merged 1 commit into
fangq:masterfrom
lpattelli:fix/pmmc-config-parity
Jul 2, 2026
Merged

Expose integer isspecular and isextdet in pMMC#130
fangq merged 1 commit into
fangq:masterfrom
lpattelli:fix/pmmc-config-parity

Conversation

@lpattelli

Copy link
Copy Markdown
Contributor

This PR improves pMMC configuration parity with the MMC core/MMCLAB for two existing configuration fields.

Changes:

  • Parse cfg.isspecular as an integer in pMMC instead of a boolean.
  • Expose cfg.isextdet through the pMMC Python config parser.

Rationale:

The MMC core already supports integer-valued isspecular modes, including code paths that check for isspecular == 2. MMCLAB passes this scalar configuration value through without casting it to boolean, but pMMC currently parses it as a boolean, preventing Python users from selecting the full set of supported modes.

The core also uses isextdet for external wide-field detector domains, but this field is not currently parsed by pMMC. Exposing it makes the Python wrapper more consistent with the core configuration structure and with MMCLAB behavior.

Optionally, one could also parse isextdet as py::int_ instead of py::bool_, because mcconfig.isextdet is an int and MMCLAB accepts scalar numeric fields. But semantically it is a flag, and py::bool_ accepts Python True/False and numeric truthiness. So it is mostly a matter of whether we want maximum consistency with the C field type

This change should be backward compatible: existing boolean-style uses of isspecular and omitted/default isextdet behavior are unchanged.

@fangq
fangq merged commit e4e57b0 into fangq:master Jul 2, 2026
43 checks passed
@fangq

fangq commented Jul 2, 2026

Copy link
Copy Markdown
Owner

thanks, merged

@lpattelli
lpattelli deleted the fix/pmmc-config-parity branch July 2, 2026 08:03
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