From ba92f52b4a6319610eee402cc97ef68ffdbcfe5f Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Wed, 2 Feb 2022 16:17:25 -0600 Subject: [PATCH] Use the file directory to write for test_dload.py closes #11, caused by running script from different folder than `tests/` --- tests/test_dload.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_dload.py b/tests/test_dload.py index 18826ae..540a35f 100644 --- a/tests/test_dload.py +++ b/tests/test_dload.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # Author: Zhang Yunjun, Nov 15, 2021 - +import os import pyaps3 as pa print('------------------------------------------------') @@ -11,7 +11,8 @@ print('NOTE: Account setup is required on the Copernicus Climate Data Store (CDS).') print(' More detailed info can be found on: https://retostauffer.org/code/Download-ERA5/') print(' Add your account info to ~/.cdsapirc file.') -pa.ECMWFdload(['20100601','20100901'], hr='14', filedir='./data/ERA5', model='ERA5', snwe=(30,40,120,140)) +filedir = os.path.join(os.path.dirname(__file__), 'data', 'ERA5') +pa.ECMWFdload(['20100601','20100901'], hr='14', filedir=filedir, model='ERA5', snwe=(30,40,120,140)) print('------------------------------------------------') print('Downloads OK')