edgi-govdata-archiving / ECHO_modules

ECHO_modules is a Python package for analyzing a copy of the US Environmental Protection Agency's (EPA) Enforcement and Compliance History Online (ECHO) database
GNU General Public License v3.0
3 stars 6 forks source link

consistency in geography selections #73

Open ericnost opened 10 months ago

ericnost commented 10 months ago

Generally, there are two ways to select a geography of interest:

  1. manually writing it out in code
    from ECHO_modules.make_data_sets import make_data_sets # Import relevant module
    ds = make_data_sets(["RCRA Violations"]) # Create a DataSet for handling the data
    erie_rcra_violations = ds["RCRA Violations"].store_results(region_type="County", region_value=["ERIE"], state="NY")
  2. using the region widgets

Ultimately, our functions expect different geographies to be formatted differently. For instance, counties must be in lists in order for the get_facs_in_counties function to work. Because of the region input widget, zip codes and watersheds must be formatted as strings like '52358,53703' although passing that string to get_spatial_data won't work because it expects a list.