Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global coherence #573

Merged
merged 21 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testmaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
activate-environment: pyleo
environment-file: environment.yml
python-version: "3.10"
python-version: "3.11.0"
auto-activate-base: false

- name: Conda list
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ conda:
environment: doc_build/rtd_env.yml

sphinx:
fail_on_warning: true
fail_on_warning: false

formats: []

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- '3.9'
- '3.11'


before_install:
Expand All @@ -15,7 +15,7 @@ before_install:
- conda info -a

install:
- conda create -n pyleoenv python=3.9
- conda create -n pyleoenv python=3.11
- source activate pyleoenv
- conda install numpy
- conda install -c conda-forge cartopy
Expand Down
10 changes: 7 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cff-version: 0.14.0
cff-version: 1.0.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Khider"
Expand All @@ -23,8 +23,12 @@ authors:
- family-names: "McGibbon"
given-names: "Robert"
orcid: "https://orcid.org/0000-0003-3337-954X"
- family-names: "Voirol"
given-names: "Lionel"
orcid: "https://orcid.org/0000-0003-1696-1407"

title: "Pyleoclim: A Python package for the analysis and visualization of paleoclimate data"
version: v0.14.0
version: v1.0.0
doi: 10.5281/zenodo.1205661
date-released: 2024-02-15
date-released: 2024-06-04
url: "https://github.com/LinkedEarth/Pyleoclim_util"
10 changes: 7 additions & 3 deletions doc_build/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,19 @@
# The full version, including alpha/beta/rc tags.
release = pyleo.__version__


intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
'numpy': ('https://numpy.org/doc/stable', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
'matplotlib': ('https://matplotlib.org/stable', None)
}
intersphinx_disabled_reftypes = ["*"]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -185,7 +190,6 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
6 changes: 6 additions & 0 deletions doc_build/core/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ Coherence (pyleoclim.Coherence)
.. autoclass:: pyleoclim.core.coherence.Coherence
:members:

SpectralCoherence (pyleoclim.GlobalCoherence)
"""""""""""""""""""""""""""""""""""""""""""""""

.. autoclass:: pyleoclim.core.globalcoherence.GlobalCoherence
:members:

Corr (pyleoclim.Corr)
"""""""""""""""""""""

Expand Down
7 changes: 2 additions & 5 deletions doc_build/rtd_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- python=3.11.0
- ipykernel
- pip:
- pip
- cartopy
- seaborn
- matplotlib
- numpy
- pandas
- Sphinx<6.0
- pylint
- chardet
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
name: pyleo
channels:
- default
- conda-forge
dependencies:
- python>=3.10
- python=3.11.0
- cartopy
- numba
- pyyaml
Expand Down
1 change: 1 addition & 0 deletions pyleoclim/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .ensembleseries import EnsembleSeries
from .scalograms import Scalogram, MultipleScalogram
from .coherence import Coherence
from .globalcoherence import GlobalCoherence
from .corr import Corr
from .correns import CorrEns
from .multivardecomp import MultivariateDecomp
Expand Down
6 changes: 2 additions & 4 deletions pyleoclim/core/ensemblegeoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,9 @@ def make_labels(self):
Returns
-------
time_header : str

Label for the time axis

value_header : str

Label for the value axis

