Skip to content

Commit 027332e

Browse files
committed
docs: summarize issue-095 cleanup
1 parent efbafa9 commit 027332e

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

CLEANUP.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ISSUE-095 cleanup summary
2+
3+
This branch keeps the 1D `LearnerND` behavior from `issue-095-impl-py` and only
4+
refactors the implementation and tests for clarity.
5+
6+
## What changed
7+
8+
### `refactor: consolidate 1D cleanup tests`
9+
10+
- Folded repeated 1D triangulation cases into parametrized tests.
11+
- Reused small helpers in the new 1D `LearnerND` unit tests instead of repeating
12+
the same setup and tell/ask flow.
13+
- Consolidated the 1D and 2D integration smoke tests so the shared runner
14+
behavior is checked in one place.
15+
16+
Why: the original 1D test additions covered the right behavior but repeated a
17+
lot of setup and assertions, which made the cleanup surface harder to review.
18+
19+
### `refactor: clarify 1D triangulation and interpolation`
20+
21+
- Extracted `_flat_simplices()` so the 1D triangulation initialisation reads as
22+
one explicit helper instead of an inline special-case loop.
23+
- Renamed local variables in `simplex_volume_in_embedding()` so the 2-vertex
24+
branch and the embedding-dimension branch are easier to read.
25+
- Extracted `_sorted_line_data()` and `_plot_1d()` in `LearnerND` so the 1D
26+
interpolation and plotting paths are short, named, and isolated.
27+
- Updated the `plot()` docstring to match the current 1D+2D behavior.
28+
29+
Why: the 1D support is still a real special case, but these helpers make the
30+
special handling intentional and easier to follow without changing behavior.
31+
32+
### `refactor: simplify DataSaver key reconstruction`
33+
34+
- Replaced `_to_key(..., use_tuple=...)` with two small helpers:
35+
`_mapping_uses_tuple_keys()` and `_row_to_key()`.
36+
- Switched `load_dataframe()` to inspect `self.learner.data` directly instead of
37+
relying on `__getattr__` indirection.
38+
- Renamed `keys` to `input_columns` to match what the variable actually holds.
39+
40+
Why: the 1D `LearnerND` DataFrame fix depends on whether the wrapped learner uses
41+
tuple keys for single inputs, and the new helper names make that rule explicit.
42+
43+
## Guardrails kept
44+
45+
- No public API changes.
46+
- No behavior changes intended.
47+
- Full `python -m pytest adaptive/tests/ -x --no-cov` runs were used to verify
48+
each cleanup slice before it was committed.

0 commit comments

Comments
 (0)