Skip to content

docs: document DEDX_DEFAULT and DEDX_AUTO programs, and document available materials #145

Description

@grzanka

Context

README.md's "Supported programs" table and its mirror in index.rst (pulled into docs/source/index.rst via .. include::) both list DEDX_PSTAR, DEDX_ASTAR, DEDX_MSTAR, DEDX_ICRU49, DEDX_ICRU73, DEDX_ICRU73_OLD, DEDX_BETHE_EXT00, and DEDX_ICRU — but DEDX_DEFAULT and DEDX_AUTO are missing from both. DEDX_AUTO is new (#144); DEDX_DEFAULT has existed for a while but was apparently never documented at this level (only in the dedx.h Doxygen comments).

Separately, there is no documented list of available materials anywhere — not in README.md, not in index.rst, not in the Doxygen-generated API reference. The only place material identifiers exist is the include/dedx_elements.h enum; a reader has to go spelunking in a header to find out what DEDX_WATER, DEDX_BORON_CARBIDE, etc. even are, or which ones are usable with which program.

What to add

1. DEDX_DEFAULT and DEDX_AUTO rows in the programs table (both README.md and index.rst):

  • DEDX_DEFAULT — currently behaves identically to DEDX_BETHE_EXT00 in find_data() (src/dedx.c); worth explicitly saying whether it's meant as a stable alias/default entry point or is expected to diverge later, since right now a reader has no way to tell why both exist.
  • DEDX_AUTO — auto-selects the best tabulated ICRU report for the ion, like DEDX_ICRU, but falls back to the Bethe-Bloch formula for elements/compounds nothing tabulated covers (comparable to the AUTO mode in dedx_web). Should call out explicitly that this is different from DEDX_ICRU, which never falls back and still fails with DEDX_ERR_COMBINATION_NOT_FOUND for combinations no ICRU sub-report covers — this distinction was a deliberate design decision (see the discussion on Add proper handling of missing ion+material+program combinations #51) and is exactly the kind of thing a reader would otherwise miss.
  • Both should note the caveat already present for DEDX_BETHE_EXT00-style programs (advisory-only energy bounds from dedx_get_min_energy()/dedx_get_max_energy(); the real bounds come from whichever tier actually resolves the request).

2. Document available materials well, likely as a new section/page:

  • A materials table or generated list (elements + compounds), since right now the only source of truth is the include/dedx_elements.h enum.
  • Documentation of the two ways to query availability, and when to use which:
  • Tie this together with the existing README/index.rst note about Bragg/stoichiometric fallback for compounds not natively covered by a program's own database.

Suggested locations

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions