@@ -39,8 +39,8 @@ def dummy_acrohandler(
39
39
data , command , varlist , exclusion , exp , weights , options
40
40
): # pylint:disable=too-many-arguments
41
41
"""
42
- provides an alternative interface that mimics the code in acro.ado
43
- Most notably the presence of a global variable called stata_acro
42
+ Provides an alternative interface that mimics the code in acro.ado
43
+ Most notably the presence of a global variable called stata_acro.
44
44
"""
45
45
# global stata_acro
46
46
acro_outstr = parse_and_run (
@@ -55,7 +55,7 @@ def test_find_brace_contents():
55
55
"""Tests helper function
56
56
that extracts contents 'A B C'
57
57
of something specified via X(A B C)
58
- on the stata command line
58
+ on the stata command line.
59
59
"""
60
60
options = "by(grant_type) contents(mean sd inc_activity) suppress nototals"
61
61
res , substr = find_brace_contents ("by" , options )
@@ -70,7 +70,7 @@ def test_find_brace_contents():
70
70
71
71
72
72
def test_apply_stata_ifstmt (data ):
73
- """tests that if statements work for selection"""
73
+ """Tests that if statements work for selection. """
74
74
ifstring = "year!=2013"
75
75
all_list = list (data ["year" ].unique ())
76
76
smaller = apply_stata_ifstmt (ifstring , data )
@@ -83,7 +83,7 @@ def test_apply_stata_ifstmt(data):
83
83
84
84
85
85
def test_apply_stata_expstmt (data ):
86
- """tests that in statements work for row selection"""
86
+ """Tests that in statements work for row selection. """
87
87
length = data .shape [0 ]
88
88
# use of f/F and l/L for first and last with specified row range
89
89
exp = "f/5"
@@ -122,7 +122,7 @@ def test_stata_acro_init() -> str:
122
122
Tests creation of an acro object at the start of a session
123
123
For stata this gets held in a variable stata_acro
124
124
Which is initialsied to the string "empty" in the acro.ado file
125
- Then should be pointed at a new acro instance
125
+ Then should be pointed at a new acro instance.
126
126
"""
127
127
assert isinstance (stata_acro , str )
128
128
ret = dummy_acrohandler (
@@ -135,7 +135,7 @@ def test_stata_acro_init() -> str:
135
135
136
136
137
137
def test_stata_print_outputs (data ):
138
- """checks print_outputs gets called"""
138
+ """Checks print_outputs gets called. """
139
139
ret = dummy_acrohandler (
140
140
data ,
141
141
command = "print_outputs" ,
@@ -151,10 +151,10 @@ def test_stata_print_outputs(data):
151
151
# ----main SDC functionality
152
152
def test_simple_table (data ) -> str :
153
153
"""
154
- checks that the simple table command works as expected
154
+ Checks that the simple table command works as expected
155
155
Does via reference to direct call to pd.crosstab()
156
156
To make sure table specification is parsed correctly
157
- acro SDC analysis is tested elsewhere
157
+ acro SDC analysis is tested elsewhere.
158
158
"""
159
159
correct = pd .crosstab (
160
160
index = data ["survivor" ], columns = data ["grant_type" ]
@@ -176,7 +176,7 @@ def test_simple_table(data) -> str:
176
176
def test_parse_table_details (data ):
177
177
"""
178
178
Series of checks that the varlist and options are parsed correctly
179
- by the helper function
179
+ by the helper function.
180
180
"""
181
181
182
182
varlist = ["survivor" , "grant_type" , "year" ]
@@ -201,7 +201,7 @@ def test_parse_table_details(data):
201
201
202
202
203
203
def test_stata_probit (data ):
204
- """checks probit gets called correctly"""
204
+ """Checks probit gets called correctly. """
205
205
ret = dummy_acrohandler (
206
206
data ,
207
207
command = "probit" ,
@@ -222,7 +222,7 @@ def test_stata_probit(data):
222
222
223
223
224
224
def test_stata_linregress (data ):
225
- """checks linear regression called correctly"""
225
+ """Checks linear regression called correctly. """
226
226
ret = dummy_acrohandler (
227
227
data ,
228
228
command = "regress" ,
@@ -243,9 +243,7 @@ def test_stata_linregress(data):
243
243
244
244
245
245
def test_unsupported_formatting_options (data ):
246
- """
247
- checks that user gets warning if they try to format table
248
- """
246
+ """Checks that user gets warning if they try to format table."""
249
247
format_string = "acro does not currently support table formatting commands."
250
248
correct = pd .crosstab (
251
249
index = data ["survivor" ], columns = data ["grant_type" ]
@@ -279,7 +277,7 @@ def test_unsupported_formatting_options(data):
279
277
280
278
281
279
def test_stata_finalise ():
282
- """checks finalise gets called correctly"""
280
+ """Checks finalise gets called correctly. """
283
281
ret = dummy_acrohandler (
284
282
data ,
285
283
command = "finalise" ,
0 commit comments