Skip to content

Commit

Permalink
updating cross spectral branch (#572)
Browse files Browse the repository at this point in the history
* pin all python versions to 3.11.0 (#567)

* pin all python versions to 3.11.0

* Update .travis.yml

* Update rtd_env.yml

* Update environment.yml

* Update environment.yml

* Update testmaster.yml

* pin to 3.11.0

* Update .readthedocs.yaml (#568)

* Mcpca doc (#570)

* ensemblegeoseries docstring fix

* ensmultivardecomp doc string fix

* mgs docstrings

* ms docstrings

* mvd docstrings

* doc fixes

* tick version (#571)

* tick version

* add requests to setup.py

* verbose doc fix

---------

Co-authored-by: Alexander James <[email protected]>

---------

Co-authored-by: Jordan Landers <[email protected]>
Co-authored-by: Julien Emile-Geay <[email protected]>
  • Loading branch information
3 people authored Jun 4, 2024
1 parent 35c3a4c commit deb4b1c
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 108 deletions.
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
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
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
3 changes: 1 addition & 2 deletions pyleoclim/core/multiplegeoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ def __init__(self, series_list, time_unit=None, label=None):

super().__init__(series_list, time_unit, label)

# ============ MAP goes here ================

def map(self, marker='archiveType', hue='archiveType', size=None, cmap=None,
edgecolor='k', projection='auto',
proj_default=True, crit_dist=5000, colorbar=True,color_scale_type=None,
background=True, borders=False, coastline=True,rivers=False, lakes=False, land=True,ocean=True,
figsize=None, fig=None, scatter_kwargs=None, gridspec_kwargs=None, legend=True, gridspec_slot=None,
lgd_kwargs=None, savefig_settings=None, **kwargs):
'''
'''Mapping of the collection of GeoSeries objects.
Parameters
Expand Down
3 changes: 0 additions & 3 deletions pyleoclim/core/multipleseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,6 @@ def stripes(self, cmap = 'RdBu_r', sat=1.0, ref_period=None,
figsize : list
a list of two integers indicating the figure size (in inches)
sat : float > 0
Controls the saturation of the colormap normalization by scaling the vmin, vmax in https://matplotlib.org/stable/tutorials/colors/colormapnorms.html
default = 1.0
Expand All @@ -1941,15 +1940,13 @@ def stripes(self, cmap = 'RdBu_r', sat=1.0, ref_period=None,
flag indicating whether or not the x-axis should be shown (default = False)
savefig_settings : dictionary
the dictionary of arguments for plt.savefig(); some notes below:
- 'path' must be specified; it can be any existing or non-existing path,
with or without a suffix; if the suffix is not given in 'path', it will follow 'format'
- 'format' can be one of {"pdf", 'eps', 'png', ps'} The default is None.
time_unit : str
the target time unit, possible inputs:
{
'year', 'years', 'yr', 'yrs',
Expand Down
10 changes: 4 additions & 6 deletions pyleoclim/core/multivardecomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,10 @@ def modeplot(self, index=0, figsize=[8, 8], fig=None, savefig_settings=None,gs=N
hue='EOF', marker=None, size=None, scatter_kwargs=None,
flip = False, map_kwargs=None, gridspec_kwargs=None):

''' Dashboard visualizing the properties of a given mode, including:
1. The temporal coefficient (PC or similar)
2. its spectrum
3. The loadings (EOF or similar), possibly geolocated. If the object
does not have geolocation information, a spaghetti plot of the standardized
series is displayed.
'''Dashboard visualizing the properties of a given mode.
Includes: The temporal coefficient (PC or similar), its spectrum, and the loadings (EOF or similar), possibly geolocated.
If the object does not have geolocation information, a spaghetti plot of the standardized series is displayed.
Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions pyleoclim/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def to_csv(self, metadata_header=True, path = None):
-------
None
See Also
See also
--------
pyleoclim.Series.from_csv
Expand Down Expand Up @@ -513,7 +513,7 @@ def from_csv(cls, path):
Series
pyleoclim Series object containing data and metadata.
See Also
See also
--------
pyleoclim.Series.to_csv
Expand Down
49 changes: 20 additions & 29 deletions pyleoclim/utils/causality.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,24 +115,22 @@ def liang_causality(y1, y2, npt=1, signif_test='isospec', nsim=1000,
Returns
-------
res : dict
A dictionary of results including:
- T21 : float
information flow from y2 to y1 (Note: not y1 -> y2!)
- tau21 : float
the standardized information flow from y2 to y1
- Z : float
the total information flow from y2 to y1
- dH1_star : float
dH*/dt (Liang, 2016)
- dH1_noise : float
- signif_qs :
the quantiles for significance test
- T21_noise : list
the quantiles of the information flow from noise2 to noise1 for significance testing
- tau21_noise : list
the quantiles of the standardized information flow from noise2 to noise1 for significance testing
- T21 : float
information flow from y2 to y1 (Note: not y1 -> y2!)
- tau21 : float
the standardized information flow from y2 to y1
- Z : float
the total information flow from y2 to y1
- dH1_star : float
dH*/dt (Liang, 2016)
- dH1_noise : float
- signif_qs :
the quantiles for significance test
- T21_noise : list
the quantiles of the information flow from noise2 to noise1 for significance testing
- tau21_noise : list
the quantiles of the standardized information flow from noise2 to noise1 for significance testing
See also
--------
Expand Down Expand Up @@ -262,18 +260,13 @@ def liang(y1, y2, npt=1):
Returns
-------
res : dict
A dictionary of results including:
- T21 : float
information flow from y2 to y1 (Note: not y1 -> y2!)
- tau21 : float
the standardized information flow from y2 to y1
- Z : float
the total information flow from y2 to y1
- dH1_star : float
dH*/dt (Liang, 2016)
- dH1_noise : float
- T21 (float): information flow from y2 to y1 (Note: not y1 -> y2!)
- tau21 (float): the standardized information flow from y2 to y1
- Z (float): the total information flow from y2 to y1
- dH1_star (float): dH*/dt (Liang, 2016)
- dH1_noise (float)
See also
--------
Expand Down Expand Up @@ -464,9 +457,7 @@ def signif_isospec(y1, y2, method,
Returns
-------
res_dict : dict
A dictionary with the following information:
- T21_noise_qs : list
the quantiles of the information flow from noise2 to noise1 for significance testing
- tau21_noise_qs : list
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

version = '0.14.1b0'
version = '1.0.0'

# Read the readme file contents into variable
def read(fname):
Expand Down Expand Up @@ -42,8 +42,9 @@ def read(fname):
"Unidecode>=1.1.1",
"cartopy>=0.22.0",
"pyyaml",
"beautifulsoup4",
"scipy",
"beautifulsoup4",
"scipy",
"requests",
],
python_requires=">=3.9.0"
python_requires=">=3.9",
)

0 comments on commit deb4b1c

Please sign in to comment.