quick-pp 0.2.64__tar.gz → 0.2.66__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.
Files changed (74) hide show
  1. {quick_pp-0.2.64 → quick_pp-0.2.66}/PKG-INFO +1 -1
  2. {quick_pp-0.2.64 → quick_pp-0.2.66}/pyproject.toml +1 -1
  3. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/__init__.py +1 -1
  4. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/las_handler.py +4 -4
  5. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/objects.py +5 -5
  6. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/plotter/well_log.py +3 -6
  7. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/plotter/well_log_config.py +3 -3
  8. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/saturation.py +3 -3
  9. {quick_pp-0.2.64 → quick_pp-0.2.66}/.gitignore +0 -0
  10. {quick_pp-0.2.64 → quick_pp-0.2.66}/LICENSE +0 -0
  11. {quick_pp-0.2.64 → quick_pp-0.2.66}/README.md +0 -0
  12. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/__init__.py +0 -0
  13. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/exceptions.py +0 -0
  14. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/fastapi_mlflow/__init__.py +0 -0
  15. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/fastapi_mlflow/_mlflow_types.py +0 -0
  16. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/fastapi_mlflow/applications.py +0 -0
  17. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/fastapi_mlflow/exceptions.py +0 -0
  18. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/fastapi_mlflow/predictors.py +0 -0
  19. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/main.py +0 -0
  20. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/mlflow_model_deployment.py +0 -0
  21. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/router.py +0 -0
  22. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/lithology_hc_correction.py +0 -0
  23. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/lithology_ssc.py +0 -0
  24. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/lithology_vsh_gr.py +0 -0
  25. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/permeability_choo.py +0 -0
  26. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/permeability_others.py +0 -0
  27. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/porosity.py +0 -0
  28. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/ressum.py +0 -0
  29. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/saturation_archie.py +0 -0
  30. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/saturation_b.py +0 -0
  31. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/saturation_qv.py +0 -0
  32. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/saturation_rw.py +0 -0
  33. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/saturation_temp_grad.py +0 -0
  34. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/schemas/saturation_waxman_smits.py +0 -0
  35. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/services/chat.py +0 -0
  36. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/services/las_handler.py +0 -0
  37. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/services/lithology.py +0 -0
  38. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/services/permeability.py +0 -0
  39. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/services/porosity.py +0 -0
  40. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/services/reservoir_summary.py +0 -0
  41. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/services/saturation.py +0 -0
  42. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/static/favicon.ico +0 -0
  43. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/static/logo.png +0 -0
  44. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/template/chat.html +0 -0
  45. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/api/template/home.html +0 -0
  46. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/cli.py +0 -0
  47. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/config.py +0 -0
  48. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/core_calibration.py +0 -0
  49. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/fluid_type.py +0 -0
  50. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/lithology/__init__.py +0 -0
  51. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/lithology/carbonate.py +0 -0
  52. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/lithology/multi_mineral.py +0 -0
  53. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/lithology/sand_shale.py +0 -0
  54. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/lithology/sand_silt_clay.py +0 -0
  55. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/lithology/thin_beds.py +0 -0
  56. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/machine_learning/__init__.py +0 -0
  57. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/machine_learning/config.py +0 -0
  58. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/machine_learning/feature_engineering.py +0 -0
  59. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/machine_learning/mock_data/mock_data.parquet +0 -0
  60. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/machine_learning/predict_pipeline.py +0 -0
  61. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/machine_learning/train_pipeline.py +0 -0
  62. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/machine_learning/utils.py +0 -0
  63. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/permeability.py +0 -0
  64. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/plotter/__init__.py +0 -0
  65. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/plotter/plotter.py +0 -0
  66. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/porosity.py +0 -0
  67. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/qaqc.py +0 -0
  68. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/ressum.py +0 -0
  69. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/rock_physics/__init__.py +0 -0
  70. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/rock_physics/geomechanics.py +0 -0
  71. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/rock_physics/geophysics.py +0 -0
  72. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/rock_physics/rpm.py +0 -0
  73. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/rock_type.py +0 -0
  74. {quick_pp-0.2.64 → quick_pp-0.2.66}/quick_pp/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quick-pp
3
- Version: 0.2.64
3
+ Version: 0.2.66
4
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>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "quick-pp"
7
- version = "0.2.64"
7
+ version = "0.2.66"
8
8
  description = "Python package to assist in providing quick-look/ preliminary petrophysical estimation."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -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.64' # Need to be updated manually when releasing a new version/ change in pyproject.toml
23
+ __version__ = '0.2.66' # Need to be updated manually when releasing a new version/ change in pyproject.toml
@@ -9,7 +9,7 @@ import welly
9
9
  from quick_pp import logger
10
10
 
11
11
 
