Skip to content

Commit

Permalink
Ensure backward compatibility gendata_rft pre 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
alifbe committed Oct 12, 2023
1 parent a9e1894 commit e39f3dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/subscript/merge_rft_ertobs/merge_rft_ertobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@ def merge_rft_ertobs(gendatacsv: str, obsdir: str) -> pd.DataFrame:

# For each simulated well, look up
logger.info("Parsed %s observations from files in %s", str(len(obs_df)), obsdir)

return pd.merge(sim_df, obs_df, how="left", on=["well", "order", "report_step"])
if "report_step" in sim_df.columns:
return pd.merge(sim_df, obs_df, how="left", on=["well", "order", "report_step"])
else:
# Ensure backward compatibility where gendata_rft
return pd.merge(sim_df, obs_df, how="left", on=["well", "order"])


def main() -> None:
Expand Down

0 comments on commit e39f3dc

Please sign in to comment.