deepmodeling / deepmodeling/reacnetgenerator

Add explicit output directory and artifact mapping to CLI and Python API

Closed
#2,490 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
103
Forks
46
Avg merge
7d 8h
Merged PRs (30d)
27

Description

## Request

Please add a first-class 'output_dir' option to the CLI and Python API.

A caller should be able to provide an input trajectory and receive all
generated artifacts below an explicit directory without changing the input
basename or the process working directory.

Suggested CLI shape:

reacnetgenerator -i trajectory.lammpstrj --type dump \
--output-dir artifacts --items species,reactions,network,report

Suggested Python API shape:

from reacnetgenerator import run

artifacts = run(
input_path="trajectory.lammpstrj",
output_dir="artifacts",
input_type="dump",
atomname=["C", "H", "O"],
items=("species", "reactions", "network", "report"),
)

The API should expose a semantic artifact mapping such as
{"species": "artifacts/species", "reactions": "artifacts/reaction"}.

## Motivation

The current basename-derived behavior makes two analysis resolutions of the
same trajectory collide and forces wrappers to create symlinks or rename
inputs. This is fragile when species and reaction artifacts are generated by
separate jobs.

When output_dir is supplied, it should take precedence over basename-derived
default paths and should create the directory if needed. Explicit filename
arguments may remain authoritative for compatibility.

## Compatibility and tests

Existing invocations without output_dir should retain their current output
naming and location. Please cover:

1. Two inputs with the same basename in different directories can run into
separate output directories without collision.
2. output_dir is honored for species, route, monomer, reaction, network,
report, and optional reaction-event artifacts.
3. The Python API returns artifact mapping and parameter provenance.
4. A failing or interrupted run does not claim success.
5. The existing no-output-dir invocation remains backward compatible.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the CLI entry point and the reacnetgenerator.run Python API, then trace the existing basename-derived output handling and artifact generation. Add output_dir precedence and artifact mapping while preserving explicit filenames and legacy behavior; verify separate same-basename inputs, all listed artifact types, provenance, failure handling, and the no-output-dir case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.