Skip to content

Commit

Permalink
Merge branch 'datetime-problem' of github.com:frode-aarstad/ert into …
Browse files Browse the repository at this point in the history
…datetime-problem
  • Loading branch information
frode-aarstad committed Nov 27, 2023
2 parents 1075143 + bf4a3f7 commit fb0eeab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/ert/libres_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ def load_all_summary_data(
summary_keys = ensemble.get_summary_keyset()

try:
df = ensemble.load_responses("summary", tuple(realizations)).to_dataframe()
df = ensemble.load_responses("summary", tuple(realizations)).to_dataframe(
["time", "name", "realization"]
)
except (ValueError, KeyError):
return pd.DataFrame()
df = df.unstack(level="name")
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/test_load_forward_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def test_datetime_2500():
"""
Test that we are able to work with dates past year 2263 in summary files.
Ref: https://github.com/pydata/xarray/issues/7493
"""
cwd = os.getcwd()

Expand All @@ -129,8 +131,6 @@ def test_datetime_2500():
realisation_number = 0
storage = open_storage(facade.enspath, mode="w")
ensemble = storage.get_ensemble_by_name("default_0")

# Create a result that is incompatible with the refcase
run_path = Path("storage") / "snake_oil" / "runpath" / "realization-0" / "iter-0"
os.chdir(run_path)
ecl_sum = run_simulator(100, datetime(2500, 1, 1))
Expand Down

0 comments on commit fb0eeab

Please sign in to comment.