Skip to content

Commit

Permalink
DOC: remove deprecated patterns in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrivenaes committed Oct 26, 2023
1 parent 60cdca4 commit 9c8822d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 32 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
![XTGeo](https://github.com/equinor/xtgeo/blob/main/docs/images/xtgeo-logo-wide.png)
![builds](https://github.com/equinor/xtgeo/workflows/builds/badge.svg)
![linting](https://github.com/equinor/xtgeo/workflows/linting/badge.svg)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c209aeed6a2a40b08ea859aeadf31cb0)](https://www.codacy.com/app/jcrivenaes/xtgeo?utm_source=github.com&utm_medium=referral&utm_content=equinor/xtgeo&utm_campaign=Badge_Grade)
[![codecov](https://codecov.io/gh/equinor/xtgeo/branch/main/graph/badge.svg)](https://codecov.io/gh/equinor/xtgeo)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![PyPI version](https://badge.fury.io/py/xtgeo.svg)](https://badge.fury.io/py/xtgeo)
Expand Down Expand Up @@ -49,12 +48,12 @@ the documentation.
## Getting started

```python
from xtgeo.surface import RegularSurface
import xtgeo

# create an instance of a surface, read from file
mysurf = RegularSurface("myfile.gri") # Irap binary as default
mysurf = xtgeo.surface_from_file("myfile.gri") # Irap binary as default

print("Mean is {}".format(mysurf.values.mean()))
print(f"Mean is {mysurf.values.mean()}")

# change date so all values less than 2000 becomes 2000
# The values attribute gives the Numpy array
Expand Down
4 changes: 2 additions & 2 deletions docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ XTGeo main environment is as stand-alone Python script or notebook, but can
Feature summary
---------------

- Python 3.7+ (Linux, Windows and MacOS).
- Python 3.8+ (Linux, Windows and MacOS).
- Focus on high speed, using `numpy`_ and `pandas`_ with C backend
- Regular surfaces, i.e. 2D maps with regular sampling and rotation
- 3D grids (corner-point), supporting several formats such as RMS and
Expand Down Expand Up @@ -47,7 +47,7 @@ Getting started
import xtgeo
# create an instance of a surface, read from file
mysurf = xtgeo.RegularSurface("myfile.gri") # Irap binary as default
mysurf = xtgeo.surface_from_file("myfile.gri") # Irap binary as default
print(f"Mean is {mysurf.values.mean()}")
Expand Down
6 changes: 3 additions & 3 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ and 30 from back. The applied order of these routines matters...
import xtgeo
big = xtgeo.cube_from_file('troll.segy') # alt. for xtgeo.cube.Cube('troll.segy')
big = xtgeo.cube_from_file("troll.segy")
big.do_thinning(2, 2, 1) # keep every second inline and xline
big.do_cropping((20, 30), (250, 20), (0, 0)) # crop ilines and xlines
# export a much smaller file to SEGY
big.to_file('much_smaller.segy')
big.to_file("much_smaller.segy")
Reduce or change cube (e.g. SEGY) data by resampling
Expand All @@ -141,7 +141,7 @@ Also, another small cube with another rotation is made:
import xtgeo
big = xtgeo.Cube('troll.segy')
big = xtgeo.cube_from_file("troll.segy")
# make a cube of every second iline and xline
newcube = xtgeo.Cube(xori=big.xori, yori=big.yori, zori=big.zori,
Expand Down
20 changes: 10 additions & 10 deletions src/xtgeo/grid3d/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2272,9 +2272,9 @@ def reverse_row_axis(self, ijk_handedness=None):
Example::
grd = xtgeo.Grid("somefile.roff")
prop1 = xtgeo.GridProperty("somepropfile1.roff")
prop2 = xtgeo.GridProperty("somepropfile2.roff")
grd = xtgeo.grid_from_file("somefile.roff")
prop1 = xtgeo.gridproperty_from_file("somepropfile1.roff")
prop2 = xtgeo.gridproperty_from_file("somepropfile2.roff")
grd.props = [prop1, prop2]
Expand Down Expand Up @@ -2469,13 +2469,13 @@ def report_zone_mismatch(
Example::
g1 = xtgeo.Grid("gullfaks2.roff")
g1 = xtgeo.grid_from_file("gullfaks2.roff")
z = xtgeo.GridProperty(gullfaks2_zone.roff", name="Zone")
z = xtgeo.gridproperty_from_file(gullfaks2_zone.roff", name="Zone")
w2 = xtgeo.Well("34_10-1.w", zonelogname="Zonelog")
w2 = xtgeo.well_from_file("34_10-1.w", zonelogname="Zonelog")
w3 = xtgeo.Well("34_10-B-21_B.w", zonelogname="Zonelog"))
w3 = xtgeo.well_from_file("34_10-B-21_B.w", zonelogname="Zonelog"))
wells = [w2, w3]
Expand Down Expand Up @@ -2561,9 +2561,9 @@ def get_randomline(
Example::
mygrid = xtgeo.Grid("somegrid.roff")
poro = xtgeo.GridProperty("someporo.roff")
mywell = xtgeo.Well("somewell.rmswell")
mygrid = xtgeo.grid_from_file("somegrid.roff")
poro = xtgeo.gridproperty_from_file("someporo.roff")
mywell = xtgeo.well_from_file("somewell.rmswell")
fence = mywell.get_fence_polyline(sampling=5, tvdmin=1750, asnumpy=True)
(hmin, hmax, vmin, vmax, arr) = mygrid.get_randomline(
fence, poro, zmin=1750, zmax=1850, zincrement=0.5,
Expand Down
4 changes: 2 additions & 2 deletions src/xtgeo/surface/regular_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2838,9 +2838,9 @@ def get_randomline(
Example::
fence = xtgeo.Polygons("somefile.pol")
fence = xtgeo.polygons_from_file("somefile.pol")
fspec = fence.get_fence(distance=20, nextend=5, asnumpy=True)
surf = xtgeo.RegularSurface("somefile.gri")
surf = xtgeo.surface_from_file("somefile.gri")
arr = surf.get_randomline(fspec)
Expand Down
2 changes: 1 addition & 1 deletion src/xtgeo/well/well1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ def create_surf_distance_log(
Example::
mywell.rescale() # optional
thesurf = xtgeo.RegularSurface("some.gri")
thesurf = xtgeo.surface_from_file("some.gri")
mywell.create_surf_distance_log(thesurf, name="sdiff")
"""
Expand Down
16 changes: 6 additions & 10 deletions src/xtgeo/xyz/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def points_from_wells(
Example::
wells = [xtgeo.Well("w1.w"), xtgeo.Well("w2.w")]
wells = [xtgeo.well_from_file("w1.w"), xtgeo.well_from_file("w2.w")]
points = xtgeo.points_from_wells(wells)
Note:
Expand Down Expand Up @@ -338,7 +338,7 @@ def points_from_wells_dfrac(
Example::
wells = [xtgeo.Well("w1.w"), xtgeo.Well("w2.w")]
wells = [xtgeo.well_from_file("w1.w"), xtgeo.well_from_file("w2.w")]
points = xtgeo.points_from_wells_dfrac(
wells, dlogname="Facies", dcodes=[4], zonelogname="ZONELOG"
)
Expand Down Expand Up @@ -702,7 +702,7 @@ def from_dataframe(self, dfr, east="X", north="Y", tvdmsl="Z", attributes=None):

if attributes:
for target, source in attributes.items():
input[target] = dfr[source]
input_[target] = dfr[source]

df = pd.DataFrame(input)
df.dropna(inplace=True)
Expand Down Expand Up @@ -951,14 +951,10 @@ def from_surface(self, surf, zname="Z_TVDSS"):
Example::
topx = RegularSurface('topx.gri')
topx_aspoints = Points()
topx_aspoints.from_surface(topx)
topx = xtgeo.surface_from_file("topx.gri")
topx_aspoints = xtgeo.points_from_surface(topx)
# alternative shortform:
topx_aspoints = Points(topx) # get an instance directly
topx_aspoints.to_file('mypoints.poi') # export as XYZ file
topx_aspoints.to_file("mypoints.poi") # export as XYZ file
.. deprecated:: 2.16 Use xtgeo.points_from_surface() instead.
"""
Expand Down

0 comments on commit 9c8822d

Please sign in to comment.