12
- def read_las_files(las_files):
12
+ def read_las_files(las_files, depth_uom=None):
13
13
  """
14
14
  1. Return df and well_header as df from .las files
15
15
  2. For every las files, curves_df, header_df, welly_object are returned through function "read_las_file"
@@ -27,7 +27,7 @@ def read_las_files(las_files):
27
27
 
28
28
  for f in las_files:
29
29
  try:
30
- df, well_header = read_las_file_welly(f)
30
+ df, well_header = read_las_file_welly(f, depth_uom)
31
31
  except Exception as e:
32
32
  logger.error(f"[read_las_files] Exception for {f.name} | {e} ")
33
33
  df, well_header, _ = read_las_file_mmap(f)
@@ -143,10 +143,10 @@ def read_las_file_mmap(file_object, required_sets=['PEP']): # noqa
143
143
  return curves_df, header_df, welly_object
144
144
 
145
145
 
146
- def read_las_file_welly(file_object):
146
+ def read_las_file_welly(file_object, depth_uom=None):
147
147
  welly_dataset = welly.las.from_las(file_object.name)
148
148
  well_header = welly_dataset['Header']
149
- welly_object = welly.well.Well.from_datasets(welly_dataset)
149
+ welly_object = welly.well.Well.from_datasets(welly_dataset, index_units=depth_uom)
150
150
  df = pre_process(welly_object)
151
151
  return df, well_header
152
152
 
@@ -21,12 +21,12 @@ class Project(object):
21
21
  os.makedirs(self.output_path, exist_ok=True)
22
22
  logger.info(f"Project '{name}' initialized with path: {self.data_path}")
23
23
 
24
- def read_las(self, path: list):
24
+ def read_las(self, path: list, depth_uom=None):
25
25
  logger.info(f"Reading {len(path)} LAS files for project '{self.name}'")
26
26
  for file in path:
27
27
  logger.debug(f"Processing LAS file: {file}")
28
28
  well = Well()
29
- well.read_las(file)
29
+ well.read_las(file, depth_uom)
30
30
  self.save_well(well)
31
31
  self.update_history(action=f"Read LAS file for project {self.name}")
32
32
 
@@ -153,14 +153,14 @@ class Well(object):
153
153
  self.description = description
154
154
  logger.debug(f"Well object initialized: {name}")
155
155
 
156
- def read_las(self, path: str):
156
+ def read_las(self, path: str, depth_uom=None):
157
157
  logger.info(f"Reading LAS file: {path}")
158
158
  with open(path, "rb") as f:
159
- data, header = las.read_las_files([f])
159
+ data, header = las.read_las_files([f], depth_uom)
160
160
  header_df = header.T
161
161
  self.name = header_df[header_df['mnemonic'] == 'WELL']['value'].values[0].replace("/", "-")
162
162
  self.description = f"Well {self.name}"
163
- self.depth_uom = header_df[header_df['mnemonic'] == 'STRT']['unit'].values[0]
163
+ self.depth_uom = depth_uom or header_df[header_df['mnemonic'] == 'STRT']['unit'].values[0]
164
164
  self.data = data
165
165
  self.header = header
166
166
  logger.info(f"LAS file loaded: {self.name} with {len(data)} records, depth unit: {self.depth_uom}")
@@ -202,10 +202,7 @@ def plotly_log(well_data, well_name: str = '', depth_uom="", trace_defs: dict =
202
202
  >>> fig = plotly_log(well_data, depth_uom='m')
203
203
  >>> fig.show()
204
204
  """
205
- default_flags = False
206
- if trace_defs == dict():
207
- trace_defs = TRACE_DEFS
208
- default_flags = True
205
+ trace_defs = TRACE_DEFS if trace_defs == dict() else trace_defs
209
206
 
210
207
  xaxis_defs = xaxis_defs or XAXIS_DEFS
211
208
  no_of_track = max([trace['track'] for trace in trace_defs.values()])
@@ -237,7 +234,7 @@ def plotly_log(well_data, well_name: str = '', depth_uom="", trace_defs: dict =
237
234
  fig = add_defined_traces(fig, df, index, no_of_track, trace_defs)
238
235
 
239
236
  # --- ROCK_FLAG_X traces (special style, always on track 7, secondary_y=False) ---
240
- if 'ROCK_FLAG_0' in df.columns and no_of_track >= 7 and default_flags:
237
+ if 'ROCK_FLAG_0' in df.columns and no_of_track >= 7 and 'ROCK_FLAG_0' in trace_defs.keys():
241
238
  rock_flag_columns = [col for col in df.columns if col.startswith('ROCK_FLAG_')]
242
239
  # Remove 'ROCK_FLAG_0' if it already exists as a trace in fig.data
243
240
  if any(trace.name == 'ROCK_FLAG_0' for trace in fig.data):
@@ -254,7 +251,7 @@ def plotly_log(well_data, well_name: str = '', depth_uom="", trace_defs: dict =
254
251
  ), row=1, col=7, secondary_y=False)
