-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit test values for COD, PRD, and PRB based on known good IAAO values #26
Changes from all commits
73a8679
6401958
a7c94e2
47bb00b
9c6e5fc
54e0afe
3bbcea0
032f4d2
dbd6227
f2a6773
f79028a
50feece
d8520e0
0ac221c
fcb7ac2
a770f9c
f6aa6de
c6cf1db
563bcf1
c189bb4
72a0898
f933e78
91f655d
9cef6d7
e96ed28
b252abf
de8c0fa
9bca236
7806ac1
0d84a32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
estimate,sale_price | ||
48000,138000 | ||
28800,59250 | ||
78400,157500 | ||
39840,74400 | ||
68160,114900 | ||
94400,159000 | ||
67200,111900 | ||
56960,93000 | ||
87200,138720 | ||
38240,59700 | ||
96320,146400 | ||
67680,99000 | ||
32960,47400 | ||
50560,70500 | ||
61360,78000 | ||
47360,60000 | ||
58080,69000 | ||
47040,55500 | ||
136000,154500 | ||
103200,109500 | ||
59040,60000 | ||
168000,168000 | ||
128000,124500 | ||
132000,127500 | ||
160000,150000 | ||
160000,141000 | ||
200000,171900 | ||
184000,157500 | ||
160000,129600 | ||
157200,126000 | ||
99200,77700 | ||
200000,153000 | ||
64000,48750 | ||
192000,144000 | ||
190400,141000 | ||
65440,48000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
estimate,sale_price | ||
87200,138720 | ||
38240,59700 | ||
96320,146400 | ||
68610,99000 | ||
32960,47400 | ||
50560,70500 | ||
61360,78000 | ||
47360,60000 | ||
56580,69000 | ||
47040,55500 | ||
136000,154500 | ||
98000,109500 | ||
56000,60000 | ||
159100,168000 | ||
128000,124500 | ||
132000,127500 | ||
160000,150000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
estimate,sale_price | ||
116700,114500 | ||
130300,121000 | ||
130200,133900 | ||
145500,139000 | ||
134100,145000 | ||
153900,156500 | ||
143400,161100 | ||
156900,169500 | ||
169000,175000 | ||
149200,181000 | ||
160100,188900 | ||
191400,205000 | ||
177200,216150 | ||
205500,219000 | ||
206500,235000 | ||
243800,249000 | ||
211600,258900 | ||
242500,263000 | ||
258400,305900 | ||
265900,312500 | ||
305700,336000 | ||
291600,360000 | ||
312800,399900 | ||
352200,418500 | ||
354900,459000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
estimate,sale_price | ||
45000,50000 | ||
100000,100000 | ||
165000,150000 | ||
180000,200000 | ||
250000,250000 | ||
330000,300000 | ||
315000,350000 | ||
400000,400000 | ||
495000,450000 | ||
450000,500000 | ||
550000,550000 | ||
660000,600000 | ||
585000,650000 | ||
700000,700000 | ||
825000,750000 | ||
1875000,2500000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,48 @@ def metric_val(self, metric, ccao_data, quintos_data): | |
return getattr(ap, metric)(*quintos_data) | ||
return getattr(ap, metric)(*ccao_data) | ||
|
||
def test_metric_value_is_correct(self, metric, metric_val): | ||
def test_metric_value_is_correct_ccao(self, metric, metric_val): | ||
expected = { | ||
"cod": 17.81456901196891, | ||
"prd": 1.0484192615223522, | ||
"prb": 0.0024757, | ||
"mki": 0.794, | ||
"ki": -0.06, | ||
} | ||
assert pt.approx(metric_val, rel=0.02) == expected[metric] | ||
assert pt.approx(metric_val, rel=0.01) == expected[metric] | ||
|
||
def test_metric_value_is_correct_iaao( | ||
self, metric, iaao_data_name, iaao_data | ||
): | ||
if metric in ["mki", "ki"]: | ||
return None | ||
else: | ||
result = getattr(ap, metric)(*iaao_data) | ||
expected = { | ||
"1_1": { | ||
"cod": 29.8, | ||
"prd": 0.98, | ||
"prb": 0.232, | ||
}, | ||
"1_4": { | ||
"cod": 14.5, | ||
"prd": 0.98, | ||
"prb": 0.135, | ||
}, | ||
"d_1": { | ||
"cod": 7.5, | ||
"prd": 1.027, | ||
"prb": -0.120, | ||
}, | ||
"d_2": { | ||
"cod": 7.8, | ||
"prd": 1.056, | ||
"prb": -0.011, | ||
}, | ||
} | ||
Comment on lines
+34
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Thought, non-blocking] If we did decide to factor out an |
||
assert ( | ||
pt.approx(result, rel=0.02) == expected[iaao_data_name][metric] | ||
) | ||
|
||
def test_metric_has_numeric_output(self, metric_val): | ||
assert type(metric_val) is float | ||
|
@@ -38,7 +71,7 @@ def test_metric_succeeds_on_good_input(self, metric, good_input): | |
|
||
def test_metric_met_function_thresholds(self, metric, metric_val): | ||
if metric == "ki": | ||
pt.skip("Skipping test for 'ki' metric (ki_met does not exist)") | ||
return None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not actually skipping a test, we just don't even need to run it. Switching to this has the advantage of not showing a "N skipped tests" warning in the |
||
expected = { | ||
"cod": False, | ||
"prd": False, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,14 @@ AssessPy package | |
Source Code <https://github.com/ccao-data/assesspy> | ||
|
||
AssessPy is a software package for Python developed by the Cook County | ||
Assessor's (CCAO) Data Department. The codebase for the CCAO's CAMA system | ||
uses a wide range of functions regularly, and packaging these functions | ||
streamlines and standardizes their use. The CCAO is publishing this package | ||
to make it available to assessors, reporters, and citizens everywhere. | ||
|
||
For assessors, we believe that this package will reduce the complexity | ||
of calculating ratio statistics and detecting sales chasing. We also | ||
believe that reporters, taxpayers, and members of academia will find | ||
this package helpful in monitoring the performance of local assessors | ||
and conducting research. | ||
Assessor’s (CCAO) Data Department. It contains many of the functions necessary | ||
to perform a standard | ||
`sales ratio study <https://www.iaao.org/wp-content/uploads/Standard_on_Ratio_Studies.pdf>`_ | ||
|
||
For assessors, we believe that this package will reduce the complexity of | ||
calculating ratio statistics and detecting sales chasing. We also hope that | ||
reporters, taxpayers, and members of academia will find this package helpful | ||
in monitoring the performance of local assessors and conducting research. | ||
Comment on lines
+25
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This text was out-of-date compared to the README, so just quickly copied it over. |
||
|
||
For detailed documentation on included functions and data, :doc:`visit the | ||
full reference list <reference>`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @jeancochrane, this link is dead, so I updated to the new one.