24-produce-radiation-distribution-observation-test - #27
rsweeney-cfs wants to merge 1 commit into
Conversation
MishaVeldhoen
left a comment
There was a problem hiding this comment.
The test looks great to me!
Some thoughts on the voxelized 3D grid observe idea:
- When comparing the matrix against the current approach, you might want to consider a dedicated check involving more structures, and more observes per structure, to reduce the effect of statistical noise.
- I expect narrower structures to be more problematic in the comparison, those could help guide the resolution that you want your matrix to be.
| @pytest.fixture(scope="module") | ||
| def observed(): | ||
| """Build + observe once; shared across the assertions in this module.""" | ||
| pytest.importorskip("cherab", reason="cherab not installed") | ||
| pytest.importorskip("raysect", reason="raysect not installed") | ||
| golden = _load_golden() | ||
| return golden, _build_and_observe(golden["_meta"]) |
There was a problem hiding this comment.
Good use of a fixture, this helps with not having to rerun the observe for each test.
There was a problem hiding this comment.
@MishaVeldhoen, regarding your above comment about voxelization, I agree that this is the first test of many that should exist to verify that its working properly when compared with the existing radiation structure building method. On the statistical noise, I believe you now have the solution where we can provide Raysect with the random seed, thereby making it reproducible. Narrower structures are a good idea. I captured the need for this 3D voxelization in this issue: #32.
|
@rsweeney-cfs In #30 I've introduced a pytest marker, which is the pytest way to label tests for the purpose of opting in or out. If that PR merges before this one, then it can adopt that too. Emis3D/tests/test_seeded_observation_reproducible.py Lines 19 to 22 in bdee827 Also, with the change in that PR, this test could drop the high tolerance. |
14a7a23 to
d425d40
Compare
|
Please update with the latest branch. |
This is a test of the observation of a DIII-D elongated ring. This test was fully implemented by Claude. Ryan read through the changes and confirmed that the test successfully runs. Below is Claude's summary:
*The motivation for this test is to prepare for an additional radDist observation workflow that leverages a dense, 3D voxelized grid that is observed once and used for all future builds. This is expected to allow rapid radDist development between SPARC pulses, using reconstructed disruption equilibria.