-
Notifications
You must be signed in to change notification settings - Fork 0
How to archive a model run
Suzanne Childress edited this page May 29, 2025
·
8 revisions
This script (archive.py) compresses selected output folders from a model run directory and archives them into a .7z file.
- Anaconda installed
- A Conda environment with the required packages:
conda create -n tm2py-utils python=3.10 py7zr tqdm conda activate tm2py-utils
-
7-Zip CLI (
7z.exeor7z) placed in the repositoryβsbin/folder.
Assuming you cloned your repo into C:\GitHub\tm2py-utils (or ~/GitHub/tm2py-utils):
tm2py-utils/
βββ bin/
β βββ 7z.exe
βββ tm2py_utils/
β βββ scripts/
β βββ archive.py
βββ README.md
-
7z executable:
bin/7z.exe -
Archive script:
tm2py_utils/scripts/archive.py
From a terminal in the repo root (C:\GitHub\tm2py-utils):
1. start python
python
2. read in the necessary function
from tm2py_utils.scripts.archive import archive
3. run the archive function
archive(r'C:\path\to\model\run\directory', r'C:\path\to\archive\run\directory', 'runlabel')- Default excludes:
emme_project/*/emmemat - Chunks files in groups of 100 (change
CHUNK_SIZEin code) - Uses the 7z CLI for speed over the Python
py7zrlibrary