-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_headers.py
More file actions
21 lines (13 loc) · 883 Bytes
/
update_headers.py
File metadata and controls
21 lines (13 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import re
with open('MODEL_DESCRIPTION.md', 'r', encoding='utf-8') as f:
content = f.read()
# Replace different variations of Default in the header of the tables
# | Variable | Default | Description | -> | Parameter | Baseline Value | Description |
content = re.sub(r'\|\s*Variable\s*\|\s*Default\s*\|\s*Description\s*\|', r'| Parameter | Baseline Value | Description |', content)
# | Variable pattern | Default | Description | -> | Parameter pattern | Baseline Value | Description |
content = re.sub(r'\|\s*Variable pattern\s*\|\s*Default\s*\|', r'| Parameter pattern | Baseline Value |', content)
# | Variable | Default | -> | Parameter | Baseline Value |
content = re.sub(r'\|\s*Variable\s*\|\s*Default\s*\|', r'| Parameter | Baseline Value |', content)
with open('MODEL_DESCRIPTION.md', 'w', encoding='utf-8') as f:
f.write(content)
print("Markdown updated!")