'''
Expand Down Expand Up @@ -318,7 +316,7 @@ def dashboard(self, figsize=[11, 8], gs=None, plt_kwargs=None, histplt_kwargs=No
hue='archiveType', marker='archiveType', size=None, scatter_kwargs=None,
gridspec_kwargs=None,
savefig_settings=None):
'''
'''Dashboard that plots the trace, histogram, map, and power spectrum of the ensemble.

Parameters
----------
Expand Down Expand Up @@ -393,7 +391,7 @@ def dashboard(self, figsize=[11, 8], gs=None, plt_kwargs=None, histplt_kwargs=No

See also
--------

pyleoclim.core.series.Series.plot : plot a timeseries

pyleoclim.core.ensembleseries.EnsembleSeries.plot_envelope: Envelope plots for an ensemble
Expand Down
64 changes: 22 additions & 42 deletions pyleoclim/core/ensmultivardecomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,17 @@ def modeplot(self,index=0,flip=False,plot_envelope_kwargs = None, psd_envelope_k

.. jupyter-execute::

n = 3 # number of ensembles
nn = 30 # number of noise realizations
nt = 500
ens_list = []

t,v = pyleo.utils.gen_ts(model='colored_noise',nt=nt,alpha=1.0)
signal = pyleo.Series(t,v)

for _ in range(n):
series_list = []
lat = np.random.randint(-90,90)
lon = np.random.randint(-180,180)
for idx in range(nn): # noise
noise = np.random.randn(nt,nn)*100
ts = pyleo.GeoSeries(time=signal.time, value=signal.value+noise[:,idx], lat=lat, lon=lon, verbose=False)
series_list.append(ts)

ts_ens = pyleo.EnsembleSeries(series_list)
ens_list.append(ts_ens)

mul_ens = pyleo.MulEnsGeoSeries([ts_ens])
n = 100 # number of series

soi = pyleo.utils.load_dataset('SOI')
soi_time_axes = [pyleo.utils.random_time_axis(n=len(soi.time)) for _ in range(n)]
soi_ens = pyleo.EnsembleGeoSeries([pyleo.GeoSeries(time=time, value=soi.value,lat=-5,lon=-85,auto_time_params=True,verbose=False) for time in soi_time_axes])

nino3 = pyleo.utils.load_dataset('NINO3')
nino3_time_axes = [pyleo.utils.random_time_axis(n=len(nino3.time)) for _ in range(n)]
nino3_ens = pyleo.EnsembleGeoSeries([pyleo.GeoSeries(time=time, value=nino3.value,lat=-5,lon=-85,auto_time_params=True,verbose=False) for time in nino3_time_axes])

mul_ens = pyleo.MulEnsGeoSeries([nino3_ens,soi_ens])
mcpca = mul_ens.mcpca(nsim=10,seed=42)
mcpca.modeplot()'''

Expand Down Expand Up @@ -328,27 +318,17 @@ def screeplot(self,clr_eig='C0', linewidth=.3, title='Screeplot', violin_kwargs

.. jupyter-execute::

n = 3 # number of ensembles
nn = 30 # number of noise realizations
nt = 500
ens_list = []

t,v = pyleo.utils.gen_ts(model='colored_noise',nt=nt,alpha=1.0)
signal = pyleo.Series(t,v)

for _ in range(n):
series_list = []
lat = np.random.randint(-90,90)
lon = np.random.randint(-180,180)
for idx in range(nn): # noise
noise = np.random.randn(nt,nn)*100
ts = pyleo.GeoSeries(time=signal.time, value=signal.value+noise[:,idx], lat=lat, lon=lon, verbose=False)
series_list.append(ts)

ts_ens = pyleo.EnsembleSeries(series_list)
ens_list.append(ts_ens)

mul_ens = pyleo.MulEnsGeoSeries([ts_ens])
n = 100 # number of series

soi = pyleo.utils.load_dataset('SOI')
soi_time_axes = [pyleo.utils.random_time_axis(n=len(soi.time)) for _ in range(n)]
soi_ens = pyleo.EnsembleGeoSeries([pyleo.GeoSeries(time=time, value=soi.value,lat=0,lon=0,auto_time_params=True,verbose=False) for time in soi_time_axes])

nino3 = pyleo.utils.load_dataset('NINO3')
nino3_time_axes = [pyleo.utils.random_time_axis(n=len(nino3.time)) for _ in range(n)]
nino3_ens = pyleo.EnsembleGeoSeries([pyleo.GeoSeries(time=time, value=nino3.value,lat=0,lon=0,auto_time_params=True,verbose=False) for time in nino3_time_axes])

mul_ens = pyleo.MulEnsGeoSeries([nino3_ens,soi_ens])
mcpca = mul_ens.mcpca(nsim=10,seed=42)
mcpca.screeplot()'''

Expand Down
Loading
Loading