Skip to content

Uniform spectrum#140

Merged
augustocattafesta merged 5 commits into
mainfrom
uniform_spectrum
May 26, 2026
Merged

Uniform spectrum#140
augustocattafesta merged 5 commits into
mainfrom
uniform_spectrum

Conversation

@augustocattafesta
Copy link
Copy Markdown
Collaborator

No description provided.

@augustocattafesta augustocattafesta requested a review from Copilot May 26, 2026 13:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new UniformSpectrum implementation to generate X-ray energies uniformly between two bounds, and updates the hexagonal-grid ADC routing helpers to support NumPy-array (vectorized) inputs.

Changes:

  • Added UniformSpectrum (rvs() + plotting support) and exposed it via hexsample.source.
  • Added a unit test validating UniformSpectrum.rvs() output range and basic plotting.
  • Updated ADC routing sequences/functions in hexagon.py to operate with NumPy arrays (enabling vectorized routing).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
tests/test_source.py Adds UniformSpectrum import and a new test for sampling bounds/plotting.
src/hexsample/source.py Introduces the UniformSpectrum spectrum type and exports it.
src/hexsample/hexagon.py Switches ADC lookup sequences to NumPy arrays and updates ADC-channel functions’ typing/docs for vectorized use.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/hexsample/source.py
Comment thread src/hexsample/hexagon.py
Comment on lines 127 to 130
_N_ADC_CHANNELS = 7
_ADC_SEQUENCE_EVEN = (0, 2, 5, 0, 3, 5, 1, 3, 6, 1, 4, 6, 2, 4)
_ADC_SEQUENCE_ODD = (0, 3, 5, 1, 3, 6, 1, 4, 6, 2, 4, 0, 2, 5)
_ADC_SEQUENCE_EVEN = np.array([0, 2, 5, 0, 3, 5, 1, 3, 6, 1, 4, 6, 2, 4])
_ADC_SEQUENCE_ODD = np.array([0, 3, 5, 1, 3, 6, 1, 4, 6, 2, 4, 0, 2, 5])
_ADC_SEQUENCE_LENGTH = len(_ADC_SEQUENCE_EVEN)
Comment thread src/hexsample/hexagon.py Outdated
Comment thread src/hexsample/hexagon.py Outdated
Comment thread src/hexsample/hexagon.py Outdated
Comment thread src/hexsample/hexagon.py Outdated
@augustocattafesta augustocattafesta merged commit 5fac8ef into main May 26, 2026
2 checks passed
@augustocattafesta augustocattafesta deleted the uniform_spectrum branch May 26, 2026 13:31
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