research_helpers.project
This module covers project discovery and wiring. Everything else in the package resolves its settings through here. See Configuration for the TOML keys.
- exception research_helpers.project.ConfigWarning[source]
Bases:
UserWarningA setting was not understood. The value is ignored and the default applies.
- exception research_helpers.project.ProjectRootNotFoundError[source]
Bases:
RuntimeErrorNo ancestor directory carried a project-root marker.
- class research_helpers.project.PaperSettings(main=PosixPath('tex/paper.tex'), tables_dir=PosixPath('tex/tables'), figures_dir=PosixPath('tex/figures'), bbl=PosixPath('tex/out_dir/paper.bbl'), build_dir=PosixPath('build'), text_width_in=6.45, column_width_in=3.04)[source]
Bases:
objectWhere the manuscript and its generated inputs live, relative to the project root.
- class research_helpers.project.FigureSettings(profile='screen', palette='husl', font='DejaVu Sans', dpi=150, print_height_in=3.2)[source]
Bases:
objectFigure styling.
- class research_helpers.project.LogSettings(directory=None, console_level='INFO', file_level='DEBUG', colour='auto')[source]
Bases:
objectWhere logs go and how much of them. Every value stays overridable per call.
- class research_helpers.project.SweepSettings(runs_dir=PosixPath('runs'), contention_factor=None)[source]
Bases:
objectWhere parameter sweeps run, and what to assume about a shared node.
- class research_helpers.project.ArxivSettings(engine='xelatex', texlive=2025, bbl_format='3.3')[source]
Bases:
objectFacts about the submission target. These track the submission cycle, not the package.
- class research_helpers.project.Project(root, paper=PaperSettings(main=PosixPath('tex/paper.tex'), tables_dir=PosixPath('tex/tables'), figures_dir=PosixPath('tex/figures'), bbl=PosixPath('tex/out_dir/paper.bbl'), build_dir=PosixPath('build'), text_width_in=6.45, column_width_in=3.04), figures=FigureSettings(profile='screen', palette='husl', font='DejaVu Sans', dpi=150, print_height_in=3.2), log=LogSettings(directory=None, console_level='INFO', file_level='DEBUG', colour='auto'), sweep=SweepSettings(runs_dir=PosixPath('runs'), contention_factor=None), arxiv=ArxivSettings(engine='xelatex', texlive=2025, bbl_format='3.3'), pyproject=None, sources=<factory>)[source]
Bases:
objectA project’s wiring, with every path resolved to an absolute location.
- Parameters:
root (Path)
paper (PaperSettings)
figures (FigureSettings)
log (LogSettings)
sweep (SweepSettings)
arxiv (ArxivSettings)
pyproject (Path | None)
- classmethod from_pyproject(start=None, **overrides)[source]
Load wiring by walking up from ‘start’ for a project root.
- Parameters:
- Return type:
- Returns:
The project, with every path made absolute against the root.
- Raises:
ProjectRootNotFoundError – if no ancestor carries a marker from ‘ROOT_MARKERS’.
- research_helpers.project.current_project()[source]
Return the enclosing project, or one carrying pure defaults if there is no root above.
- Return type:
- research_helpers.project.resolve(settings, **overrides)[source]
Return ‘settings’ with each override applied, ignoring any that is None.
None means ‘not specified at this layer’, so a caller may forward its own optional arguments straight through without first filtering them.
- research_helpers.project.find_project_root(start=None)[source]
Return the first ancestor of ‘start’ carrying a project-root marker.
- Parameters:
start (
Path|str|None, default:None) – directory to search upward from (defaults to the current working directory).- Return type:
- Returns:
The project root, absolute.
- Raises:
ProjectRootNotFoundError – if no ancestor carries a marker.