Skip to content

Validate X-ray energy and wavelength inputs - #153

Open
swf1996120 wants to merge 1 commit into
python-periodictable:masterfrom
swf1996120:validate-xray-domain-inputs
Open

swf1996120 wants to merge 1 commit into
python-periodictable:masterfrom
swf1996120:validate-xray-domain-inputs

Conversation

@swf1996120

Copy link
Copy Markdown

Chemical repository testing study: validate X-ray conversion domains

This pull request addresses #152.

xray_wavelength() and xray_energy() now reject zero, negative, NaN, and infinite inputs with ValueError. Valid scalar and vector inputs retain the current conversion behavior. This prevents nonphysical values from propagating into X-ray scattering-factor, SLD, and refractive-index calculations.

Tests cover the invalid scalar domain and confirm vector support.

Testing disclosure: this patch was developed as part of an LLM-assisted chemical repository testing study. The candidate cases were generated with LLM assistance, then reproduced locally, minimized, and fixed with a focused validation patch and tests.

This branch has not been deployed

No deployments
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.

1 participant