From f2b6bc12a912236a2c603f47d7ea4527f096db02 Mon Sep 17 00:00:00 2001 From: Chris Leaman Date: Mon, 12 Nov 2018 15:40:22 +1100 Subject: [PATCH] Fix paths Scripts should be run from the repository base directory. --- src/data/mat_to_csv.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/data/mat_to_csv.py b/src/data/mat_to_csv.py index 2bbf471..77a375d 100644 --- a/src/data/mat_to_csv.py +++ b/src/data/mat_to_csv.py @@ -8,7 +8,7 @@ from datetime import datetime, timedelta import pandas as pd from mat4py import loadmat -logging.config.fileConfig('../logging.conf', disable_existing_loggers=False) +logging.config.fileConfig('./src/logging.conf', disable_existing_loggers=False) logger = logging.getLogger(__name__) @@ -196,9 +196,9 @@ def replace_unique_sites(df, df_sites, cols=['beach', 'lat', 'lon']): def main(): - df_waves = parse_waves(waves_mat='../../data/raw/waves.mat') - df_tides = parse_tides(tides_mat='../../data/raw/tides.mat') - df_profiles = parse_profiles(profiles_mat='../../data/raw/profiles.mat') + df_waves = parse_waves(waves_mat='./data/raw/processed_shorelines/waves.mat') + df_tides = parse_tides(tides_mat='./data/raw/processed_shorelines/tides.mat') + df_profiles = parse_profiles(profiles_mat='./data/raw/processed_shorelines/profiles.mat') df_sites = get_unique_sites(dfs=[df_waves, df_tides, df_profiles]) df_orientations = parse_orientations(orientations_mat='./data/raw/processed_shorelines/orientations.mat') @@ -217,10 +217,10 @@ def main(): df_sites.set_index(['site_id'], inplace=True) logger.info('Outputting .csv files') - df_profiles.to_csv('../../data/interim/profiles.csv') - df_tides.to_csv('../../data/interim/tides.csv') - df_waves.to_csv('../../data/interim/waves.csv') - df_sites.to_csv('../../data/interim/sites.csv') + df_profiles.to_csv('./data/interim/profiles.csv') + df_tides.to_csv('./data/interim/tides.csv') + df_waves.to_csv('./data/interim/waves.csv') + df_sites.to_csv('./data/interim/sites.csv') logger.info('Done!')