Skip to content

Commit

Permalink
ran black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ronikobrosly committed Jul 5, 2020
1 parent 985bb9e commit df94f0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion causal_curve/gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _validate_init_params(self):
if not isinstance(self.gps_family, (str, type(None))):
raise TypeError(
f"gps_family parameter must be a string or None "
f"but found type {type(self.gps_family)}"
f"but found type {type(self.gps_family)}"
)

if (isinstance(self.gps_family, str)) and (
Expand Down
8 changes: 2 additions & 6 deletions causal_curve/mediation.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,7 @@ def calculate_mediation(self, ci=0.95):
bootstrap_overall_means = []
for i in range(0, 1000):
bootstrap_overall_means.append(
general_indirect.sample(
frac=0.25, replace=True
).mean()
general_indirect.sample(frac=0.25, replace=True).mean()
)

bootstrap_overall_means = np.array(bootstrap_overall_means)
Expand Down Expand Up @@ -585,9 +583,7 @@ def _bootstrap_analysis(self, temp_low_treatment, temp_high_treatment):
def _create_bootstrap_replicate(self):
"""Creates a single bootstrap replicate from the data
"""
temp_t = self.T.sample(
n=self.bootstrap_draws, replace=True
)
temp_t = self.T.sample(n=self.bootstrap_draws, replace=True)
temp_m = self.M.iloc[temp_t.index]
temp_y = self.y.iloc[temp_t.index]

Expand Down
4 changes: 2 additions & 2 deletions causal_curve/tmle.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ def _validate_init_params(self):
if not isinstance(self.treatment_grid_bins, list):
raise TypeError(
f"treatment_grid_bins parameter must be a list, "
f"but found type {type(self.treatment_grid_bins)}"
f"but found type {type(self.treatment_grid_bins)}"
)

for element in self.treatment_grid_bins:
if not isinstance(element, (int, float)):
raise TypeError(
f"'{element}' in `treatment_grid_bins` list is not of type float or int, "
f"it is {type(element)}"
f"it is {type(element)}"
)

if len(self.treatment_grid_bins) < 2:
Expand Down

0 comments on commit df94f0d

Please sign in to comment.