HARPgroup / USGS_Consumptive_Use

This repository is intended to hold code, documentation, and tutorials for the USGS Consumptive Use Project run through Dr. Julie Shortridge and Dr. Durelle Scott of Virginia Tech as well as Robert Burgholzer and Joseph Kleiner of the Virginia Department of Environmental Quality
3 stars 0 forks source link

matched_switch() function to prevent duplicate facilities #79

Closed rburghol closed 4 years ago

rburghol commented 4 years ago

@jdkleiner and @jdkleiner - the matched_switch() function is farther down the code, and it is intended to prevent duplicate facilities from a list of facilities that Morgan compiled that had certain matches -- i.e., all power plants and then a select group of larger commercial facilities (maybe others?).

Anyhow, I am thinking that this needs to be done before we create a facility, in other words, matched_switch() function should be called up in the create loop in lines 140-200 right before we call "facility_REST()".

Before I do that I wanted to ask: Did you all stick some other code in there that already checks this list before creating a facility?

jmineva commented 4 years ago

@rburghol We do not have a check for these VAHydro facilities.

I'm wondering if it even needs to be its own function. Could we just include a check for the facility in the facility_REST() function?

rburghol commented 4 years ago

Awesome. The only issue with facility_REST() is then we make that more multi-purpose than I would prefer, but I will try to make it straightforward and clean (and quick). Thanks for the quick review and algorithm thoughts.

rburghol commented 4 years ago

This function also sets a number of data frames that are used later on, so don't think it can be disposed of just yet.

rburghol commented 4 years ago

This has been moved into a separate function to be run before using the standard function to add an ECHO facility via REST.