Skip to content

Contains python script to create directories for reproducible projects

License

Notifications You must be signed in to change notification settings

fabrizioleone/build-directory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Build Directory

Build Status

build_directory is a Python script that helps you to keep your code tidy and reproducible. It is strongly recommended to pair it with a version control system (e.g. GitHub).

Usage

Download this repo on your computer and save the file build_directory.py in your favourite directory. Create a new Python script, call it for example "trial.py", and type the following:

n      = 3                                 # Number of taks you want to initialize
draft  = True                              # Set to False if you don't want a folder for your draft
slides = True                              # Set to False if you don't want a folder for your slides 
d      = build_directory('YOURDIRECTORY')  # 'YOURDIRECTORY' is where your project will be created
d.create_dir(n,draft,slides)               # Create a project with n tasks

Run trial.py to in your favourite Python compiler (e.g. VS code, PyCharm, Jupyter,...). It will create a folder called "Project" located at 'YOURDIRECTORY'. The folder has the following structure

.
├── draft
├── execute
│   └── execute_all.py
├── slides
└── tasks
    ├── task1
    │   ├── code
    │   │   └── Main.py
    │   ├── input
    │   └── output
    ├── task2
    │   ├── code
    │   │   └── Main.py
    │   ├── input
    │   └── output
    └── task3
        ├── code
        │   └── Main.py
        ├── input
        └── output

The code is divided into tasks (here, three tasks). Each task is made of input, code and output. The output of each task is the input of the following one. I have mutuated this structure from Dingel's Project Template. The script above automatically initializes an executable file called "Main.py" under the code folder of each task. The file "./execute/execute_all.py" runs the "Main.py" files of each task sequentially. Launch it to run your code altogether and reproduce the final result.

NOTE: if you increase the number of tasks after running the script above, you also need to update "execute_all.py" accordingly.

Development

Want to contribute? Great! I maintain build_directory on GitHub at this repo. Pull requests are more than welcome.

Todos

  • Test it on Windows OS

About

Contains python script to create directories for reproducible projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages