Skip to content

Commit

Permalink
move filter.yaml to main folder
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed Aug 24, 2021
1 parent d343f35 commit 19fb8e8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chemicalmatcher/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
output_dir = MODULEPATH + 'output/'
data_dir = MODULEPATH + 'data/'

SRSconfig = config(MODULEPATH + 'config.yaml')['databases']['SRS']
SRSconfig = config(config_path = MODULEPATH)['databases']['SRS']
base = SRSconfig['url']

#Certain characters return errors or missing results but if replaces
Expand Down
2 changes: 1 addition & 1 deletion facilitymatcher/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
ext_folder = 'FRS Data Files'
FRSpath = paths.local_path + '/' + ext_folder

FRS_config = config(MODULEPATH + 'config.yaml')['databases']['FRS']
FRS_config = config(config_path = MODULEPATH)['databases']['FRS']

inventory_to_FRS_pgm_acronymn = FRS_config['program_dictionary']
stewi_inventories = list(inventory_to_FRS_pgm_acronymn.keys())
Expand Down
2 changes: 1 addition & 1 deletion stewi/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pandas as pd
from stewi.globals import data_dir, import_table, config, read_inventory

filter_config = config(data_dir + 'filter.yaml')
filter_config = config(file = 'filter.yaml')

def apply_filter_to_inventory(inventory, inventory_acronym, year, filter_list):
# Apply filters if present
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions stewi/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ def set_stewi_meta(file_name, inventory_format = ''):
return stewi_meta


def config(config_path=MODULEPATH + 'config.yaml'):
def config(config_path=MODULEPATH, file='config.yaml'):
"""Read and return stewi configuration file"""
configfile = None
with open(config_path, mode='r') as f:
path = config_path + file
with open(path, mode='r') as f:
configfile = yaml.load(f,Loader=yaml.FullLoader)
return configfile

Expand Down

0 comments on commit 19fb8e8

Please sign in to comment.