diff --git a/acmc/phen.py b/acmc/phen.py index 479605a34603201b72aa8afba50445f8cead70ca..7822ca1146ef8c12fa34371f86fb1d686e60c834 100644 --- a/acmc/phen.py +++ b/acmc/phen.py @@ -593,12 +593,12 @@ def _process_actions(df: pd.DataFrame, concept_set: dict) -> pd.DataFrame: # Perform Structural Changes to file before preprocessing _logger.debug("Processing file structural actions") if ( - "actions" in concept_set["file"] - and "split_col" in concept_set["file"]["actions"] - and "codes_col" in concept_set["file"]["actions"] + "actions" in concept_set + and "split_col" in concept_set["actions"] + and "codes_col" in concept_set["actions"] ): - split_col = concept_set["file"]["actions"]["split_col"] - codes_col = concept_set["file"]["actions"]["codes_col"] + split_col = concept_set["actions"]["split_col"] + codes_col = concept_set["actions"]["codes_col"] _logger.debug( "Action: Splitting", split_col, @@ -626,12 +626,12 @@ def _preprocess_source_concepts( # Preprocess codes code_types = parse.CodeTypeParser().code_types - for code_type in concept_set["file"]["columns"]: + for code_type in concept_set["columns"]: parser = code_types[code_type] _logger.info(f"Processing {code_type} codes for {code_file_path}") # get codes by column name - source_col_name = concept_set["file"]["columns"][code_type] + source_col_name = concept_set["columns"][code_type] codes = df[source_col_name].dropna() codes = codes.astype(str) # convert to string codes = codes.str.strip() # remove excess spaces