From a69b40297a9a5a435cea82110236f78878cc1196 Mon Sep 17 00:00:00 2001 From: Jacob Cain Date: Wed, 18 Mar 2026 18:23:51 -0700 Subject: [PATCH 1/3] basic file not found exception --- ale/drivers/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ale/drivers/__init__.py b/ale/drivers/__init__.py index e67196332..543905851 100644 --- a/ale/drivers/__init__.py +++ b/ale/drivers/__init__.py @@ -9,6 +9,7 @@ import json import numpy as np import os +import os.path import traceback from ale.base import WrongInstrumentException, WrongLabelTypeException import logging @@ -128,6 +129,10 @@ def load(label, props={}, formatter='ale', verbose=False, only_isis_spice=False, drivers = chain.from_iterable(driver_list) drivers = sort_drivers([d[1] for d in drivers]) + if not os.path.isfile(label): + raise Exception("File not found.") + + if verbose: logger.info("Attempting to pre-parse label file") try: From d7f9ca494148b0c2417b3199466c9ca4faf8a864 Mon Sep 17 00:00:00 2001 From: Jacob Cain Date: Thu, 19 Mar 2026 14:36:50 -0700 Subject: [PATCH 2/3] Detailed FileNotFound Exception --- ale/drivers/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ale/drivers/__init__.py b/ale/drivers/__init__.py index 543905851..e8b7c0b26 100644 --- a/ale/drivers/__init__.py +++ b/ale/drivers/__init__.py @@ -130,8 +130,10 @@ def load(label, props={}, formatter='ale', verbose=False, only_isis_spice=False, drivers = sort_drivers([d[1] for d in drivers]) if not os.path.isfile(label): - raise Exception("File not found.") - + raise FileNotFoundError('File "' + label + '" not found. \n' + + 'Current Working Directory: "' + os.getcwd() + + '". \nMake sure your cube is present in your working directory, ' + + 'or that you specify the full and correct path to your cube.') if verbose: logger.info("Attempting to pre-parse label file") From 2441d30e4bfff96d2852d40f6ea7205e49429107 Mon Sep 17 00:00:00 2001 From: Jacob Cain Date: Thu, 2 Apr 2026 11:06:47 -0700 Subject: [PATCH 3/3] file dne changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bdb50623..2ba0fb505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ release. ### Changed - Reduced linescan ISD ephemeris sampling from one-per-line to every 10th line for images with 1000+ lines, significantly reducing ISD file sizes and load times for large sensors. Configurable via `reduction` and `ephem_sample_rate` props. [#677](https://github.com/DOI-USGS/ale/pull/677) +- Throw error when input file does not exist. [#692](https://github.com/DOI-USGS/ale/pull/692) ### Fixed - Fixed Eigen 5.x compatibility by removing version constraint in CMakeLists.txt [#677](https://github.com/DOI-USGS/ale/pull/677)