Returns directory path specific to this scan. Formatted as '`base_load_dirpath`/`scan.NAME`'. Args: dir_path (str): Directory path where all data is stored. create_dir (`bool`, optional): If `True`, creates directory if it doesn't exist. Returns:
(self, dir_path: str, create_dir: bool = True)
| 210 | return scan_type.load(file_path, num_workers) |
| 211 | |
| 212 | def _save_dir(self, dir_path: str, create_dir: bool = True): |
| 213 | """Returns directory path specific to this scan. |
| 214 | |
| 215 | Formatted as '`base_load_dirpath`/`scan.NAME`'. |
| 216 | |
| 217 | Args: |
| 218 | dir_path (str): Directory path where all data is stored. |
| 219 | create_dir (`bool`, optional): If `True`, creates directory if it doesn't exist. |
| 220 | |
| 221 | Returns: |
| 222 | str: Data directory path for this scan. |
| 223 | """ |
| 224 | scan_type = self.scan_type |
| 225 | folder_id = scan_type.NAME |
| 226 | |
| 227 | name_len = len(folder_id) + 2 # buffer |
| 228 | if scan_type.NAME not in dir_path[-name_len:]: |
| 229 | scan_dirpath = os.path.join(dir_path, folder_id) |
| 230 | else: |
| 231 | scan_dirpath = dir_path |
| 232 | |
| 233 | # scan_dirpath = os.path.join(scan_dirpath, folder_id) |
| 234 | |
| 235 | if create_dir: |
| 236 | os.makedirs(scan_dirpath, exist_ok=True) |
| 237 | |
| 238 | return scan_dirpath |
| 239 | |
| 240 | def save( |
| 241 | self, |