Problem
The chartmap file format should not store redundant endpoint planes for periodic quantities. Periodicity is part of the coordinate convention; the file should contain only unique angular samples.
The durable file-level convention should be:
theta[j] = j * 2*pi / ntheta, j = 0..ntheta-1, endpoint excluded.
zeta[k] = k * (2*pi/num_field_periods) / nzeta, k = 0..nzeta-1, endpoint excluded.
- All periodic variables use those endpoint-excluded dimensions in the file.
- Any endpoint-included arrays needed by the spline backend are constructed internally by the reader / spline setup code, not written to NetCDF.
The current chartmap validator already enforces endpoint-excluded periodic grids for theta and zeta, but downstream users can still leak spline-constructor details into their file schema by storing separate endpoint-included periodic variables.
Required changes
-
Make the chartmap convention explicit in libneo docs and/or validator comments:
- angular coordinates in the file are endpoint-excluded;
- redundant endpoint planes are not part of the chartmap format;
- periodic closure is a reader/spline-construction responsibility.
-
Add reusable internal helpers for periodic extension before calling the current spline backend, e.g.
- scalar periodic extension in theta and/or zeta by copying the first plane;
- vector/geometry extension only after the representation is actually periodic. For Boozer Cartesian geometry this must wait for / use a rotating-frame representation, not raw
x,y,z.
-
Keep the spline backend free to use endpoint-included temporary arrays if needed, but do not require endpoint-included variables in NetCDF.
-
Decide and document the compatibility policy for legacy files that contain redundant endpoint-included variables outside the base chartmap schema.
Acceptance criteria
- The documented chartmap convention is unambiguous: endpoint-excluded periodic grids in files; internal endpoint construction only.
- No new chartmap writer in libneo writes redundant angular endpoint planes.
- Readers construct exact closure internally where required by
construct_batch_splines_3d.
- Existing base chartmap validation remains strict about endpoint exclusion.
Fast and reliable tests required
Add tests at multiple levels, with small grids so they are fast in CI:
-
Unit tests for periodic extension helpers:
- scalar values append exactly first theta/zeta slice;
- no interpolation or floating-point re-evaluation is used to create the duplicate endpoint;
- shape,
x_min, x_max, and implied h_step are correct.
-
Validator tests:
- endpoint-excluded
theta/zeta accepted;
- endpoint-included angular coordinate arrays rejected for base chartmap coordinates.
-
Spline smoke tests:
- an endpoint-excluded periodic analytic scalar is extended internally and evaluates continuously across the seam;
- tests must cover both theta and zeta periodicity.
-
Regression tests for representative chartmap files generated by libneo tools, ensuring they contain no redundant angular endpoint planes.
Problem
The chartmap file format should not store redundant endpoint planes for periodic quantities. Periodicity is part of the coordinate convention; the file should contain only unique angular samples.
The durable file-level convention should be:
theta[j] = j * 2*pi / ntheta,j = 0..ntheta-1, endpoint excluded.zeta[k] = k * (2*pi/num_field_periods) / nzeta,k = 0..nzeta-1, endpoint excluded.The current chartmap validator already enforces endpoint-excluded periodic grids for
thetaandzeta, but downstream users can still leak spline-constructor details into their file schema by storing separate endpoint-included periodic variables.Required changes
Make the chartmap convention explicit in libneo docs and/or validator comments:
Add reusable internal helpers for periodic extension before calling the current spline backend, e.g.
x,y,z.Keep the spline backend free to use endpoint-included temporary arrays if needed, but do not require endpoint-included variables in NetCDF.
Decide and document the compatibility policy for legacy files that contain redundant endpoint-included variables outside the base chartmap schema.
Acceptance criteria
construct_batch_splines_3d.Fast and reliable tests required
Add tests at multiple levels, with small grids so they are fast in CI:
Unit tests for periodic extension helpers:
x_min,x_max, and impliedh_stepare correct.Validator tests:
theta/zetaaccepted;Spline smoke tests:
Regression tests for representative chartmap files generated by libneo tools, ensuring they contain no redundant angular endpoint planes.