pysat / pysatCDF

Python reader for NASA CDF file format
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

BUG: epoch referenced before assignment #48

Open jklenzing opened 1 year ago

jklenzing commented 1 year ago

Description

When loading some cdf datasets, pysatCDF may reference epoch before it is assigned.

To Reproduce this bug:

import pysat 
import pysatNASA

vefi = pysat.Instrument('de2', 'vefi')
vefi.load(1983, 1)

yields

        # all of the data left over is 1D, add as Series
>       data = pandas.DataFrame(cdata, index=epoch)
E       UnboundLocalError: local variable 'epoch' referenced before assignment

../pysatCDF/pysatCDF/_cdf.py:686: UnboundLocalError

Test configuration

Additional context

Found while working on https://github.com/pysat/pysatNASA/pull/155

jklenzing commented 1 year ago

According to GitHub Actions, this succeeds on windows, but fails on ubuntu / mac