Import economic data for testing.
()
| 26 | |
| 27 | |
| 28 | def setup_data(): |
| 29 | """Import economic data for testing.""" |
| 30 | with open(os.path.join(rootpath, "us-counties.json")) as f: |
| 31 | get_id = json.load(f) |
| 32 | |
| 33 | county_codes = [x["id"] for x in get_id["features"]] |
| 34 | county_df = pd.DataFrame({"FIPS_Code": county_codes}, dtype=str) |
| 35 | |
| 36 | # Read into Dataframe, cast to string for consistency. |
| 37 | df = pd.read_csv(os.path.join(rootpath, "us_county_data.csv"), na_values=[" "]) |
| 38 | df["FIPS_Code"] = df["FIPS_Code"].astype(str) |
| 39 | |
| 40 | # Perform an inner join, pad NA's with data from nearest county. |
| 41 | merged = pd.merge(df, county_df, on="FIPS_Code", how="inner") |
| 42 | return merged.fillna(method="pad") |
| 43 | |
| 44 | |
| 45 | def test_location_args(): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…