Download scripts/fix_stokes_cd.py from AlanZee/diffvof-simulation-data: direct link, hf CLI and curl.
- Browser
- Download file 637 Bytes
-
https://huggingface.co/datasets/AlanZee/diffvof-simulation-data/resolve/ce593d486a2b73f5e51cb1706091944f79740887/scripts/fix_stokes_cd.py
- Command line
-
hf download hf://datasets/AlanZee/diffvof-simulation-data@ce593d486a2b73f5e51cb1706091944f79740887/scripts/fix_stokes_cd.py
-
curl -L -o fix_stokes_cd.py https://huggingface.co/datasets/AlanZee/diffvof-simulation-data/resolve/ce593d486a2b73f5e51cb1706091944f79740887/scripts/fix_stokes_cd.py
637 Bytes
| #!/usr/bin/env python3 | |
| """用干净模板覆盖所有 stokes_wave case 的 controlDict""" | |
| import os, shutil | |
| raw = '/mnt/f/agent-workspace/paper2/Exp/data/raw/stokes_wave' | |
| template = '/mnt/f/agent-workspace/paper2/Exp/data/scripts/stokes_controlDict_template' | |
| with open(template) as f: | |
| tmpl = f.read() | |
| fixed = 0 | |
| for d in sorted(os.listdir(raw)): | |
| if not d.startswith('t'): | |
| continue | |
| cd = os.path.join(raw, d, 'system', 'controlDict') | |
| if os.path.isdir(os.path.dirname(cd)): | |
| with open(cd, 'w') as f: | |
| f.write(tmpl) | |
| fixed += 1 | |
| print(f'Overwrote {fixed} controlDicts with clean template') | |