Skip to content

Commit efbc933

Browse files
authored
Fix: Pandas latest (#159)
* Plot each col in DataFrame individually * Remove numpy and pandas version requirements
1 parent 4821bf0 commit efbc933

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

mhkit/wave/graphics.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ def plot_spectrum(S, ax=None):
3030
assert isinstance(S, pd.DataFrame), 'S must be of type pd.DataFrame'
3131

3232
f = S.index
33-
34-
ax = _xy_plot(f*2*np.pi, S/(2*np.pi), fmt='-', xlabel='omega [rad/s]',
33+
for key in S.keys():
34+
ax = _xy_plot(f*2*np.pi, S[key]/(2*np.pi), fmt='-', xlabel='omega [rad/s]',
3535
ylabel='Spectral density [m$^2$s/rad]', ax=ax)
3636

37-
3837
return ax
3938

4039

@@ -56,8 +55,9 @@ def plot_elevation_timeseries(eta, ax=None):
5655

5756
assert isinstance(eta, pd.DataFrame), 'eta must be of type pd.DataFrame'
5857

59-
ax = _xy_plot(eta.index, eta, fmt='-', xlabel='Time',
60-
ylabel='$\eta$ [m]', ax=ax)
58+
for key in eta.keys():
59+
ax = _xy_plot(eta.index, eta[key], fmt='-', xlabel='Time',
60+
ylabel='$\eta$ [m]', ax=ax)
6161

6262
return ax
6363

@@ -531,12 +531,11 @@ def monthly_cumulative_distribution(J):
531531
for month in months:
532532
plt.semilogx(J.loc[cumSum[month].index], cumSum[month].F, '--',
533533
label=calendar.month_abbr[month])
534-
534+
535535
F = exceedance_probability(J)
536536
F.sort_values('F', inplace=True)
537-
ax = plt.semilogx(J.loc[F.index], 1-F/100, 'k-', fillstyle='none', label='All')
537+
ax = plt.semilogx(J.loc[F.index], 1-F['F']/100, 'k-', fillstyle='none', label='All')
538538

539-
#plt.xlim([1000, 1E6])
540539
plt.grid()
541540
plt.xlabel('Energy Flux')
542541
plt.ylabel('Cumulative Distribution')

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
'Intended Audience :: Science/Research',
1818
'Operating System :: OS Independent',
1919
]
20-
DEPENDENCIES = ['pandas<=1.3.5',
21-
'numpy<1.21.0',
20+
DEPENDENCIES = ['pandas',
21+
'numpy',
2222
'scipy',
2323
'matplotlib',
2424
'requests',

0 commit comments

Comments
 (0)