Skip to content

Commit

Permalink
AddingEngineArgument
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJuestel committed Jun 8, 2024
1 parent 32a1050 commit d17bc75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pyborehole/borehole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,7 @@ def add_deviation(self,

def add_well_logs(self,
path: str,
engine: str = 'numpy',
nodata: Union[int, float] = -9999,
depth_scale_factor: Union[int, float] = 1) -> Union[LASLogs, DLISLogs, LISLogs]:
"""Add Well Logs to the Borehole Object.
Expand All @@ -1547,6 +1548,8 @@ def add_well_logs(self,
__________
path : str
Path to the well log file, e.g. ``path='Well_Logs.las'``.
engine : str, default: ``'numpy'``
Engine to read the LAS file, e.g. ``engine='numpy'``.
nodata : Union[int, float], default: ``-9999``
Nodata value to be replaced by `np.NaN`, e.g. ``nodata=-9999``.
depth_scale_factor: Union[int, float], default: ``1``
Expand Down Expand Up @@ -1614,6 +1617,7 @@ def add_well_logs(self,
# Creating well logs from LAS file
self.logs = LASLogs(self,
path=path,
engine=engine,
depth_scale_factor=depth_scale_factor)

# Opening DLIS file if provided
Expand Down
10 changes: 7 additions & 3 deletions pyborehole/logs_las.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ class LASLogs:
def __init__(self,
borehole,
path: str,
engine: str = 'numpy',
depth_scale_factor: Union[int, float] = 1):
"""Class to initiate a Well Log Object.
Expand All @@ -192,8 +193,10 @@ def __init__(self,
Borehole object.
path : str
Path to the well logs, e.g. ``path='logs.las'``.
depth_scale_factor: Union[int, float], default: ``1``
Factor to scale the depth values, e.g. "depth_scale_factor=1".
engine : str, default: ``'numpy'``
Engine to read the LAS file, e.g. ``engine='numpy'``.
depth_scale_factor : Union[int, float], default: ``1``
Factor to scale the depth values, e.g. ``depth_scale_factor=1``.
Attributes
__________
Expand Down Expand Up @@ -346,7 +349,8 @@ def __init__(self,
raise TypeError('The path must be provided as string')

# Opening LAS file
las = lasio.read(path)
las = lasio.read(path,
engine=engine)

# Extracting DataFrame from LAS file
self.df = las.df().sort_index()
Expand Down

0 comments on commit d17bc75

Please sign in to comment.