Skip to content

Commit

Permalink
Use path_fallback in .gfei
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Apr 5, 2024
1 parent ecee396 commit 18a9307
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions message_ix_models/tools/gfei.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import plotnine as p9

from message_ix_models.tools.exo_data import ExoDataSource, register_source
from message_ix_models.util import private_data_path
from message_ix_models.util import path_fallback

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

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

def __call__(self):
import genno.operator
Expand Down

0 comments on commit 18a9307

Please sign in to comment.