Skip to content

Add output dir#112

Merged
chengcli merged 6 commits intomainfrom
cli/add_output_dir
Feb 15, 2026
Merged

Add output dir#112
chengcli merged 6 commits intomainfrom
cli/add_output_dir

Conversation

@chengcli
Copy link
Owner

No description provided.

Cheng Li and others added 3 commits February 14, 2026 16:24
Copilot AI review requested due to automatic review settings February 15, 2026 16:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for configurable output directories for simulation output files and restart files. The changes introduce a new output_dir option to MeshBlockOptionsImpl with a default value of "." (current directory), and updates all file path construction throughout the output and restart loading code to prepend this directory.

Changes:

  • Added output_dir field to MeshBlockOptionsImpl with default value "."
  • Updated file path construction in all output modules (restart, netcdf) and combine functions
  • Refactored load_restart function to return Variables map instead of taking it as a reference parameter
  • Updated Python bindings to expose the new output_dir option
  • Fixed parameter order in Python type stub for forward method (but introduced syntax error)

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/mesh/meshblock.hpp Added output_dir field to MeshBlockOptionsImpl with default value "."
src/mesh/meshblock.cpp Updated restart initialization to prepend output_dir to restart file paths and refactored to use new load_restart API
src/output/restart.cpp Updated file path construction to include output_dir
src/output/netcdf.cpp Updated file path construction to include output_dir
src/output/combine_restart.cpp Updated file path construction for both input and output files to include output_dir
src/output/combine_netcdf.cpp Updated file path construction for both input and output files to include output_dir
src/input/read_restart_file.hpp Changed load_restart signature to return Variables instead of taking reference parameter
src/input/read_restart_file.cpp Refactored load_restart and helper functions to return Variables map; improved error handling with explicit checks
python/csrc/pymesh.cpp Added Python binding for output_dir option
python/snapy/mesh.pyi Fixed parameter order in forward method signature and corrected documentation (but missing comma causing syntax error)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def forward(
self,
vars: Dict[str, torch.Tensor]
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma after the first parameter in the function signature. The line vars: Dict[str, torch.Tensor] should be followed by a comma before the next parameter dt: float.

Suggested change
vars: Dict[str, torch.Tensor]
vars: Dict[str, torch.Tensor],

Copilot uses AI. Check for mistakes.
@chengcli chengcli merged commit 4796168 into main Feb 15, 2026
3 checks passed
@chengcli chengcli deleted the cli/add_output_dir branch February 15, 2026 19:48
@github-actions
Copy link
Contributor

🎉 Released v1.3.0!

What's Changed

Full Changelog: v1.2.9...v1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant