Skip to content

Commit fee65c6

Browse files
authored
Merge pull request #35 from shaia/foundation/phase3-global-defaults
docs: Mark Phase 3 (Global Configuration System) as complete in roadmap
2 parents 79c4898 + 690d11a commit fee65c6

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

ROADMAP.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,15 @@ The VTK reader had zero dedicated tests and VTKData accepted any data without va
6363

6464
---
6565

66-
## Phase 3: Global Configuration System
66+
## Phase 3: Global Configuration System - COMPLETE
6767

68-
**Priority:** P1 - Biggest daily-use friction point
69-
**Target:** v0.2.0
68+
**Status:** Completed (2026-03-07)
7069

71-
Every plotting function has hardcoded defaults (`cmap="viridis"`, `figsize=(8,6)`, `dpi=150`). A researcher who prefers a specific colormap for publications must pass it to every single call. There are 18+ hardcoded colormap strings across plotting modules.
72-
73-
### Tasks
74-
75-
- [ ] **3.1 Create `PlotDefaults` dataclass** - `cmap`, `diverging_cmap`, `figsize`, `dpi`, `levels`, `font_size`. Provide `get_defaults()` / `set_defaults()` functions
76-
- [ ] **3.2 Add context manager** - `with cfd_viz.plot_context(cmap="coolwarm", dpi=300):` for temporary overrides
77-
- [ ] **3.3 Support config file** - read `[tool.cfd_viz]` from pyproject.toml or standalone `cfd_viz.toml` for project-level defaults
78-
- [ ] **3.4 Migrate plotting functions** - replace hardcoded defaults with `get_defaults()` calls across all plotting modules
79-
- [ ] **3.5 Add configuration tests** - default override, context manager nesting, config file loading
80-
81-
### Success Criteria
82-
83-
- `cfd_viz.set_defaults(cmap="coolwarm")` changes all subsequent plots
84-
- Context manager correctly restores previous defaults
85-
- All existing examples and tests pass without changes
70+
- [x] **3.1 Create `PlotDefaults` dataclass** (`cfd_viz/defaults.py`) - `cmap`, `diverging_cmap`, `sequential_cmap`, `figsize`, `dpi`, `levels`, `font_size`, `colorscale`, `diverging_colorscale`. Thread-safe via `threading.RLock`
71+
- [x] **3.2 Add context manager** - `plot_context()` using `contextvars.ContextVar` for thread-safe and async-safe temporary overrides with automatic restore
72+
- [x] **3.3 Support config file** - reads `cfd_viz.toml` or `pyproject.toml` `[tool.cfd_viz.defaults]`; `tomli` conditional dependency for Python <3.11
73+
- [x] **3.4 Migrate plotting functions** - `UNSET` sentinel + `resolve()` pattern replaces hardcoded defaults across plotting and animation modules
74+
- [x] **3.5 Add configuration tests** - 36 tests covering defaults, context manager nesting, config file loading, and plotting integration
8675

8776
---
8877

0 commit comments

Comments
 (0)