Skip to content

Commit 35b6f6c

Browse files
committed
fixing lint errors
Signed-off-by: Nathaniel <[email protected]>
1 parent 298fe78 commit 35b6f6c

13 files changed

+80
-60
lines changed

causalpy/data/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Code for loading datasets."""
2+
23
from .datasets import load_data
34

45
__all__ = ["load_data"]

causalpy/data/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Functions to load example datasets
33
"""
4+
45
import pathlib
56

67
import pandas as pd

causalpy/data/simulate_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Functions that generate data sets used in examples
33
"""
4+
45
import numpy as np
56
import pandas as pd
67
from scipy.stats import dirichlet, gamma, norm, uniform

causalpy/pymc_experiments.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ class InversePropensityWeighting(ExperimentalDesign, PropensityDataValidator):
14961496
A string denoting which weighting scheme to use among: 'raw', 'robust',
14971497
'doubly robust' or 'overlap'. See Aronow and Miller "Foundations
14981498
of Agnostic Statistics" for discussion and computation of these
1499-
weighting schemes.
1499+
weighting schemes.
15001500
:param model:
15011501
A PyMC model
15021502
@@ -1550,9 +1550,9 @@ def __init__(
15501550
self.model.fit(X=self.X, t=self.t, coords=COORDS)
15511551

15521552
def make_robust_adjustments(self, ps):
1553-
""" This estimator is discussed in Aronow
1554-
and Miller's book as being related to the
1555-
Horvitz Thompson method """
1553+
"""This estimator is discussed in Aronow
1554+
and Miller's book as being related to the
1555+
Horvitz Thompson method"""
15561556
X = pd.DataFrame(self.X, columns=self.labels)
15571557
X["ps"] = ps
15581558
X[self.outcome_variable] = self.y
@@ -1570,8 +1570,8 @@ def make_robust_adjustments(self, ps):
15701570
return weighted_outcome0, weighted_outcome1, n_ntrt, n_trt
15711571

15721572
def make_raw_adjustments(self, ps):
1573-
""" This estimator is discussed in Aronow and
1574-
Miller as the simplest of base form of
1573+
"""This estimator is discussed in Aronow and
1574+
Miller as the simplest of base form of
15751575
inverse propensity weighting schemes"""
15761576
X = pd.DataFrame(self.X, columns=self.labels)
15771577
X["ps"] = ps
@@ -1589,10 +1589,10 @@ def make_raw_adjustments(self, ps):
15891589
return weighted_outcome0, weighted_outcome1, n_ntrt, n_trt
15901590

15911591
def make_overlap_adjustments(self, ps):
1592-
"""This weighting scheme was adapted from
1593-
Lucy D’Agostino McGowan's blog on
1594-
Propensity Score Weights referenced in
1595-
the primary CausalPy explainer notebook"""
1592+
"""This weighting scheme was adapted from
1593+
Lucy D’Agostino McGowan's blog on
1594+
Propensity Score Weights referenced in
1595+
the primary CausalPy explainer notebook"""
15961596
X = pd.DataFrame(self.X, columns=self.labels)
15971597
X["ps"] = ps
15981598
X[self.outcome_variable] = self.y
@@ -1609,7 +1609,7 @@ def make_overlap_adjustments(self, ps):
16091609
return weighted_outcome0, weighted_outcome1, n_ntrt, n_trt
16101610

16111611
def make_doubly_robust_adjustment(self, ps):
1612-
""" The doubly robust weighting scheme is also
1612+
"""The doubly robust weighting scheme is also
16131613
discussed in Aronow and Miller, but a bit more generally
16141614
than our implementation here. Here we have specified
16151615
the outcome model to be a simple OLS model.
@@ -1740,7 +1740,8 @@ def make_hists(idata, i, axs, method=method):
17401740
0.9, linestyle="--", label="Hi Extreme Propensity Scores", color="black"
17411741
)
17421742
axs[0].set_title(
1743-
"Weighted and Unweighted Draws from the Posterior \n Propensity Scores Distribution", fontsize=20
1743+
"Weighted and Unweighted Draws from the Posterior \n Propensity Scores Distribution",
1744+
fontsize=20,
17441745
)
17451746
axs[0].set_ylabel("Counts of Observations")
17461747
axs[0].set_xlabel("Propensity Scores")

causalpy/skl_experiments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- DifferenceInDifferences
99
- RegressionDiscontinuity
1010
"""
11+
1112
import warnings
1213
from typing import Optional
1314

causalpy/skl_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Weighted Proportion
55
66
"""
7+
78
from functools import partial
89

910
import numpy as np

causalpy/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Functions:
55
* rng: random number generator with session level scope
66
"""
7+
78
import numpy as np
89
import pytest
910

causalpy/tests/test_data_loading.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests that example data can be loaded into data frames.
33
"""
4+
45
import pandas as pd
56
import pytest
67

causalpy/tests/test_pymc_experiments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Unit tests for pymc_experiments.py
33
"""
4+
45
import arviz as az
56
import matplotlib as mpl
67
import pandas as pd

causalpy/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Utility functions
33
"""
4+
45
import numpy as np
56
import pandas as pd
67

0 commit comments

Comments
 (0)