Skip to content

Commit ebdc682

Browse files
committed
fix format
1 parent c797881 commit ebdc682

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

doubleml/_utils_plots.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ def _sensitivity_contour_plot(x,
3636

3737
if include_scenario:
3838
fig.add_trace(go.Scatter(x=[scenario_x],
39-
y=[scenario_y],
40-
mode="markers+text",
41-
marker=dict(size=10, color='red', line=dict(width=2, color=text_col)),
42-
hovertemplate=hov_temp + f': {round(scenario_value, 3)}' + '</b>',
43-
name='Scenario',
44-
textfont=dict(color=text_col, size=14),
45-
text=['<b>Scenario</b>'],
46-
textposition="top right",
47-
showlegend=False))
39+
y=[scenario_y],
40+
mode="markers+text",
41+
marker=dict(size=10, color='red', line=dict(width=2, color=text_col)),
42+
hovertemplate=hov_temp + f': {round(scenario_value, 3)}' + '</b>',
43+
name='Scenario',
44+
textfont=dict(color=text_col, size=14),
45+
text=['<b>Scenario</b>'],
46+
textposition="top right",
47+
showlegend=False))
4848

4949
# add unadjusted
5050
fig.add_trace(go.Scatter(x=[0],

doubleml/datasets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,8 @@ def make_confounded_irm_data(n_obs=500, theta=5.0, cf_y=0.04, cf_d=0.04):
957957
958958
The observed data is given as :math:`W = (Y, D, X)`.
959959
Further, orcale values of the confounder :math:`A`, the transformed covariated :math:`Z`,
960-
the potential outcomes of :math:`Y`, the coefficients :math:`\\gamma_a`, :math:`\\beta_a`, the long and short forms of the main regression and the propensity score
960+
the potential outcomes of :math:`Y`, the coefficients :math:`\\gamma_a`, :math:`\\beta_a`, the
961+
long and short forms of the main regression and the propensity score
961962
are returned in a dictionary.
962963
963964
Parameters

doubleml/double_ml.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,8 @@ def sensitivity_analysis(self, cf_y=0.03, cf_d=0.03, rho=1.0, level=0.95, null_h
16571657
16581658
null_hypothesis : float or numpy.ndarray
16591659
Null hypothesis for the effect. Determines the robustness values.
1660-
If it is a single float uses the same null hypothesis for all estimated parameters. Else the array has to be of shape (n_coefs,).
1660+
If it is a single float uses the same null hypothesis for all estimated parameters.
1661+
Else the array has to be of shape (n_coefs,).
16611662
Default is ``0.0``.
16621663
16631664
Returns
@@ -1673,7 +1674,8 @@ def sensitivity_analysis(self, cf_y=0.03, cf_d=0.03, rho=1.0, level=0.95, null_h
16731674
if null_hypothesis.shape == (self._dml_data.n_treat,):
16741675
null_hypothesis_vec = null_hypothesis
16751676
else:
1676-
raise ValueError(f"null_hypothesis is numpy.ndarray but does not have the required shape ({self._dml_data.n_treat},). "
1677+
raise ValueError("null_hypothesis is numpy.ndarray but does not have the required "
1678+
f"shape ({self._dml_data.n_treat},). "
16771679
f'Array of shape {str(null_hypothesis.shape)} was passed.')
16781680
else:
16791681
raise TypeError("null_hypothesis has to be of type float or np.ndarry. "
@@ -1684,7 +1686,8 @@ def sensitivity_analysis(self, cf_y=0.03, cf_d=0.03, rho=1.0, level=0.95, null_h
16841686
rva = np.full(shape=self._dml_data.n_treat, fill_value=np.nan)
16851687

16861688
for i_treat in range(self._dml_data.n_treat):
1687-
rv[i_treat], rva[i_treat] = self._calc_robustness_value(null_hypothesis=null_hypothesis_vec[i_treat], level=level, rho=rho, idx_treatment=i_treat)
1689+
rv[i_treat], rva[i_treat] = self._calc_robustness_value(null_hypothesis=null_hypothesis_vec[i_treat],
1690+
level=level, rho=rho, idx_treatment=i_treat)
16881691

16891692
sensitivity_dict['rv'] = rv
16901693
sensitivity_dict['rva'] = rva

0 commit comments

Comments
 (0)