diff --git a/floris/wind_data.py b/floris/wind_data.py index 2579fd3e0..35aaa1bad 100644 --- a/floris/wind_data.py +++ b/floris/wind_data.py @@ -1,6 +1,8 @@ from __future__ import annotations +import inspect from abc import abstractmethod +from pathlib import Path import matplotlib.cm as cm import matplotlib.pyplot as plt @@ -680,7 +682,13 @@ def read_csv_long(file_path: str, """ # Read in the CSV file - df = pd.read_csv(file_path, sep=sep) + try: + df = pd.read_csv(file_path, sep=sep) + except FileNotFoundError: + # If the file cannot be found, then attempt the level above + base_fn = Path(inspect.stack()[-1].filename).resolve().parent + file_path = base_fn / file_path + df = pd.read_csv(file_path, sep=sep) # Check that ti_col_or_value is a string or a float if not isinstance(ti_col_or_value, (str, float)):