well-log-toolkit 0.1.122__py3-none-any.whl → 0.1.123__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- well_log_toolkit/well.py +39 -6
- {well_log_toolkit-0.1.122.dist-info → well_log_toolkit-0.1.123.dist-info}/METADATA +1 -1
- {well_log_toolkit-0.1.122.dist-info → well_log_toolkit-0.1.123.dist-info}/RECORD +5 -5
- {well_log_toolkit-0.1.122.dist-info → well_log_toolkit-0.1.123.dist-info}/WHEEL +0 -0
- {well_log_toolkit-0.1.122.dist-info → well_log_toolkit-0.1.123.dist-info}/top_level.txt +0 -0
well_log_toolkit/well.py
CHANGED
|
@@ -338,6 +338,7 @@ class Well:
|
|
|
338
338
|
def load_las(
|
|
339
339
|
self,
|
|
340
340
|
las: Union[LasFile, str, Path, list[Union[str, Path]]],
|
|
341
|
+
path: Optional[Union[str, Path]] = None,
|
|
341
342
|
sampled: bool = False,
|
|
342
343
|
resample_method: Optional[str] = None,
|
|
343
344
|
merge: bool = False,
|
|
@@ -355,7 +356,11 @@ class Well:
|
|
|
355
356
|
Parameters
|
|
356
357
|
----------
|
|
357
358
|
las : Union[LasFile, str, Path, list[Union[str, Path]]]
|
|
358
|
-
Either a LasFile instance, path to LAS file, or list of LAS file paths
|
|
359
|
+
Either a LasFile instance, path to LAS file, or list of LAS file paths.
|
|
360
|
+
When providing a list, filenames can be relative to the path parameter.
|
|
361
|
+
path : Union[str, Path], optional
|
|
362
|
+
Directory path to prepend to all filenames. Useful when loading multiple
|
|
363
|
+
files from the same directory. If None, filenames are used as-is.
|
|
359
364
|
sampled : bool, default False
|
|
360
365
|
If True, mark all properties from this source as 'sampled' type.
|
|
361
366
|
Use this for core plug data or other point measurements where
|
|
@@ -426,14 +431,36 @@ class Well:
|
|
|
426
431
|
>>> # Merge into existing source (legacy behavior)
|
|
427
432
|
>>> well.load_las("CorePor.las") # Load initial properties
|
|
428
433
|
>>> well.load_las("CorePor_Extra.las", merge=True) # Merge new properties
|
|
434
|
+
|
|
435
|
+
>>> # Load multiple files from same directory
|
|
436
|
+
>>> well.load_las(
|
|
437
|
+
... ["file1.las", "file2.las", "file3.las"],
|
|
438
|
+
... path="data/well_logs",
|
|
439
|
+
... combine="match",
|
|
440
|
+
... source_name="AllLogs"
|
|
441
|
+
... )
|
|
442
|
+
>>> # Loads: data/well_logs/file1.las, data/well_logs/file2.las, etc.
|
|
443
|
+
|
|
444
|
+
>>> # Mix of relative and absolute paths
|
|
445
|
+
>>> well.load_las(
|
|
446
|
+
... ["log1.las", "log2.las"],
|
|
447
|
+
... path="/absolute/path/to/logs"
|
|
448
|
+
... )
|
|
429
449
|
"""
|
|
430
450
|
# Handle list of files
|
|
431
451
|
if isinstance(las, list):
|
|
452
|
+
# Prepend path to all filenames if provided
|
|
453
|
+
if path is not None:
|
|
454
|
+
base_path = Path(path)
|
|
455
|
+
las_files = [base_path / las_file for las_file in las]
|
|
456
|
+
else:
|
|
457
|
+
las_files = las
|
|
458
|
+
|
|
432
459
|
# Load all files as separate sources
|
|
433
460
|
loaded_sources = []
|
|
434
|
-
for las_file in
|
|
435
|
-
# Recursively call load_las for each file (without merge or combine)
|
|
436
|
-
self.load_las(las_file, sampled=sampled, resample_method=resample_method, merge=False, combine=None)
|
|
461
|
+
for las_file in las_files:
|
|
462
|
+
# Recursively call load_las for each file (without merge or combine, path already prepended)
|
|
463
|
+
self.load_las(las_file, path=None, sampled=sampled, resample_method=resample_method, merge=False, combine=None)
|
|
437
464
|
# Get the source name that was just created
|
|
438
465
|
loaded_sources.append(self.sources[-1])
|
|
439
466
|
|
|
@@ -465,8 +492,14 @@ class Well:
|
|
|
465
492
|
# Parse if path provided
|
|
466
493
|
filepath = None
|
|
467
494
|
if isinstance(las, (str, Path)):
|
|
468
|
-
|
|
469
|
-
|
|
495
|
+
# Prepend path if provided
|
|
496
|
+
if path is not None:
|
|
497
|
+
las_path = Path(path) / las
|
|
498
|
+
else:
|
|
499
|
+
las_path = Path(las)
|
|
500
|
+
|
|
501
|
+
filepath = las_path
|
|
502
|
+
las = LasFile(las_path)
|
|
470
503
|
elif hasattr(las, 'filepath') and las.filepath:
|
|
471
504
|
filepath = Path(las.filepath)
|
|
472
505
|
|
|
@@ -8,8 +8,8 @@ well_log_toolkit/regression.py,sha256=7D3oI-1XVlFb-mOoHTxTTtUHERFyvQSBAzJzAGVoZn
|
|
|
8
8
|
well_log_toolkit/statistics.py,sha256=_huPMbv2H3o9ezunjEM94mJknX5wPK8V4nDv2lIZZRw,16814
|
|
9
9
|
well_log_toolkit/utils.py,sha256=O2KPq4htIoUlL74V2zKftdqqTjRfezU9M-568zPLme0,6866
|
|
10
10
|
well_log_toolkit/visualization.py,sha256=xb870FG5FghU2gEkqdn1b2NbWNu07oDmFDN1Cx1HIi0,157280
|
|
11
|
-
well_log_toolkit/well.py,sha256=
|
|
12
|
-
well_log_toolkit-0.1.
|
|
13
|
-
well_log_toolkit-0.1.
|
|
14
|
-
well_log_toolkit-0.1.
|
|
15
|
-
well_log_toolkit-0.1.
|
|
11
|
+
well_log_toolkit/well.py,sha256=kIN3Zr0sI3Zt3DeHbxDXADbQfWnVxXCQrHZ4UEMyeqI,103343
|
|
12
|
+
well_log_toolkit-0.1.123.dist-info/METADATA,sha256=gI89Dn-k1W6yy9ODs-5Roj1wiZ2GpMlc7deaBcpq3KA,59810
|
|
13
|
+
well_log_toolkit-0.1.123.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
well_log_toolkit-0.1.123.dist-info/top_level.txt,sha256=BMOo7OKLcZEnjo0wOLMclwzwTbYKYh31I8RGDOGSBdE,17
|
|
15
|
+
well_log_toolkit-0.1.123.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|