Skip to content

Commit 18a9307

Browse files
committed
Use path_fallback in .gfei
1 parent ecee396 commit 18a9307

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

message_ix_models/tools/gfei.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import plotnine as p9
88

99
from message_ix_models.tools.exo_data import ExoDataSource, register_source
10-
from message_ix_models.util import private_data_path
10+
from message_ix_models.util import path_fallback
1111

1212
if TYPE_CHECKING:
1313
from genno import Computer
@@ -77,10 +77,11 @@ def __init__(self, source, source_kw):
7777
# Set the name of the returned quantity
7878
self.name = "fuel economy"
7979

80-
self.path = private_data_path("transport", "GFEI_FE_by_Powertrain_2017.csv")
81-
if not self.path.exists():
82-
log.error(f"Not found: {self.path}")
83-
raise ValueError(self.path)
80+
self.path = path_fallback(
81+
"transport", "GFEI_FE_by_Powertrain_2017.csv", where="private test"
82+
)
83+
if "test" in self.path.parts:
84+
log.warning(f"Reading random data from {self.path}")
8485

8586
def __call__(self):
8687
import genno.operator

0 commit comments

Comments
 (0)