diff --git a/.github/workflows/continuous-integration-workflow.yaml b/.github/workflows/continuous-integration-workflow.yaml index 69bc7f857..353495433 100644 --- a/.github/workflows/continuous-integration-workflow.yaml +++ b/.github/workflows/continuous-integration-workflow.yaml @@ -9,7 +9,7 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - os: [ubuntu-latest] #, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] fail-fast: False env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/floris/type_dec.py b/floris/type_dec.py index 7798c59e9..3c3746763 100644 --- a/floris/type_dec.py +++ b/floris/type_dec.py @@ -163,22 +163,22 @@ def convert_to_path(fn: str | Path) -> Path: # located (e.g., testing via pytest), and [-1] is where a direct call to the function via an # analysis script will be located (e.g., running an example). base_fn_script = Path(inspect.stack()[-1].filename).resolve().parent - base_fn_sys = Path(inspect.stack()[1].filename).resolve().parent + # base_fn_sys = Path(inspect.stack()[1].filename).resolve().parent if isinstance(fn, Path): absolute_fn = fn.resolve() relative_fn_script = (base_fn_script / fn).resolve() - relative_fn_sys = (base_fn_sys / fn).resolve() + # relative_fn_sys = (base_fn_sys / fn).resolve() if absolute_fn.exists(): return absolute_fn if relative_fn_script.exists(): return relative_fn_script - if relative_fn_sys.exists(): - return relative_fn_sys + # if relative_fn_sys.exists(): + # return relative_fn_sys raise FileExistsError( f"{fn} could not be found as either a\n" f" - relative file path from a script: {relative_fn_script}\n" - f" - relative file path from a system location: {relative_fn_sys}\n" + # f" - relative file path from a system location: {relative_fn_sys}\n" f" - or absolute file path: {absolute_fn}" ) raise TypeError(f"The passed input: {fn} could not be converted to a pathlib.Path object") diff --git a/tests/type_dec_unit_test.py b/tests/type_dec_unit_test.py index 5cc385d9d..52781da5e 100644 --- a/tests/type_dec_unit_test.py +++ b/tests/type_dec_unit_test.py @@ -161,8 +161,8 @@ def test_numeric_dict_converter(): floris_numeric_dict_converter(test_dict) def test_convert_to_path(): - str_input = "../tests" - expected_path = (Path(__file__).parent / str_input).resolve() + str_input = Path(__file__) + expected_path = str_input.resolve() # Test that a string works test_str_input = convert_to_path(str_input)