Skip to content

Commit

Permalink
Doc fixes format (#560)
Browse files Browse the repository at this point in the history
* standardize header formatting

* fix queries

* update seaborn requirement

* bug fix in screeplot

---------

Co-authored-by: Alexander James <[email protected]>
  • Loading branch information
jordanplanders and alexkjames authored Jun 1, 2024
1 parent ff54d30 commit 8423565
Show file tree
Hide file tree
Showing 29 changed files with 104 additions and 405 deletions.
8 changes: 1 addition & 7 deletions pyleoclim/core/coherence.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ def plot(self, var='wtc', xlabel=None, ylabel=None, title='auto', figsize=[10, 8
Returns
-------
fig, ax
See also
Expand Down Expand Up @@ -428,7 +427,6 @@ def dashboard(self, title=None, figsize=[9,12], overlap = True, phase_style = {}
Parameters
----------
title : str, optional
Title of the plot. The default is None.
Expand Down Expand Up @@ -473,11 +471,11 @@ def dashboard(self, title=None, figsize=[9,12], overlap = True, phase_style = {}
Returns
-------
fig, ax
See also
--------
pyleoclim.core.coherence.Coherence.plot : creates a coherence plot
pyleoclim.core.series.Series.wavelet_coherence : computes the coherence between two timeseries.
Expand Down Expand Up @@ -590,7 +588,6 @@ def signif_test(self, number=200, method='ar1sim', seed=None, qs=[0.95], setting
Parameters
----------
number : int, optional
Number of surrogate series to create for significance testing. The default is 200.
Expand Down Expand Up @@ -619,7 +616,6 @@ def signif_test(self, number=200, method='ar1sim', seed=None, qs=[0.95], setting
Returns
-------
new : pyleoclim.core.coherence.Coherence
original Coherence object augmented with significance levels signif_qs,
Expand Down Expand Up @@ -784,7 +780,6 @@ def phase_stats(self, scales, number=1000, level=0.05):
Parameters
----------
scales : float
scale at which to evaluate the phase angle
Expand All @@ -800,7 +795,6 @@ def phase_stats(self, scales, number=1000, level=0.05):
Returns
-------
result : dict
contains angle_mean (the mean angle for those scales), sigma (the
Expand Down
1 change: 0 additions & 1 deletion pyleoclim/core/corr.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class Corr:
Parameters
----------
r: float
the correlation coefficient
Expand Down
2 changes: 0 additions & 2 deletions pyleoclim/core/correns.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class CorrEns:
Parameters
----------
r: list
the list of correlation coefficients
Expand Down Expand Up @@ -134,7 +133,6 @@ def plot(self, figsize=[4, 4], title=None, ax=None, savefig_settings=None, hist_
Parameters
----------
figsize : list, optional
The figure size. The default is [4, 4].
Expand Down
5 changes: 0 additions & 5 deletions pyleoclim/core/ensemblegeoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def from_AgeEnsembleArray(self, geo_series, age_array, value_depth = None, age_d
Parameters
----------
geo_series : pyleoclim.core.geoseries.GeoSeries
A Series object with the values to be mapped
Expand All @@ -151,7 +150,6 @@ def from_AgeEnsembleArray(self, geo_series, age_array, value_depth = None, age_d
Returns
-------
EnsembleSeries : pyleoclim.core.ensembleseries.EnsembleSeries
The ensemble created using the time axes from age_array and the values from series.
Expand Down Expand Up @@ -282,7 +280,6 @@ def make_labels(self):
Returns
-------
time_header : str
Label for the time axis
Expand Down Expand Up @@ -325,7 +322,6 @@ def dashboard(self, figsize=[11, 8], gs=None, plt_kwargs=None, histplt_kwargs=No
Parameters
----------
figsize : list or tuple, optional
Figure size. The default is [11,8].
Expand Down Expand Up @@ -389,7 +385,6 @@ def dashboard(self, figsize=[11, 8], gs=None, plt_kwargs=None, histplt_kwargs=No
Returns
-------
fig : matplotlib.figure
The figure
Expand Down
16 changes: 0 additions & 16 deletions pyleoclim/core/ensembleseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def from_AgeEnsembleArray(self, series, age_array, value_depth = None, age_depth
Parameters
----------
series : pyleoclim.core.series.Series
A Series object with the values to be mapped
Expand All @@ -70,7 +69,6 @@ def from_AgeEnsembleArray(self, series, age_array, value_depth = None, age_depth
Returns
-------
EnsembleSeries : pyleoclim.core.ensembleseries.EnsembleSeries
The ensemble created using the time axes from age_array and the values from series.
Expand Down Expand Up @@ -173,7 +171,6 @@ def make_labels(self):
Returns
-------
time_header : str
Label for the time axis
Expand Down Expand Up @@ -212,7 +209,6 @@ def slice(self, timespan):
Parameters
----------
timespan : tuple or list
The list of time points for slicing, whose length must be even.
When there are n time points, the output Series includes n/2 segments.
Expand All @@ -221,7 +217,6 @@ def slice(self, timespan):
Returns
-------
new : EnsembleSeries
The sliced EnsembleSeries object.
Expand Down Expand Up @@ -268,7 +263,6 @@ def quantiles(self, qs=[0.05, 0.5, 0.95], axis = 'value'):
Parameters
----------
qs : list, optional
List of quantiles to consider for the calculation. The default is [0.05, 0.5, 0.95].
Expand All @@ -279,7 +273,6 @@ def quantiles(self, qs=[0.05, 0.5, 0.95], axis = 'value'):
Returns
-------
ens_qs : EnsembleSeries
EnsembleSeries object containing empirical quantiles of original
Expand Down Expand Up @@ -385,7 +378,6 @@ def correlation(self, target=None, timespan=None, alpha=0.05, method = 'ttest',
Parameters
----------
target : Series or EnsembleSeries
A pyleoclim Series object or EnsembleSeries object.
Expand Down Expand Up @@ -437,7 +429,6 @@ def correlation(self, target=None, timespan=None, alpha=0.05, method = 'ttest',
Returns
-------
corr_ens : CorrEns
The resulting object, see pyleoclim.CorrEns
Expand Down Expand Up @@ -541,7 +532,6 @@ def plot_traces(self, figsize=[10, 4], xlabel=None, ylabel=None, title=None, num
Parameters
----------
figsize : list, optional
The figure size. The default is [10, 4].
Expand Down Expand Up @@ -611,7 +601,6 @@ def plot_traces(self, figsize=[10, 4], xlabel=None, ylabel=None, title=None, num
Returns
-------
fig : matplotlib.figure
the figure object from matplotlib
Expand Down Expand Up @@ -705,7 +694,6 @@ def plot_envelope(self, figsize=[10, 4], qs=[0.025, 0.25, 0.5, 0.75, 0.975],
Parameters
----------
figsize : list, optional
The figure size. The default is [10, 4].
Expand Down Expand Up @@ -779,7 +767,6 @@ def plot_envelope(self, figsize=[10, 4], qs=[0.025, 0.25, 0.5, 0.75, 0.975],
Returns
-------
fig : matplotlib.figure
the figure object from matplotlib
Expand Down Expand Up @@ -883,7 +870,6 @@ def stackplot(self, figsize=[5, 15], savefig_settings=None, xlim=None, fill_bet
Parameters
----------
figsize : list
Size of the figure.
Expand Down Expand Up @@ -946,7 +932,6 @@ def stackplot(self, figsize=[5, 15], savefig_settings=None, xlim=None, fill_bet
Returns
-------
fig : matplotlib.figure
the figure object from matplotlib
Expand Down Expand Up @@ -1108,7 +1093,6 @@ def histplot(self, figsize=[10, 4], title=None, savefig_settings=None,
Parameters
----------
figsize : list, optional
The size of the figure. The default is [10, 4].
Expand Down
6 changes: 1 addition & 5 deletions pyleoclim/core/ensmultivardecomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def modeplot(self,index=0,flip=False,plot_envelope_kwargs = None, psd_envelope_k
Parameters
----------
index : int
The 1-based index of the mode to visualize.
Default is 1, corresponding to the first mode.
Expand Down Expand Up @@ -110,7 +109,6 @@ def modeplot(self,index=0,flip=False,plot_envelope_kwargs = None, psd_envelope_k
Returns
-------
fig : matplotlib.figure
The figure
Expand Down Expand Up @@ -291,7 +289,6 @@ def screeplot(self,clr_eig='C0', linewidth=.3, title='Screeplot', violin_kwargs
Parameters
----------
quantiles : list,array
Quantiles to use for plotting range of pctvar for each mode.
Expand Down Expand Up @@ -320,7 +317,6 @@ def screeplot(self,clr_eig='C0', linewidth=.3, title='Screeplot', violin_kwargs
Returns
-------
fig : matplotlib.figure
The figure
Expand Down Expand Up @@ -382,7 +378,7 @@ def screeplot(self,clr_eig='C0', linewidth=.3, title='Screeplot', violin_kwargs
if 'linewidth' in violin_kwargs.keys():
linewidth = violin_kwargs.pop('linewidth')

sns.violinplot(data=df,x='Mode',y='Pctvar',linewidth=linewidth,color=clr_eig,figsize=(8,8),ax=ax,**violin_kwargs)
sns.violinplot(data=df,x='Mode',y='Pctvar',linewidth=linewidth,color=clr_eig,ax=ax,**violin_kwargs)
ax.set_xlabel(r'Mode index $i$')
ax.set_ylabel(r'$\lambda_i$')

Expand Down
12 changes: 3 additions & 9 deletions pyleoclim/core/geoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class GeoSeries(Series):
Parameters
----------
time : list or numpy.array
independent variable (t)
Expand Down Expand Up @@ -276,7 +275,6 @@ def map(self, projection='Orthographic', proj_default=True,
Parameters
----------
projection : str, optional
The projection to use. The default is 'Orthographic'.
Expand Down Expand Up @@ -348,7 +346,6 @@ def map(self, projection='Orthographic', proj_default=True,
Returns
-------
res : fig,ax_d
See also
Expand Down Expand Up @@ -445,7 +442,6 @@ def map_neighbors(self, mgs, radius=3000, projection='Orthographic', proj_defaul
Returns
-------
res : fig,ax_d
See also
Expand All @@ -461,7 +457,7 @@ def map_neighbors(self, mgs, radius=3000, projection='Orthographic', proj_defaul
from pylipd.utils.dataset import load_dir
lipd = load_dir(name='Pages2k')
df = lipd.get_timeseries_essentials()
dfs = df.query("archiveType in ('Wood','Documents','Coral','Lake sediment') and paleoData_variableName not in ('year')")
dfs = df.query("archiveType in ('tree','documents','coral','lake sediment') and paleoData_variableName not in ('year')")
# place in a MultipleGeoSeries object
ts_list = []
for _, row in dfs.iterrows():
Expand Down Expand Up @@ -518,7 +514,6 @@ def dashboard(self, figsize=[11, 8], gs=None, plt_kwargs=None, histplt_kwargs=No
Parameters
----------
figsize : list or tuple, optional
Figure size. The default is [11,8].
Expand Down Expand Up @@ -585,7 +580,6 @@ def dashboard(self, figsize=[11, 8], gs=None, plt_kwargs=None, histplt_kwargs=No
Returns
-------
fig : matplotlib.figure
The figure
Expand Down Expand Up @@ -752,7 +746,6 @@ def segment(self, factor=10, verbose = False):
Parameters
----------
factor : float
The factor that adjusts the threshold for gap detection
Expand All @@ -761,20 +754,21 @@ def segment(self, factor=10, verbose = False):
Returns
-------
res : MultiplegGeoSeries or GeoSeries
If gaps were detected, returns the segments in a MultipleGeoSeries object,
else, returns the original timeseries.
Examples
--------
.. jupyter-execute::
import numpy as np
gs = pyleo.utils.datasets.load_dataset('EDC-dD')
gs.value[4000:5000] = np.nan # cut a large gap in the middle
mgs = gs.segment()
mgs.plot()
"""
from ..core.multiplegeoseries import MultipleGeoSeries
seg_y, seg_t, n_segs = tsutils.ts2segments(self.value,self.time,factor=factor)
Expand Down
2 changes: 0 additions & 2 deletions pyleoclim/core/mulensgeoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def mcpca(self,nsim=1000, seed=None, common_time_kwargs=None, pca_kwargs=None,al
Parameters
----------
nsim : int
Number of simulations to carry out. Default is 1000
Expand Down Expand Up @@ -50,7 +49,6 @@ def mcpca(self,nsim=1000, seed=None, common_time_kwargs=None, pca_kwargs=None,al
Returns
-------
EnsembleMvD : pyleo.EnsMultivarDecomp
Ensemble Multivariate Decomposition object
Expand Down
Loading

0 comments on commit 8423565

Please sign in to comment.