-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_vif_files.py
More file actions
64 lines (51 loc) · 1.38 KB
/
read_vif_files.py
File metadata and controls
64 lines (51 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 28 16:12:48 2022
This script reads the VIF test results and prints out the scores.
@author: waeiski
"""
import pandas as pd
import geopandas as gpd
import glob
import argparse
# Set up the argument parser
ap = argparse.ArgumentParser()
# Get path to input folder
ap.add_argument("-if", "--inputfolder", required=True,
help="Path to folder containing pickled model files.")
# parse arguments
args = vars(ap.parse_args())
# path to times of day data
path = args['inputfolder']
# list vif files
files = glob.glob(path + '*.pkl')
# empty lists for initial and final files
invif = []
finvif = []
# loop over files
for file in files:
# check if initial or final
if 'initial' in file:
invif.append(file)
elif 'final' in file:
finvif.append(file)
# loop over initial files
for file in invif:
# get time of day
timeofday = file.split('_')[-2]
# read file
df = pd.read_pickle(file)
# print contents
print('[INFO] - Now printing initial VIF scores for ' + str(timeofday))
print(df)
# loop over final files
for file in finvif:
# get time of day
timeofday = file.split('_')[-2]
# read file
df = pd.read_pickle(file)
# print contents
print('[INFO] - Now printing final VIF scores for ' + str(timeofday))
print(df)
print('[INFO] - ... done!')