Those comments are unnecessary. Their only use case is when they're compiled into one single NML file and the reader can use them to determine where each file starts and ends. However GCC can output the start and end in the form of "#" comments and it can do the job better (i.e. readable by NMLC). So here is a PR to remove all of them.
Script used
import glob
import re
# get all files recursively
files = glob.glob('**/*.pnml', recursive=True)
class RemoveHeader:
def __init__(self, path: str):
self.path = path
def remove(self):
with open(self.path, "r", encoding="utf-8-sig") as file:
newfile = []
for line in file:
if re.match(r"//\s*?(begin|end)\s.*$", line.lower()):
line = ""
newfile.append(line)
with open(self.path, "w", encoding="utf-8") as file:
file.writelines(newfile)
for file in files:
rm = RemoveHeader(file)
rm.remove()
Note that This PR might confilct with the previous PR that repaced vehicle ids.
Those comments are unnecessary. Their only use case is when they're compiled into one single NML file and the reader can use them to determine where each file starts and ends. However GCC can output the start and end in the form of "#" comments and it can do the job better (i.e. readable by NMLC). So here is a PR to remove all of them.
Script used
Note that This PR might confilct with the previous PR that repaced vehicle ids.