Allow selecting output columns with --outvars

Open
#413 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@abhinav-phi is already working on this.

Since Oct 31, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
data

Research direction

Read the code that builds sipnet.out headers and writes their corresponding values, along with the sipnet.in and command-line option parsing. Trace how output formatting and units are currently preserved, then verify default and selected columns, CLI precedence, and invalid-name handling as the issue requests. Done means headers and data match the resolved selection, which is recorded in sipnet.config, and usage is documented.

Written by the indexing model from the issue text.

Description

good first issue

SIPNET currently writes all variables to sipnet.out. Add an --outvars option so users can request only the variables needed for an analysis, reducing output size and unnecessary I/O.

Example:

sipnet -i sipnet.in --outvars gpp,nee,soilWater

Would write year, day, time, gpp, nee, and soilWater.

Acceptance criteria:

  • Accept comma-separated names matching existing output headers.
  • Always include year, day, and time, followed by requested variables in the specified order, without duplicates.
  • Default to all, preserving current output; also accept --outvars all explicitly.
  • Support outvars in sipnet.in, with CLI taking precedence.
  • Reject empty lists and unknown names before simulation, with an error listing valid names.
  • Record the resolved selection in sipnet.config.
  • Keep headers and data columns consistent, preserving existing formatting and units.
  • Document usage and verify defaults, selection, precedence, and invalid inputs.

Implementation suggestion: use a shared output-variable registry for headers and values to prevent them from diverging.

Scope is limited to existing variables in sipnet.out. No changes to model calculations, other output files, or downstream readers. Users requiring the full output schema can retain the default.

Dominant language
C
Stars
42
Forks
38
Avg merge
3d 21h
Merged PRs (30d)
10

Getting set up

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.

More from PecanProject/sipnet

All issues in PecanProject/sipnet

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.