Skip to content

added check for length of value passed into EnergyFilter - #2887

Merged
paulromano merged 1 commit into
openmc-dev:developfrom
shimwell:adding_check_to_energy_filter_value_length
Apr 11, 2024
Merged

paulromano merged 1 commit into
openmc-dev:developfrom
shimwell:adding_check_to_energy_filter_value_length

Conversation

@shimwell

@shimwell shimwell commented Mar 1, 2024

Copy link
Copy Markdown
Member

Motivated put this thread on the forum where a user was able to make an EnergyFilter with a single value. In the docstring the energyfilter requires at least a pair of numbers to work.

This PR adds a check on the EnergyFilter value length to ensure it is a minimum value of 2.

Description

Please include a summary of the change and which issue is fixed if applicable. Please also include relevant motivation and context.

Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@paulromano paulromano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the improvement!

@paulromano
paulromano merged commit cfebe16 into openmc-dev:develop Apr 11, 2024
church89 pushed a commit to openmsr/openmc that referenced this pull request Jul 18, 2024
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
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