edgi-govdata-archiving / ECHO-Cross-Program

Jupyter Notebooks for ECHO that use data from multiple EPA programs
https://colab.research.google.com/github/edgi-govdata-archiving/ECHO-Cross-Program/blob/master/ECHO-Cross-Programs.ipynb
GNU General Public License v3.0
8 stars 5 forks source link

"County" failing to load Cell 5 results #138

Closed Frijol closed 2 years ago

Frijol commented 2 years ago

Notebook: https://colab.research.google.com/github/edgi-govdata-archiving/ECHO-Cross-Program/blob/main/ECHO-Cross-Programs.ipynb#scrollTo=tGG4dLXuaRLN

Cell 5

To reproduce: County > AK > Yakutat > Run cell 5

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-20-9fb48d8c866c> in <module>()
     13     df_violators = get_top_violators( df_active, 'AIR_FLAG',  
     14             'CAA_3YR_COMPL_QTRS_HISTORY', 'CAA_FORMAL_ACTION_COUNT', 20 )
---> 15     display( chart_top_violators( df_violators, state, regions_selected, 'CAA' ))
     16 
     17     df_violators = get_top_violators( df_active, 'NPDES_FLAG',  

/content/ECHO_modules/utilities.py in chart_top_violators(ranked, state, selections, epa_pgm)
    628     if ( len(values) == 0 ):
    629         return "No {} facilities with non-compliant quarters in {} - {}".format(
--> 630             epa_pgm, state, str( cd ))
    631     sns.set(style='whitegrid')
    632     fig, ax = plt.subplots(figsize=(10,10))

NameError: name 'cd' is not defined
shansen5 commented 2 years ago

Fixed in ECHO_modules/utilities.py. No facilities in the selected regions was hitting a line of code with a mis-named variable.