Skip to content

Commit 2dff12d

Browse files
committed
fix: formatting errors
1 parent fedec63 commit 2dff12d

28 files changed

+69
-30
lines changed

src/trustyai/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
def init():
2222
"""Deprecated manual initializer for the JVM. This function has been replaced by
2323
automatic initialization when importing the components of the module that require
24-
JVM access, or by manual user initialization via :func:`trustyai`initializer.init`."""
24+
JVM access, or by manual user initialization via :func:`trustyai`initializer.init`.
25+
"""
2526
warnings.warn(
2627
"trustyai.init() is now deprecated; the trustyai library will now "
2728
+ "automatically initialize. For manual initialization options, see "

src/trustyai/explainers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Explainers module"""
2+
23
# pylint: disable=duplicate-code
34
from .counterfactuals import CounterfactualResult, CounterfactualExplainer
45
from .lime import LimeExplainer, LimeResults

src/trustyai/explainers/counterfactuals.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Explainers.countefactual module"""
2+
23
# pylint: disable = import-error, too-few-public-methods, wrong-import-order, line-too-long,
34
# pylint: disable = unused-argument
45
from typing import Optional, Union, List

src/trustyai/explainers/explanation_results.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Generic class for Explanation and Saliency results"""
2+
23
from abc import ABC, abstractmethod
34

45
import pandas as pd

src/trustyai/explainers/extras/tsice.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Wrapper module for TSICEExplainer from aix360.
33
Original at https://github.com/Trusted-AI/AIX360/
44
"""
5+
56
# pylint: disable=too-many-arguments,import-error
67
from typing import Callable, List, Optional, Union
78

@@ -46,7 +47,8 @@ def as_html(self) -> pd.io.formats.style.Styler:
4647

4748
def plot_forecast(self, variable): # pylint: disable=too-many-locals
4849
"""Plots the explanation.
49-
Based on https://github.com/Trusted-AI/AIX360/blob/master/examples/tsice/plots.py"""
50+
Based on https://github.com/Trusted-AI/AIX360/blob/master/examples/tsice/plots.py
51+
"""
5052
forecast_horizon = self.explanation["current_forecast"].shape[0]
5153
original_ts = pd.DataFrame(
5254
data={variable: self.explanation["data_x"][variable]}
@@ -161,7 +163,8 @@ def _add_timeseries(
161163

162164
def plot_impact(self, feature_per_row=2):
163165
"""Plot the impace.
164-
Based on https://github.com/Trusted-AI/AIX360/blob/master/examples/tsice/plots.py"""
166+
Based on https://github.com/Trusted-AI/AIX360/blob/master/examples/tsice/plots.py
167+
"""
165168

166169
n_row = int(np.ceil(len(self.explanation["feature_names"]) / feature_per_row))
167170
feat_values = np.array(self.explanation["feature_values"])

src/trustyai/explainers/extras/tslime.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def as_html(self) -> Styler:
3535

3636
def plot(self):
3737
"""Plot TSLime explanation for the time-series instance. Based on
38-
https://github.com/Trusted-AI/AIX360/blob/master/examples/tslime/tslime_univariate_demo.ipynb"""
38+
https://github.com/Trusted-AI/AIX360/blob/master/examples/tslime/tslime_univariate_demo.ipynb
39+
"""
3940
relevant_history = self.explanation["history_weights"].shape[0]
4041
input_data = self.explanation["input_data"]
4142
relevant_df = input_data[-relevant_history:]

src/trustyai/explainers/lime.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Explainers.lime module"""
2+
23
# pylint: disable = import-error, too-few-public-methods, wrong-import-order, line-too-long,
34
# pylint: disable = unused-argument, duplicate-code, consider-using-f-string, invalid-name
45
from typing import Dict, Union

src/trustyai/explainers/pdp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Explainers.pdp module"""
2+
23
import math
34
import pandas as pd
45
from pandas.io.formats.style import Styler

src/trustyai/explainers/shap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Explainers.shap module"""
2+
23
# pylint: disable = import-error, too-few-public-methods, wrong-import-order, line-too-long,
34
# pylint: disable = unused-argument, consider-using-f-string, invalid-name
45
from typing import Dict, Optional, Union
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""Language detoxification module."""
2+
23
from trustyai.language.detoxify.tmarco import TMaRCo

0 commit comments

Comments
 (0)