255
252
 
256
253
  # --- COAL_FLAG traces (special style, always on tracks 4-8, secondary_y=True) ---
257
- if 'COAL_FLAG' in df.columns and no_of_track >= 8 and default_flags:
254
+ if 'COAL_FLAG' in df.columns and no_of_track >= 8:
258
255
  COAL_FLAG_HOVER = np.where(df['COAL_FLAG'] == 1, 'COAL_FLAG<extra></extra>', '<extra></extra>')
259
256
  df['COAL_FLAG'] = df['COAL_FLAG'].replace({0: 1e-3, 1: 1e9}) # Cater for plotting on log scale
260
257
  for c in [4, 5, 6, 7, 8]:
@@ -327,7 +327,7 @@ XAXIS_DEFS = dict(
327
327
  title={'text': 'GR (API)', 'font': {'color': COLOR_DICT['GR'], 'size': font_size}},
328
328
  tickfont={'color': COLOR_DICT['GR'], 'size': font_size},
329
329
  side='top', anchor='free', position=.85,
330
- title_standoff=.1, dtick=40, range=[0, 200], type='linear', zeroline=False
330
+ title_standoff=.1, dtick=50, range=[0, 200], type='linear', zeroline=False
331
331
  ),
332
332
  RT=dict(
333
333
  title={'text': 'RT (ohm.m)', 'font': {'color': COLOR_DICT['RT'], 'size': font_size}},
@@ -413,13 +413,13 @@ XAXIS_DEFS = dict(
413
413
  title={'text': 'CALI (inches)', 'font': {'color': COLOR_DICT['CALI'], 'size': font_size}},
414
414
  tickfont={'color': COLOR_DICT['CALI'], 'size': font_size},
415
415
  side='top', anchor='free', position=.89, title_standoff=.1, overlaying='x1',
416
- dtick=6, range=[6, 24], type='linear', showgrid=False
416
+ dtick=4, range=[4, 20], type='linear', showgrid=False
417
417
  ),
418
418
  BS=dict(
419
419
  title={'text': 'BS (inches)', 'font': {'color': COLOR_DICT['BS'], 'size': font_size}},
420
420
  tickfont={'color': COLOR_DICT['BS'], 'size': font_size},
421
421
  side='top', anchor='free', position=.92, title_standoff=.1, overlaying='x1',
422
- dtick=6, range=[6, 24], type='linear', showgrid=False
422
+ dtick=4, range=[4, 20], type='linear', showgrid=False
423
423
  ),
424
424
  BADHOLE=dict(
425
425
  title={'text': 'BADHOLE', 'font': {'color': COLOR_DICT['BADHOLE'], 'size': font_size}},
@@ -80,7 +80,7 @@ def waxman_smits_saturation(rt, rw, phit, Qv=None, B=None, m=2, n=2):
80
80
 
81
81
  logger.debug(f"Waxman-Smits saturation range: {min(swt)} - {max(swt)}")
82
82
  # Post process only valid data
83
- invalid_mask = ~((rt > 0) & np.isfinite(rt))
83
+ invalid_mask = ~((rt > 0) & np.isfinite(rt) & (phit > 0) & np.isfinite(phit))
84
84
  swt[invalid_mask] = 1.0
85
85
  return swt
86
86
 
@@ -120,7 +120,7 @@ def normalized_waxman_smits_saturation(rt, rw, phit, vshale, phit_shale, rt_shal
120
120
 
121
121
  logger.debug(f"Normalized Waxman-Smits saturation range: {min(swt)} - {max(swt)}")
122
122
  # Post process only valid data
123
- invalid_mask = ~((rt > 0) & np.isfinite(rt))
123
+ invalid_mask = ~((rt > 0) & np.isfinite(rt) & (phit > 0) & np.isfinite(phit))
124
124
  swt[invalid_mask] = 1.0
125
125
  return swt
126
126
 
@@ -158,7 +158,7 @@ def dual_water_saturation(rt, rw, phit, a, m, n, swb, rwb):
158
158
 
159
159
  logger.debug(f"Dual water saturation range: {swt.min():.3f} - {swt.max():.3f}")
160
160
  # Post process only valid data
161
- invalid_mask = ~((rt > 0) & np.isfinite(rt))
161
+ invalid_mask = ~((rt > 0) & np.isfinite(rt) & (phit > 0) & np.isfinite(phit))
162
162
  swt[invalid_mask] = 1.0
163
163
  return swt
164
164
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes