SDV icon indicating copy to clipboard operation
SDV copied to clipboard

Standardize usage of `self.columns` in the `sdv/constraints/tabular.py` file

Open fealho opened this issue 2 years ago • 2 comments

Currently constraints store their columns as either self._columns or self.columns. Some constraints also set the self.constraint_columns attribute while others don't, which can cause confusion since it gets used in other files. We should agree on a standard and use it everywhere.

fealho avatar May 19 '22 00:05 fealho

@amontanez24 Do you know why we use self.columns and self.constraint_columns for the constraints?

fealho avatar May 19 '22 00:05 fealho

The constraint_columns are used by the base class to figure out which columns to model if the fit_columns_model attribute is True. This is used for conditional sampling when constraints are involved. I think self.columns is used for different reasons depending on the constraint. I believe we intend to move in the directions of normalizing the meaning and usage of self.columns

amontanez24 avatar May 19 '22 01:05 amontanez24