Skip to content

Commit

Permalink
Remove unnecessary f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
VasuAgrawal committed Jan 23, 2024
1 parent 9497e0b commit bd0ac70
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nerfstudio/scripts/downloads/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def download_capture_name(save_dir: Path, dataset_name: str, capture_name: str,
file_id_or_zip_url = capture_name_to_file_id[capture_name]
if file_id_or_zip_url.endswith(".zip"):
url = file_id_or_zip_url # zip url
target_path = str(save_dir / f"{dataset_name}" / f"{capture_name}")
target_path = str(save_dir / dataset_name / capture_name)
os.makedirs(target_path, exist_ok=True)
download_path = Path(f"{target_path}.zip")
tmp_path = str(save_dir / f"{dataset_name}" / f".temp_{capture_name}")
tmp_path = str(save_dir / dataset_name / f".temp_{capture_name}")
shutil.rmtree(tmp_path, ignore_errors=True)
os.makedirs(tmp_path, exist_ok=True)
try:
Expand All @@ -157,10 +157,10 @@ def download_capture_name(save_dir: Path, dataset_name: str, capture_name: str,
run_command(f"wget {url} -O {download_path}", verbose=True)
else:
url = f"https://drive.google.com/uc?id={file_id_or_zip_url}" # file id
target_path = str(save_dir / f"{dataset_name}" / f"{capture_name}")
target_path = str(save_dir / dataset_name / capture_name)
os.makedirs(target_path, exist_ok=True)
download_path = Path(f"{target_path}.zip")
tmp_path = str(save_dir / f"{dataset_name}" / f".temp_{capture_name}")
tmp_path = str(save_dir / dataset_name / f".temp_{capture_name}")
shutil.rmtree(tmp_path, ignore_errors=True)
os.makedirs(tmp_path, exist_ok=True)
try:
Expand Down Expand Up @@ -292,7 +292,7 @@ def download(self, save_dir: Path):
self.capture_name in phototourism_downloads
), f"Capture name {self.capture_name} not found in {phototourism_downloads.keys()}"
url = phototourism_downloads[self.capture_name]
target_path = str(save_dir / "phototourism" / f"{self.capture_name}")
target_path = str(save_dir / "phototourism" / self.capture_name)
os.makedirs(target_path, exist_ok=True)
download_path = Path(f"{target_path}.tar.gz")
tmp_path = str(save_dir / "phototourism" / f".temp_{self.capture_name}")
Expand Down Expand Up @@ -424,7 +424,7 @@ def download(self, save_dir: Path):
self.capture_name in nerfosr_downloads
), f"Capture name {self.capture_name} not found in {nerfosr_downloads.keys()}"
url = nerfosr_downloads[self.capture_name]
target_path = str(save_dir / "nerfosr" / f"{self.capture_name}")
target_path = str(save_dir / "nerfosr" / self.capture_name)
os.makedirs(target_path, exist_ok=True)
download_path = Path(f"{target_path}.zip")
tmp_path = str(save_dir / "nerfosr" / f".temp_{self.capture_name}")
Expand Down Expand Up @@ -478,7 +478,7 @@ def download(self, save_dir: Path) -> None:
self.capture_name in mill19_downloads
), f"Capture name {self.capture_name} not found in {mill19_downloads.keys()}"
url = mill19_downloads[self.capture_name]
target_path = save_dir / "mill19" / f"{self.capture_name}"
target_path = save_dir / "mill19" / self.capture_name
target_path.mkdir(parents=True, exist_ok=True)
download_path = Path(f"{target_path}.tgz")
tmp_path = save_dir / "mill19" / f".temp_{self.capture_name}"
Expand Down

0 comments on commit bd0ac70

Please sign in to comment.