quick-pp 0.2.70__tar.gz → 0.2.72__tar.gz
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.
- {quick_pp-0.2.70 → quick_pp-0.2.72}/PKG-INFO +3 -3
- {quick_pp-0.2.70 → quick_pp-0.2.72}/pyproject.toml +6 -5
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/__init__.py +1 -1
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/core_calibration.py +77 -64
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/lithology/sand_shale.py +4 -3
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/plotter/well_log_config.py +2 -2
- quick_pp-0.2.72/quick_pp/saturation.py +927 -0
- quick_pp-0.2.70/quick_pp/saturation.py +0 -792
- {quick_pp-0.2.70 → quick_pp-0.2.72}/.gitignore +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/LICENSE +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/README.md +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/__init__.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/exceptions.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/fastapi_mlflow/__init__.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/fastapi_mlflow/_mlflow_types.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/fastapi_mlflow/applications.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/fastapi_mlflow/exceptions.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/fastapi_mlflow/predictors.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/main.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/mlflow_model_deployment.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/router.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/lithology_hc_correction.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/lithology_ssc.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/lithology_vsh_gr.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/permeability_choo.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/permeability_others.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/porosity.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/ressum.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/saturation_archie.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/saturation_b.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/saturation_qv.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/saturation_rw.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/saturation_temp_grad.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/schemas/saturation_waxman_smits.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/services/chat.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/services/las_handler.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/services/lithology.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/services/permeability.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/services/porosity.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/services/reservoir_summary.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/services/saturation.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/static/favicon.ico +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/static/logo.png +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/template/chat.html +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/api/template/home.html +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/cli.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/config.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/database/__init__.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/database/db_connector.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/database/models.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/database/objects.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/database/setup_postgresql_db.sql +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/database/setup_sqlite_db.sql +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/fluid_type.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/las_handler.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/lithology/__init__.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/lithology/carbonate.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/lithology/multi_mineral.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/lithology/sand_silt_clay.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/lithology/thin_beds.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/machine_learning/__init__.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/machine_learning/config.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/machine_learning/feature_engineering.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/machine_learning/mock_data/mock_data.parquet +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/machine_learning/predict_pipeline.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/machine_learning/train_pipeline.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/machine_learning/utils.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/permeability.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/plotter/__init__.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/plotter/plotter.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/plotter/well_log.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/porosity.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/qaqc.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/ressum.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/rock_physics/__init__.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/rock_physics/geomechanics.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/rock_physics/geophysics.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/rock_physics/rpm.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/rock_type.py +0 -0
- {quick_pp-0.2.70 → quick_pp-0.2.72}/quick_pp/utils.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quick-pp
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary: Python package to assist in providing quick-look
|
|
3
|
+
Version: 0.2.72
|
|
4
|
+
Summary: Python package to assist in providing quick-look preliminary petrophysical estimation.
|
|
5
5
|
Project-URL: Homepage, https://github.com/imranfadhil/quick_pp
|
|
6
6
|
Author-email: Imran Fadhil <imranfadhil@gmail.com>
|
|
7
7
|
License-Expression: MIT
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Keywords:
|
|
9
|
+
Keywords: geoscience,multi mineral,petrophysics,quick_pp,rock typing,saturation height function,shf,well log,well plot
|
|
10
10
|
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "quick-pp"
|
|
7
|
-
version = "0.2.
|
|
8
|
-
description = "Python package to assist in providing quick-look
|
|
7
|
+
version = "0.2.72"
|
|
8
|
+
description = "Python package to assist in providing quick-look preliminary petrophysical estimation."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
requires-python = ">=3.11"
|
|
@@ -13,12 +13,13 @@ authors = [
|
|
|
13
13
|
{ name = "Imran Fadhil", email = "imranfadhil@gmail.com" },
|
|
14
14
|
]
|
|
15
15
|
keywords = [
|
|
16
|
-
"analysis",
|
|
17
16
|
"geoscience",
|
|
18
|
-
"log",
|
|
19
17
|
"petrophysics",
|
|
18
|
+
"well log", "well plot",
|
|
20
19
|
"quick_pp",
|
|
21
|
-
"
|
|
20
|
+
"multi mineral",
|
|
21
|
+
"rock typing",
|
|
22
|
+
"saturation height function", "shf",
|
|
22
23
|
]
|
|
23
24
|
classifiers = [
|
|
24
25
|
"Development Status :: 2 - Pre-Alpha",
|
|
@@ -20,4 +20,4 @@ logging.getLogger("mlflow").setLevel(logging.WARNING)
|
|
|
20
20
|
|
|
21
21
|
__author__ = """Imran Fadhil"""
|
|
22
22
|
__email__ = 'imranfadhil@gmail.com'
|
|
23
|
-
__version__ = '0.2.
|
|
23
|
+
__version__ = '0.2.72' # Need to be updated manually when releasing a new version/ change in pyproject.toml
|
|
@@ -438,18 +438,20 @@ def autocorrelate_core_depth(df):
|
|
|
438
438
|
and 'DEPTH_SHIFT'.
|
|
439
439
|
"""
|
|
440
440
|
from dtw import dtw
|
|
441
|
+
from sklearn.preprocessing import minmax_scale
|
|
441
442
|
required_cols = ['WELL_NAME', 'DEPTH', 'PHIT', 'CPORE', 'CPERM', 'CORE_ID']
|
|
442
443
|
for col in required_cols:
|
|
443
444
|
if col not in df.columns:
|
|
444
445
|
raise AssertionError(f"Missing required column: {col}")
|
|
445
446
|
|
|
447
|
+
all_wells_data = []
|
|
446
448
|
shift_summaries = []
|
|
447
|
-
|
|
449
|
+
|
|
448
450
|
for well, data in tqdm(df.groupby('WELL_NAME'), desc='Correlating core depths'):
|
|
449
451
|
core_data = data[['DEPTH', 'CORE_ID', 'CPORE', 'CPERM']].dropna().sort_values('DEPTH').reset_index(drop=True)
|
|
450
452
|
|
|
451
453
|
if core_data.empty:
|
|
452
|
-
|
|
454
|
+
all_wells_data.append(data)
|
|
453
455
|
continue
|
|
454
456
|
|
|
455
457
|
log_data = data[['DEPTH', 'PHIT']].dropna().sort_values('DEPTH').reset_index(drop=True)
|
|
@@ -457,74 +459,85 @@ def autocorrelate_core_depth(df):
|
|
|
457
459
|
|
|
458
460
|
# Create a window of log data around core points to speed up DTW
|
|
459
461
|
core_indices_in_log = np.searchsorted(log_data.DEPTH, core_data.DEPTH, side='left')
|
|
460
|
-
window =
|
|
462
|
+
window = 50 # Increased window size to allow for larger shifts
|
|
461
463
|
window_indices = core_indices_in_log[:, None] + np.arange(-window, window + 1)
|
|
462
464
|
window_indices = np.clip(window_indices, 0, len(log_data) - 1)
|
|
463
465
|
unique_indices = np.unique(window_indices.flatten())
|
|
464
466
|
log_data_subset = log_data.iloc[unique_indices].reset_index(drop=True)
|
|
465
467
|
|
|
466
|
-
# Extract
|
|
467
|
-
phit_vals = log_data_subset['PHIT'].values
|
|
468
|
-
cpore_vals = core_data['CPORE'].values
|
|
469
|
-
|
|
470
|
-
alignment = dtw(cpore_vals, phit_vals,
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
#
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
468
|
+
# Extract numpy arrays for DTW
|
|
469
|
+
phit_vals = minmax_scale(log_data_subset['PHIT'].values)
|
|
470
|
+
cpore_vals = minmax_scale(core_data['CPORE'].values)
|
|
471
|
+
|
|
472
|
+
alignment = dtw(cpore_vals, phit_vals, keep_internals=True, step_pattern="symmetric2")
|
|
473
|
+
|
|
474
|
+
# Map alignment indices back to original data
|
|
475
|
+
core_indices = alignment.index1
|
|
476
|
+
log_subset_indices = alignment.index2
|
|
477
|
+
|
|
478
|
+
original_depths = core_data.loc[core_indices, 'DEPTH'].values
|
|
479
|
+
corrected_depths = log_data_subset.loc[log_subset_indices, 'DEPTH'].values
|
|
480
|
+
|
|
481
|
+
# Calculate the shift for each point in the DTW path
|
|
482
|
+
depth_shifts = corrected_depths - original_depths
|
|
483
|
+
|
|
484
|
+
# Determine the single best shift for the entire core sequence (using the median for robustness)
|
|
485
|
+
if len(depth_shifts) > 0:
|
|
486
|
+
best_shift = round(np.median(depth_shifts), 4)
|
|
487
|
+
else:
|
|
488
|
+
best_shift = 0.0
|
|
489
|
+
|
|
490
|
+
tqdm.write(f"Determined best shift for {well}: {best_shift:.2f}")
|
|
491
|
+
|
|
492
|
+
# Apply the consistent shift to all original core data for this well
|
|
493
|
+
shifted_core_data = core_data.copy()
|
|
494
|
+
shifted_core_data['DEPTH_CORRECTED'] = shifted_core_data['DEPTH'] + best_shift
|
|
495
|
+
shifted_core_data['DEPTH_SHIFT'] = best_shift
|
|
496
|
+
|
|
497
|
+
# Create summary for this well
|
|
498
|
+
summary = shifted_core_data[['CORE_ID', 'DEPTH', 'DEPTH_CORRECTED', 'DEPTH_SHIFT']].copy()
|
|
499
|
+
summary.rename(columns={'DEPTH': 'ORIGINAL_DEPTH'}, inplace=True)
|
|
500
|
+
summary['WELL_NAME'] = well
|
|
501
|
+
summary = summary[['WELL_NAME', 'CORE_ID', 'ORIGINAL_DEPTH', 'DEPTH_CORRECTED', 'DEPTH_SHIFT']]
|
|
502
|
+
shift_summaries.append(summary)
|
|
503
|
+
|
|
504
|
+
# Prepare shifted data for merging
|
|
505
|
+
final_shifted = shifted_core_data.rename(columns={
|
|
506
|
+
'CPORE': 'CPORE_SHIFTED',
|
|
507
|
+
'CPERM': 'CPERM_SHIFTED',
|
|
508
|
+
'CORE_ID': 'CORE_ID_SHIFTED'
|
|
487
509
|
})
|
|
488
510
|
|
|
489
|
-
#
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
df_corrected.loc[mask_ori, ['CORE_ID', 'CPORE', 'CPERM']] = df_corrected.loc[
|
|
521
|
-
mask_ori, ['CORE_ID_SHIFTED', 'CPORE_SHIFTED', 'CPERM_SHIFTED']].values
|
|
522
|
-
|
|
523
|
-
return_df = pd.concat([return_df, df_corrected])
|
|
524
|
-
|
|
525
|
-
# After the loop, combine all summaries into a single DataFrame
|
|
526
|
-
final_summary_df = pd.DataFrame()
|
|
527
|
-
if shift_summaries:
|
|
528
|
-
final_summary_df = pd.concat(shift_summaries, ignore_index=True)
|
|
511
|
+
# --- SOLUTION: Use index-based merging to avoid column conflicts ---
|
|
512
|
+
|
|
513
|
+
# Prepare the log data: keep only necessary columns and set DEPTH as index
|
|
514
|
+
log_df_to_merge = data.set_index('DEPTH')
|
|
515
|
+
|
|
516
|
+
# Prepare the shifted core data: keep shifted values and set corrected depth as index
|
|
517
|
+
core_df_to_merge = final_shifted[['DEPTH_CORRECTED', 'CPORE_SHIFTED', 'CPERM_SHIFTED', 'CORE_ID_SHIFTED']] \
|
|
518
|
+
.set_index('DEPTH_CORRECTED')
|
|
519
|
+
|
|
520
|
+
# Merge the two dataframes on their indices (which are the depths)
|
|
521
|
+
well_corrected_df = pd.merge(
|
|
522
|
+
log_df_to_merge,
|
|
523
|
+
core_df_to_merge,
|
|
524
|
+
left_index=True,
|
|
525
|
+
right_index=True,
|
|
526
|
+
how='outer'
|
|
527
|
+
).reset_index()
|
|
528
|
+
|
|
529
|
+
# The merged 'index' column is the unified depth column, so rename it
|
|
530
|
+
well_corrected_df.rename(columns={'index': 'DEPTH'}, inplace=True)
|
|
531
|
+
|
|
532
|
+
# Sort by the final unified depth
|
|
533
|
+
well_corrected_df.sort_values('DEPTH', inplace=True)
|
|
534
|
+
|
|
535
|
+
# Add well name back if lost during merge
|
|
536
|
+
well_corrected_df['WELL_NAME'] = well
|
|
537
|
+
all_wells_data.append(well_corrected_df)
|
|
538
|
+
|
|
539
|
+
# Combine all processed well data and summaries
|
|
540
|
+
return_df = pd.concat(all_wells_data, ignore_index=True)
|
|
541
|
+
final_summary_df = pd.concat(shift_summaries, ignore_index=True) if shift_summaries else pd.DataFrame()
|
|
529
542
|
|
|
530
543
|
return return_df, final_summary_df
|
|
@@ -96,9 +96,10 @@ class SandShale:
|
|
|
96
96
|
for i, point in enumerate(E):
|
|
97
97
|
var_pt = line_intersection((A, C), (D, point))
|
|
98
98
|
projlithofrac = length_a_b(var_pt, A)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
sand_frac = projlithofrac / rocklithofrac
|
|
100
|
+
sand_frac = 0 if var_pt[0] > C[0] else sand_frac
|
|
101
|
+
vsand = np.append(vsand, sand_frac)
|
|
102
|
+
vcld = np.append(vcld, 1 - sand_frac)
|
|
102
103
|
|
|
103
104
|
logger.debug(f"Lithology fraction calculation completed for {len(vsand)} points")
|
|
104
105
|
return vsand, vcld
|