stan-dev / stan-dev/cmdstanpy

function `format_stan_file` missing docs, example on how to deal with #includes

Open
#853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Python
Stars
198
Forks
81
PR merge metrics
No merged PRs in 30d

Description

For Stan programs with include directives, format_stan_file requires the following:

STAN_INCLUDE_PATHS = [Path("stan").resolve()]
format_stan_file(m1_stan_file,  stanc_options={"include-paths" : STAN_INCLUDE_PATHS})

Document this?

Currently, because of issue https://github.com/stan-dev/stanc3/issues/1621, if a stan program file has multiple includes, format_stan_file also requires option: canonicalize=includes - which is technically a stanc option, and therefore one would expect it to be part of the stanc_options dict - this doesn't seem to work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the documentation or entry point for format_stan_file and review how its stanc_options argument handles include paths and canonicalize=includes. Document the STAN_INCLUDE_PATHS example and clarify the current behavior or limitation for files with multiple includes, including the linked stanc3 issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.