Skip to content

Commit

Permalink
BUG: Use initialization for results of find
Browse files Browse the repository at this point in the history
The specification of the find function changed with
4dda285 but gridproperties import was
not updated for the change. This introduces some subtle inconsistent
behavior.
  • Loading branch information
eivindjahren committed Nov 19, 2021
1 parent cb1be24 commit 9a8f3b1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/xtgeo/grid3d/_gridprops_import_eclrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,9 @@ def import_ecl_init_gridproperties(
grid=grid,
)
for result in results:
prop = GridProperty()
grid_properties._names.append(result["name"])
result["name"] = decorate_name(result["name"], grid.dualporo, fracture=False)
for attr, value in result.items():
setattr(prop, "_" + attr, value)
prop = GridProperty(**result)

grid_properties._props.append(prop)
grid_properties._dates.append(prop._date)
Expand Down Expand Up @@ -248,7 +246,6 @@ def import_ecl_restart_gridproperties(

results = find_gridprops_from_restart_file(pfile.file, names, dates, grid=grid)
for result in results:
prop = GridProperty()

if namestyle == 1:
sdate = str(result["date"])
Expand All @@ -257,9 +254,7 @@ def import_ecl_restart_gridproperties(
result["name"] = decorate_name(
result["name"], grid.dualporo, fracture=False, date=result["date"]
)

for attr, value in result.items():
setattr(prop, "_" + attr, value)
prop = GridProperty(**result)

grid_properties._props.append(prop)
grid_properties._names.append(prop.name)
Expand Down

0 comments on commit 9a8f3b1

Please sign in to comment.