Repository: electricitymaps/electricitymaps-contrib

Issue:
US-DUK/EIA parser returns data for wrong date if EIA does not have data
Found this obscure error when parsing data for US-DUK. 
Traceback: 

`Traceback (most recent call last):
  File "test_parser.py", line 86, in <module>
    print(test_parser())
  File "/home/rob/anaconda3/envs/contrib/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/rob/anaconda3/envs/contrib/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/rob/anaconda3/envs/contrib/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/rob/anaconda3/envs/contrib/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "test_parser.py", line 49, in test_parser
    res = parser(*args, target_datetime=target_datetime)
  File "/home/rob/tmrow/electricitymap-contrib/parsers/EIA.py", line 120, in fetch_production_mix
    return merge_production_outputs(mixes, zone_key, merge_source='eia.gov')
  File "/home/rob/tmrow/electricitymap-contrib/parsers/ENTSOE.py", line 886, in merge_production_outputs
    axis=1)
  File "/home/rob/anaconda3/envs/contrib/lib/python3.7/site-packages/pandas/core/frame.py", line 3487, in __setitem__
    self._set_item(key, value)
  File "/home/rob/anaconda3/envs/contrib/lib/python3.7/site-packages/pandas/core/frame.py", line 3563, in _set_item
    self._ensure_valid_index(value)
  File "/home/rob/anaconda3/envs/contrib/lib/python3.7/site-packages/pandas/core/frame.py", line 3543, in _ensure_valid_index
    "Cannot set a frame with no defined index "
`

In the case of 'other' production for US-DUK, the EIA data is incomplete (see image) 
![image](https://user-images.githubusercontent.com/13189214/74656288-23707580-518e-11ea-83fd-d24ec16b9412.png)
So when scraping historic data, the eiapy function 'last from' returns the last 24 datapoints that it can get, which is for a date far in the past, then our parser breaks when trying to merge these in ENTSOE.merge_production_outputs 


Discussion:

Resolving patch:
diff --git a/parsers/EIA.py b/parsers/EIA.py
--- a/parsers/EIA.py
+++ b/parsers/EIA.py
@@ -98,6 +98,7 @@ def fetch_production_mix(zone_key, session=None, target_datetime=None, logger=No
         series = PRODUCTION_MIX_SERIES % (REGIONS[zone_key], code)
         mix = _fetch_series(zone_key, series, session=session,
                             target_datetime=target_datetime, logger=logger)
+
         if not mix:
             continue
         for point in mix:
@@ -146,8 +147,9 @@ def _fetch_series(zone_key, series_id, session=None, target_datetime=None,
     if target_datetime:
         utc = tz.gettz('UTC')
         #eia currently only accepts utc timestamps in the form YYYYMMDDTHHZ
-        dt = target_datetime.astimezone(utc).strftime('%Y%m%dT%HZ')
-        raw_data = series.last_from(24, end=dt)
+        end = target_datetime.astimezone(utc).strftime('%Y%m%dT%HZ')
+        start = (target_datetime.astimezone(utc) - datetime.timedelta(days=1)).strftime('%Y%m%dT%HZ')
+        raw_data = series.get_data(start=start, end=end)
     else:
         # Get the last 24 hours available.
         raw_data = series.last(24)


Test patch: