Skip to content

Commit

Permalink
Some more path-abspath trickery
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Feb 21, 2024
1 parent 15b6eae commit bc67ce7
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions pywt/data/_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def ascent():
>>> plt.show() # doctest: +SKIP
"""
fname = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'ascent.npz')
fname = os.path.abspath(fname)
fname = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ascent.npz')
ascent = np.load(fname)['data']
return ascent

Expand Down Expand Up @@ -72,8 +71,7 @@ def aero():
>>> plt.show() # doctest: +SKIP
"""
fname = os.path.join(os.path.dirname(__file__), 'aero.npz')
fname = os.path.abspath(fname)
fname = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'aero.npz')
aero = np.load(fname)['data']
return aero

Expand Down Expand Up @@ -119,8 +117,7 @@ def camera():
>>> plt.show() # doctest: +SKIP
"""
fname = os.path.join(os.path.dirname(__file__), 'camera.npz')
fname = os.path.abspath(fname)
fname = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'camera.npz')
camera = np.load(fname)['data']
return camera

Expand Down Expand Up @@ -150,8 +147,7 @@ def ecg():
[<matplotlib.lines.Line2D object at ...>]
>>> plt.show() # doctest: +SKIP
"""
fname = os.path.join(os.path.dirname(__file__), 'ecg.npy')
fname = os.path.abspath(fname)
fname = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ecg.npy')
ecg = np.load(fname)
return ecg

Expand Down Expand Up @@ -187,8 +183,7 @@ def nino():
[<matplotlib.lines.Line2D object at ...>]
>>> plt.show() # doctest: +SKIP
"""
fname = os.path.join(os.path.dirname(__file__), 'sst_nino3.npy')
fname = os.path.abspath(fname)
fname = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sst_nino3.npy')
sst_csv = np.load(fname)
# sst_csv = pd.read_csv("http://www.cpc.ncep.noaa.gov/data/indices/ersst4.nino.mth.81-10.ascii", sep=' ', skipinitialspace=True)
# take only full years
Expand Down

0 comments on commit bc67ce7

Please sign in to comment.