We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
def prepare_aoi_folders(aoi_nm:str=uc_config["aoi_nm"]) -> None: """Prepare the case study folder for the given area of interest.""" aoi_dir = os.path.join("outputs/e2e/", aoi_nm) dirs = [ aoi_dir, os.path.join(aoi_dir, "analyse_network"), os.path.join(aoi_dir, "gtfs"), os.path.join(aoi_dir, "metrics"), os.path.join(aoi_dir, "population"), os.path.join(aoi_dir, "urban_centre"), ] for d in dirs: try: os.mkdir(here(d)) except FileExistsError: pass # %% def prep_new_toml(toml_template:Union[pathlib.Path, str], new_aoi_nm:str) -> None: with open(toml_template, "r") as f: lines = f.read() f.close() # get the aoi_nm from the filenm aoi = os.path.basename(toml_template) aoi = aoi.replace("e2e_", "").split(".")[0].strip() old_aoi_pat = re.compile(aoi) n_hits = len(list(old_aoi_pat.finditer(lines, re.IGNORECASE))) new_lines = lines new_lines = re.sub(old_aoi_pat, new_aoi_nm, new_lines, count=n_hits) parent_dir = os.path.dirname(toml_template) out_pth = here(os.path.join(parent_dir, f"e2e_{new_aoi_nm}.toml")) with open(out_pth, "w") as f: f.write(new_lines) f.close()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: