Skip to content

Commit 5fe3110

Browse files
committed
REFACTOR: reformat code with newest black
1 parent b9489d8 commit 5fe3110

File tree

5 files changed

+1
-8
lines changed

5 files changed

+1
-8
lines changed

src/facet/explanation/_explanation.py

+1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def to_expression(self) -> Expression:
344344
# Exact explainer factory
345345
#
346346

347+
347348
# noinspection PyPep8Naming
348349
class _ExactExplainer(
349350
shap.explainers.Exact, # type: ignore

src/facet/inspection/shap/_shap.py

-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ def _reset_fit(self) -> None:
290290
self.output_names_ = None
291291

292292
def _make_explainer(self, features: pd.DataFrame) -> BaseExplainer:
293-
294293
# prepare the background dataset
295294

296295
background_dataset: Optional[pd.DataFrame]

src/facet/inspection/shap/sklearn/_sklearn.py

-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ def _convert_shap_tensors_to_list(
241241
shap_tensors: Union[npt.NDArray[np.float_], List[npt.NDArray[np.float_]]],
242242
n_outputs: int,
243243
) -> List[npt.NDArray[np.float_]]:
244-
245244
if n_outputs == 1 and isinstance(shap_tensors, list) and len(shap_tensors) == 2:
246245
# in the binary classification case, we will proceed with SHAP values
247246
# for class 0 only, since values for class 1 will just be the same
@@ -273,7 +272,6 @@ def _convert_shap_to_df(
273272
observation_idx: pd.Index,
274273
feature_idx: pd.Index,
275274
) -> List[pd.DataFrame]:
276-
277275
if self.interaction_values:
278276
# return a list of data frame [(obs x features) x features],
279277
# one for each of the outputs

src/facet/selection/_parameters.py

-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ def get_parameters(self, prefix: Optional[str] = None) -> ParameterDict:
185185
}
186186

187187
def _validate_parameter(self, name: str, value: ParameterSet) -> None:
188-
189188
if name not in self._params:
190189
raise AttributeError(
191190
f"unknown parameter name for "
@@ -222,7 +221,6 @@ def __dir__(self) -> Iterable[str]:
222221

223222
def __getattr__(self, key: str) -> Any:
224223
if not key.startswith("_"):
225-
226224
result: Union[ParameterSpace[Any], ParameterSet, None]
227225

228226
result = self._children.get(key, None)
@@ -241,7 +239,6 @@ def __iter__(self) -> Iterator[Tuple[List[str], ParameterSet]]:
241239
def _iter_parameters(
242240
self, path_prefix: List[str]
243241
) -> Iterator[Tuple[List[str], ParameterSet]]:
244-
245242
yield from (
246243
([*path_prefix, name], value) for name, value in self._values.items()
247244
)

src/facet/validation/_validation.py

-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def split(
115115
test: npt.NDArray[np.int_] = indices[test_mask]
116116
# make sure test is not empty, else sample another train set
117117
if len(test) > 0:
118-
119118
yield train, test
120119
break
121120

@@ -254,7 +253,6 @@ def _select_train_indices(
254253
random_state: np.random.RandomState,
255254
y: Union[npt.NDArray[Any], pd.Series, pd.DataFrame, None],
256255
) -> npt.NDArray[np.int_]:
257-
258256
mean_block_size = self.mean_block_size
259257
if mean_block_size < 1:
260258
# if mean block size was set as a percentage, calculate the actual mean

0 commit comments

Comments
 (0)