Skip to content

Commit

Permalink
Fix errors caused by intro of tidy_general_obs_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sol committed Jan 12, 2024
1 parent a72b30e commit 1aece02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/subscript/fmuobs/gen_obs_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def tidy_general_obs_keys(generals):
warnings.warn(
f"Some keys not recognized ({rouges}) as standards, but kept as is"
)
LOGGER.debug("Have tidied, results are %s", generals)
for convertable_key, correct_key in conversions.items():
generals[correct_key] = generals[convertable_key].copy()
del generals[convertable_key]
if correct_key != convertable_key:
del generals[convertable_key]
6 changes: 4 additions & 2 deletions src/subscript/fmuobs/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from subscript.fmuobs.gen_obs_writers import (
dump_content_to_dict,
add_extra_well_data_if_rft,
tidy_general_obs_keys,
)

logger = getLogger(__name__)
Expand Down Expand Up @@ -321,8 +322,9 @@ def general_df2obsdict(general_df: pd.DataFrame, parent_dir: PosixPath) -> List[
logger.debug("All general observations from file:")
logger.debug(gen_obs_dict)
add_extra_well_data_if_rft(gen_obs_dict, parent_dir, gen_obs_files)

return tidy_general_obs_keys(gen_obs_dict)
tidy_general_obs_keys(gen_obs_dict)
logger.debug("Tidied general observations, afterwards they are %s", gen_obs_dict)
return gen_obs_dict


def convert_dframe_date_to_str(dframe: pd.DataFrame) -> pd.DataFrame:
Expand Down

0 comments on commit 1aece02

Please sign in to comment.