Skip to content

Commit

Permalink
FIX: avoid erroneous Deprecation warning cube.from_roxar()
Browse files Browse the repository at this point in the history
cube_from_roxar() inherited an erroneous deprecation warning from_roxar(),
this is improved here (at least the deprecation error is hidden), but the
solution here is a bit quick and dirty and shall shall be improved
(refactoring this in a good manner was not the goal of this PR)
  • Loading branch information
jcrivenaes committed Jan 15, 2024
1 parent 2e6851d commit d1b983a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/xtgeo/cube/cube1.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ def cube_from_roxar(project, name, folder=None):
mycube = xtgeo.cube_from_roxar(project, "DepthCube")
"""
obj = Cube(ncol=9, nrow=9, nlay=9, xinc=9.99, yinc=9.99, zinc=9.99)

obj.from_roxar(project, name, folder=folder)

# this is certainly hackish, and shall be rewritten to a proper class method
# -> replaces currently the from_roxar() method which is deprecated
obj = Cube(ncol=9, nrow=9, nlay=9, xinc=9.99, yinc=9.99, zinc=9.99) # dummy
_cube_roxapi.import_cube_roxapi(obj, project, name, folder=folder)
obj._metadata.required = obj
return obj


Expand Down

0 comments on commit d1b983a

Please sign in to comment.