Skip to content

Commit e160b2a

Browse files
authored
Merge pull request #1664 from danforthcenter/remove_label_detect_color_card
Add deprecation warning about `label` from the detect color card function
2 parents f984cb2 + d6db91b commit e160b2a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

plantcv/plantcv/transform/auto_correct_color.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Automatically detect a color card and color correct to standard chip values
22

3-
from plantcv.plantcv import params
3+
from plantcv.plantcv import params, deprecation_warning
44
from plantcv.plantcv.transform.detect_color_card import detect_color_card
55
from plantcv.plantcv.transform.color_correction import get_color_matrix, std_color_matrix, affine_color_correction
66

@@ -28,7 +28,10 @@ def auto_correct_color(rgb_img, label=None, **kwargs):
2828
# Set lable to params.sample_label if None
2929
if label is None:
3030
label = params.sample_label
31-
31+
deprecation_warning(
32+
"The 'label' parameter is no longer utilized, since color chip size is now metadata. "
33+
"It will be removed in PlantCV v5.0."
34+
)
3235
# Get keyword arguments and set defaults if not set
3336
labeled_mask = detect_color_card(rgb_img=rgb_img, min_size=kwargs.get("min_size", 1000),
3437
radius=kwargs.get("radius", 20),

plantcv/plantcv/transform/detect_color_card.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import cv2
77
import math
88
import numpy as np
9-
from plantcv.plantcv import params, outputs, fatal_error
9+
from plantcv.plantcv import params, outputs, fatal_error, deprecation_warning
1010
from plantcv.plantcv._debug import _debug
1111

1212

@@ -108,7 +108,10 @@ def detect_color_card(rgb_img, label=None, **kwargs):
108108
# Set lable to params.sample_label if None
109109
if label is None:
110110
label = params.sample_label
111-
111+
deprecation_warning(
112+
"The 'label' parameter is no longer utilized, since color chip size is now metadata. "
113+
"It will be removed in PlantCV v5.0."
114+
)
112115
# Get keyword arguments and set defaults if not set
113116
min_size = kwargs.get("min_size", 1000) # Minimum size for _is_square chip filtering
114117
radius = kwargs.get("radius", 20) # Radius of circles to draw on the color chips

0 commit comments

Comments
 (0)