stan-dev / stan-dev/cmdstanpy

Path forward on IO operations

Open
#785 34 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code cleanup help wanted method outputs
Dominant language
Python
Stars
198
Forks
81
PR merge metrics
No merged PRs in 30d

Description

This issue serves to document plans that myself, @bob-carpenter, and @mitzimorris have all discussed in person.

Issues:

  • the existing IO code re-uses very little between the different services.
  • the existing IO code is slow.
  • the existing IO code depends on things like the order of comments in the files.

Steps:

  • Split IO code into two passes. One pass should ignore all comments and use a fast reader like numpy's fromtxt to read in the draws. This can be used for all services. The second pass should deal with the comments. This will be service-specific. This change can be done any time
  • Replace the second pass of the above with the newer JSON outputs rather than CSV comments. This requires a minimum supported cmdstan version: #685
  • The first step could later be replaced with some sort of binary output. This would require upstream Stan changes

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 reading the existing IO implementation and issue #685, which is identified as a prerequisite for replacing CSV comments with JSON outputs. The issue describes multiple possible passes and a future binary-output path, but names no files or tests; completion criteria would need to be narrowed before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.