well-log-toolkit 0.1.115__py3-none-any.whl → 0.1.116__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/manager.py +4 -3
- well_log_toolkit/visualization.py +65 -47
- {well_log_toolkit-0.1.115.dist-info → well_log_toolkit-0.1.116.dist-info}/METADATA +1 -1
- {well_log_toolkit-0.1.115.dist-info → well_log_toolkit-0.1.116.dist-info}/RECORD +6 -6
- {well_log_toolkit-0.1.115.dist-info → well_log_toolkit-0.1.116.dist-info}/WHEEL +0 -0
- {well_log_toolkit-0.1.115.dist-info → well_log_toolkit-0.1.116.dist-info}/top_level.txt +0 -0
well_log_toolkit/manager.py
CHANGED
|
@@ -2539,9 +2539,10 @@ class WellDataManager:
|
|
|
2539
2539
|
dict with keys: type, line_color, line_width, line_style, line_alpha, x_range.
|
|
2540
2540
|
Default: None
|
|
2541
2541
|
regression_by_color : str or dict, optional
|
|
2542
|
-
Regression type to apply separately for each color group. Creates
|
|
2543
|
-
regression lines
|
|
2544
|
-
|
|
2542
|
+
Regression type to apply separately for each color group in the plot. Creates
|
|
2543
|
+
separate regression lines based on what determines colors in the visualization:
|
|
2544
|
+
explicit color mapping if specified, otherwise shape groups (e.g., wells when
|
|
2545
|
+
shape='well'). Accepts string or dict format. Default: None
|
|
2545
2546
|
regression_by_group : str or dict, optional
|
|
2546
2547
|
Regression type to apply separately for each well. Creates separate
|
|
2547
2548
|
regression lines for each well. Accepts string or dict format.
|
|
@@ -2827,9 +2827,10 @@ class Crossplot:
|
|
|
2827
2827
|
dict with keys: type, line_color, line_width, line_style, line_alpha, x_range.
|
|
2828
2828
|
Default: None
|
|
2829
2829
|
regression_by_color : str or dict, optional
|
|
2830
|
-
Regression type to apply separately for each color group. Creates
|
|
2831
|
-
regression lines
|
|
2832
|
-
|
|
2830
|
+
Regression type to apply separately for each color group in the plot. Creates
|
|
2831
|
+
separate regression lines based on what determines colors in the visualization:
|
|
2832
|
+
explicit color mapping if specified, otherwise shape groups (e.g., wells when
|
|
2833
|
+
shape='well'). Accepts string or dict format. Default: None
|
|
2833
2834
|
regression_by_group : str or dict, optional
|
|
2834
2835
|
Regression type to apply separately for each group (well or shape). Creates
|
|
2835
2836
|
separate regression lines for each well or shape category. Accepts string or dict.
|
|
@@ -3162,53 +3163,70 @@ class Crossplot:
|
|
|
3162
3163
|
config = self._parse_regression_config(self.regression_by_color)
|
|
3163
3164
|
reg_type = config['type']
|
|
3164
3165
|
|
|
3165
|
-
|
|
3166
|
-
|
|
3166
|
+
# Determine grouping column based on what's being used for colors in the plot
|
|
3167
|
+
group_column = None
|
|
3168
|
+
group_label = None
|
|
3169
|
+
|
|
3170
|
+
if self.color and 'color_val' in data.columns:
|
|
3171
|
+
# User specified explicit color mapping
|
|
3172
|
+
group_column = 'color_val'
|
|
3173
|
+
group_label = self.color
|
|
3174
|
+
elif self.shape == "well" and 'well' in data.columns:
|
|
3175
|
+
# When shape="well", each well gets a different color in the plot
|
|
3176
|
+
group_column = 'well'
|
|
3177
|
+
group_label = 'well'
|
|
3178
|
+
elif self.shape and self.shape != "well" and 'shape_val' in data.columns:
|
|
3179
|
+
# When shape is a property, each shape group gets a different color
|
|
3180
|
+
group_column = 'shape_val'
|
|
3181
|
+
group_label = self.shape
|
|
3182
|
+
|
|
3183
|
+
if group_column is None:
|
|
3184
|
+
warnings.warn(
|
|
3185
|
+
"regression_by_color specified but no color grouping detected in plot. "
|
|
3186
|
+
"Use color=<property>, shape='well', or shape=<property> parameter."
|
|
3187
|
+
)
|
|
3167
3188
|
else:
|
|
3168
|
-
#
|
|
3169
|
-
if 'color_val'
|
|
3170
|
-
# For continuous
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3189
|
+
# Check if color is categorical (not continuous like depth)
|
|
3190
|
+
if group_column == 'color_val' and (self.color == 'depth' or pd.api.types.is_numeric_dtype(data[group_column])):
|
|
3191
|
+
# For continuous values, we can't create separate regressions
|
|
3192
|
+
warnings.warn(
|
|
3193
|
+
f"regression_by_color requires categorical color mapping, "
|
|
3194
|
+
f"but '{self.color}' is continuous. Use regression_by_group instead."
|
|
3195
|
+
)
|
|
3196
|
+
else:
|
|
3197
|
+
# Categorical values - group and create regressions
|
|
3198
|
+
color_groups = data.groupby(group_column)
|
|
3199
|
+
n_groups = len(color_groups)
|
|
3200
|
+
|
|
3201
|
+
# Validate regression count
|
|
3202
|
+
if regression_count + n_groups > total_points / 2:
|
|
3203
|
+
raise ValueError(
|
|
3204
|
+
f"Too many regression lines requested: {regression_count + n_groups} lines "
|
|
3205
|
+
f"for {total_points} data points (average < 2 points per line). "
|
|
3206
|
+
f"Reduce the number of groups or use a different regression strategy."
|
|
3177
3207
|
)
|
|
3178
|
-
else:
|
|
3179
|
-
# Categorical color values
|
|
3180
|
-
color_groups = data.groupby('color_val')
|
|
3181
|
-
n_groups = len(color_groups)
|
|
3182
|
-
|
|
3183
|
-
# Validate regression count
|
|
3184
|
-
if regression_count + n_groups > total_points / 2:
|
|
3185
|
-
raise ValueError(
|
|
3186
|
-
f"Too many regression lines requested: {regression_count + n_groups} lines "
|
|
3187
|
-
f"for {total_points} data points (average < 2 points per line). "
|
|
3188
|
-
f"Reduce the number of groups or use a different regression strategy."
|
|
3189
|
-
)
|
|
3190
3208
|
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3209
|
+
for idx, (group_name, group_data) in enumerate(color_groups):
|
|
3210
|
+
x_vals = group_data['x'].values
|
|
3211
|
+
y_vals = group_data['y'].values
|
|
3212
|
+
mask = np.isfinite(x_vals) & np.isfinite(y_vals)
|
|
3213
|
+
if np.sum(mask) >= 2:
|
|
3214
|
+
# Copy config and set default line color if not specified
|
|
3215
|
+
group_config = config.copy()
|
|
3216
|
+
if 'line_color' not in group_config:
|
|
3217
|
+
group_config['line_color'] = regression_colors[color_idx % len(regression_colors)]
|
|
3218
|
+
|
|
3219
|
+
# Skip legend update for all but last regression
|
|
3220
|
+
is_last = (idx == n_groups - 1)
|
|
3221
|
+
self._add_group_regression(
|
|
3222
|
+
x_vals[mask], y_vals[mask],
|
|
3223
|
+
reg_type,
|
|
3224
|
+
name=f"{group_label}={group_name}",
|
|
3225
|
+
config=group_config,
|
|
3226
|
+
update_legend=is_last
|
|
3227
|
+
)
|
|
3228
|
+
regression_count += 1
|
|
3229
|
+
color_idx += 1
|
|
3212
3230
|
|
|
3213
3231
|
# Add regression by groups (well or shape)
|
|
3214
3232
|
if self.regression_by_group:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
well_log_toolkit/__init__.py,sha256=ilJAIIhh68pYfD9I3V53juTEJpoMN8oHpcpEFNpuXAQ,3793
|
|
2
2
|
well_log_toolkit/exceptions.py,sha256=X_fzC7d4yaBFO9Vx74dEIB6xmI9Agi6_bTU3MPxn6ko,985
|
|
3
3
|
well_log_toolkit/las_file.py,sha256=yRCIiVbdoqFzoXKRKfx7Lt11INmwB_bXdpHpwVaNpjk,52156
|
|
4
|
-
well_log_toolkit/manager.py,sha256=
|
|
4
|
+
well_log_toolkit/manager.py,sha256=DvBOk9iLItcLKnx4IQA2AlPeqVafOgyDa4M1xMTE_6k,101727
|
|
5
5
|
well_log_toolkit/operations.py,sha256=z8j8fGBOwoJGUQFy-Vawjq9nm3OD_dUt0oaNh8yuG7o,18515
|
|
6
6
|
well_log_toolkit/property.py,sha256=WOzoNQcmHCQ8moIKsnSyLgVC8s4LBu2x5IBXtFzmMe8,76236
|
|
7
7
|
well_log_toolkit/regression.py,sha256=19wpiQQdGxuyIbjfzIY_yLzUUGT_ampWE_km1bg3o3c,24527
|
|
8
8
|
well_log_toolkit/statistics.py,sha256=_huPMbv2H3o9ezunjEM94mJknX5wPK8V4nDv2lIZZRw,16814
|
|
9
9
|
well_log_toolkit/utils.py,sha256=O2KPq4htIoUlL74V2zKftdqqTjRfezU9M-568zPLme0,6866
|
|
10
|
-
well_log_toolkit/visualization.py,sha256=
|
|
10
|
+
well_log_toolkit/visualization.py,sha256=vmRhigawQyowH2mhTWs7kG5quJV0kB5_mU8S29EAcFA,148788
|
|
11
11
|
well_log_toolkit/well.py,sha256=jv8xPQi-y5dLRQ7WIyBsr8DIMIAiFt4UJ9Rum7xTx7o,90170
|
|
12
|
-
well_log_toolkit-0.1.
|
|
13
|
-
well_log_toolkit-0.1.
|
|
14
|
-
well_log_toolkit-0.1.
|
|
15
|
-
well_log_toolkit-0.1.
|
|
12
|
+
well_log_toolkit-0.1.116.dist-info/METADATA,sha256=nahOX_H_Oq0rh5xniTlPGGrUp4jS6Y-6m_Iyp92g77g,59737
|
|
13
|
+
well_log_toolkit-0.1.116.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
well_log_toolkit-0.1.116.dist-info/top_level.txt,sha256=BMOo7OKLcZEnjo0wOLMclwzwTbYKYh31I8RGDOGSBdE,17
|
|
15
|
+
well_log_toolkit-0.1.116.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|