| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
Sorry, something went wrong.
There was a problem hiding this comment.
a couple simple questions and suggestions. LGTM otherwise? Thanks Reem !
Sorry, something went wrong.
|
|
||
| @pytest.fixture | ||
| def perfect_sine_wave() -> SyntheticSignal: | ||
| """Generates a mathematically perfect synthetic signal to verify period recovery.""" |
There was a problem hiding this comment.
"mathematically perfect" is ill-defined, especially wherever floating points arithmetics is involved. I'd suggest narrowing down the description to make it more useful and accurate
Sorry, something went wrong.
|
|
||
| assert type(power) is np.ndarray | ||
| assert power.dtype == np.float64 | ||
| assert np.any(np.isfinite(power)) |
There was a problem hiding this comment.
this feels a bit surprising (not saying it's incorrect !) from a naive standpoint. Does the implementation offer any guarantee regarding NaNs and infinities ?
(I'm deliberately avoiding reading it so as to see if tests are enough to understand it)
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah understandable, it actually doesn't really guarantee no NaNs if it's fed bad data (like zero variance). That line is just a low-level sanity check to prove that a valid input successfully returns real floats instead of un-initialized memory garbage. I've swapped it to np.all and added a quick inline comment too!!
Sorry, something went wrong.
| @dataclass(kw_only=True, slots=True, frozen=True) | ||
| class NormMatrix: | ||
| norm_type: str |
There was a problem hiding this comment.
a single-member zero-method immutable dataclass is probably overkill here. I'd suggest using a NewType instead, but a raw str would seem sufficient too
Sorry, something went wrong.
| assert np.any(np.isfinite(power)) | ||
|
|
||
|
|
||
| def test_cython_lombscargle_trapdoors(perfect_sine_wave: SyntheticSignal): |
There was a problem hiding this comment.
improve search
| def test_cython_lombscargle_trapdoors(perfect_sine_wave: SyntheticSignal): | |
| def test_cython_lombscargle_exceptions(perfect_sine_wave: SyntheticSignal): |
Sorry, something went wrong.
this seems worthy of some inline comment in the fixture |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Hi everyone! This PR tackles the LombScargle Cython extension testing for my GSoC project.
Instead of routing through the high-level LombScargle API, this suite hits the Cython wrapper (lombscargle_cython) directly to ensure the math and memory allocations hold up in complete isolation.
Key additions:
cc: @neutrinoceros