Overview
Introduce a scoped constants/ layout for package-level shared defaults, while keeping example-only configuration out of the library surface.
Motivation
The codebase already has several meaningful constants (for example canvas DPI limits, export defaults, logging namespace, and plotting heuristics), but they are currently scattered across individual modules. A focused constants layout would improve discoverability and consistency without turning every literal into a global constant.
Proposed scope
Create econ_viz/constants/ for library-level, cross-module constants only.
Suggested modules:
econ_viz/constants/canvas.py
econ_viz/constants/io.py
econ_viz/constants/logging.py
Move or centralize candidates such as:
- canvas DPI bounds / default DPI
- math-text detection characters
- contour-domain lower bound used for utility plots
- smoothing / endpoint-extension defaults
- savefig defaults shared by exporters
- library logging root name
Explicit non-goals
Do not move:
- model dataclass default parameters
- theme definitions / colors from
themes/
- categorical enums from
enums/
- example-specific animation configuration into package constants
Follow-up structure
If example configuration also needs cleanup, handle that separately under something like:
examples/constants/animation.py
Acceptance criteria
Overview
Introduce a scoped
constants/layout for package-level shared defaults, while keeping example-only configuration out of the library surface.Motivation
The codebase already has several meaningful constants (for example canvas DPI limits, export defaults, logging namespace, and plotting heuristics), but they are currently scattered across individual modules. A focused constants layout would improve discoverability and consistency without turning every literal into a global constant.
Proposed scope
Create
econ_viz/constants/for library-level, cross-module constants only.Suggested modules:
econ_viz/constants/canvas.pyecon_viz/constants/io.pyecon_viz/constants/logging.pyMove or centralize candidates such as:
Explicit non-goals
Do not move:
themes/enums/Follow-up structure
If example configuration also needs cleanup, handle that separately under something like:
examples/constants/animation.pyAcceptance criteria
econ_viz/constants/package with high-cohesion modules