AllenInstitute / AllenInstitute/bmtk

Don't delete all contents of output_dir...

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

Nobody has claimed this yet.

Dominant language
Python
Stars
335
Forks
102
Avg merge
1d 5h
Merged PRs (30d)
6

Description

Currently BMTK will delete all files & subfolders in the output_dir as specified of a Sonata file:

 "output":{ 
    "output_dir": "$OUTPUT_DIR",
   ...
  }

including presumably the user's home directory if they specify that...

https://github.com/AllenInstitute/bmtk/blob/develop/bmtk/simulator/core/io_tools.py#L73

It would be better to only delete the files BMTK expects to generate (as is suggested by the spec: "An optional attribute named "overwrite_output_dir" provides a hint to simulators to let them know if already existing output files must be overwritten."), or better still warn the user that that dir contains files BMTK didn't create.

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

Read bmtk/simulator/core/io_tools.py around line 73 and inspect how the Sonata output_dir and overwrite_output_dir settings are handled. Define the expected output files and ensure existing unrelated files are not deleted, or that the user is warned when the directory contains files BMTK did not create.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.