@@ -327,6 +327,7 @@ def discover_tiles(directory: Path) -> List[Tile]:
327327 embeddings_dir = directory / EMBEDDINGS_DIR_NAME
328328 if embeddings_dir .exists () and embeddings_dir .is_dir ():
329329 # Check if there are any .npy files (not just _scales.npy)
330+ # The actual pattern validation happens in discover_npy_tiles()
330331 npy_files = [
331332 f
332333 for f in embeddings_dir .rglob ("*.npy" )
@@ -374,6 +375,10 @@ def discover_npy_tiles(base_dir: Path) -> List[Tile]:
374375 tiles .append (tile )
375376 else :
376377 logging .warning (f"Skipping incomplete tile: { npy_file } " )
378+ except ValueError :
379+ # Skip files that don't match expected filename pattern
380+ # ValueError is raised by _parse_npy_filename when pattern doesn't match
381+ continue
377382 except Exception as e :
378383 logging .warning (f"Failed to load tile { npy_file } : { e } " )
379384
@@ -402,6 +407,10 @@ def discover_geotiff_tiles(directory: Path) -> List[Tile]:
402407 try :
403408 tile = Tile .from_geotiff (geotiff_file )
404409 tiles .append (tile )
410+ except ValueError :
411+ # Skip files that don't match expected filename pattern
412+ # ValueError is raised by _parse_geotiff_filename when pattern doesn't match
413+ continue
405414 except Exception as e :
406415 logging .warning (f"Failed to load tile { geotiff_file } : { e } " )
407416
@@ -427,6 +436,10 @@ def discover_zarr_tiles(directory: Path) -> List[Tile]:
427436 try :
428437 tile = Tile .from_zarr (zarr_file )
429438 tiles .append (tile )
439+ except ValueError :
440+ # Skip files that don't match expected filename pattern
441+ # ValueError is raised by _parse_zarr_filename when pattern doesn't match
442+ continue
430443 except Exception as e :
431444 logging .warning (f"Failed to load tile { zarr_file } : { e } " )
432445
0 commit comments