From 2f373d4a6a92676d0655484ef688b924a6627e11 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 16:34:08 -0300 Subject: [PATCH 1/9] build docs --- .travis.yml | 33 ++++++++++++++++++++ github_deploy_key_pyoceans_python_oceans.enc | 1 + 2 files changed, 34 insertions(+) create mode 100644 github_deploy_key_pyoceans_python_oceans.enc diff --git a/.travis.yml b/.travis.yml index 54bdbae..3430626 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: minimal sudo: false +env: + global: + - secure: "c1HxpvYvasSjycR2iejkLxtlFzMvR8Gmf2GQDPJfIkEftQGvXOt+m91Wy26e819eHeXiQUuoNQwnp6RgOW8woNrlqfro4GX6pgLZlmr4K5Plum1KLa/xs8wk+bN/XpgRbcOqwAFbWfoPbfbm3oP1/QoFiwT38KbGWONlYVGKlKM=" + matrix: fast_finish: true include: @@ -9,6 +13,8 @@ matrix: env: TEST_TARGET=default PY=3.7 - python: coding_standards env: TEST_TARGET=coding_standards PY=3.7 + - name: docs + env: TEST_TARGET=docs PY=3.7 before_install: - wget http://bit.ly/miniconda -O miniconda.sh @@ -36,3 +42,30 @@ script: - if [[ $TEST_TARGET == 'coding_standards' ]]; then flake8 --max-line-length=105 oceans --exclude=_version.py ; fi + + - if [[ $TEST_TARGET == 'docs' ]]; then + set -e ; + conda install doctr ; + pushd docs ; + make clean html linkcheck ; + popd ; + python -m doctr deploy --built-docs ; + fi + +doctr: + require-master: true + sync: False + +deploy: + skip_cleanup: true + provider: pypi + user: ocefpaf + password: + secure: "BdJc76Z+DnmmamZSX+QCGZDnf+FW/JQOnVZ2t59r2r2RM4860Wf6GSL/Ncw6v8G3sOghWQcMzFdY5e6aNzAW0Ddm2YKHAsfxgurbEsnlzwsNPBWv2280ca7TtlFk2JkqhtYQOkoBFbA8+e/lC8ZC6aAVffQAT1NE4lEs0/Jd+TA=" + distributions: sdist bdist_wheel + upload_docs: no + on: + repo: pyoceans/oceans + tags: true + all_branches: master + condition: '$TEST_TARGET == "default"' diff --git a/github_deploy_key_pyoceans_python_oceans.enc b/github_deploy_key_pyoceans_python_oceans.enc new file mode 100644 index 0000000..901b6dc --- /dev/null +++ b/github_deploy_key_pyoceans_python_oceans.enc @@ -0,0 +1 @@ +gAAAAABb3JaWUyL3b2EjiV-1cM2kDAVwQfafXjaooKIj1QC5h4FsnMuYV3w11dr-PtLRMX48mWk3PWVYsxJ7oMrdWepoR28MktxIVd0SRmgPTgL_LBdvRdLErrudGN6jvZANKj6hPrfc7upnMsQ5SdB44E5mi79Rqh-Ktcn23JLqKcbROzGkb-dPMryjVIHQ3F2iwHBPpamgzauJGxkFErIiDh_lH6CQJCVmW_8EhyTKpOKTcARIsXcJl9kYBaxdws6aSvHsGfrl_3XabicI0Zlq4vxsNBh3FBt_lNU18u_zDFWOHcKPWX4bn4R8dm0ujv6PtYejgVShTwy68dbobmHWnIl-igDprayk_x4qAQN8qj3orbt8dAjDTHgggGmrk81OTzP38r1djq8muGhdAFXg8P1J1-mJxXG-cWNVkn1TC9PTBlmw5wquT5Xf3iRnDTP6Wjj9Dn2i5xG4W9kNgZJ6TT_v69E5KNiDYBcj0ka-gGz8iEVJ-6-EJChXAD2QlwChOv332Jd0ZRt-9ZP1gYNAyd2M3PHlPQn88m359Si5xmra_sjZ1VidDN8vXlQ_XFjhMR9e02PIyrib6SBTUs-SfpiiiJ8GVyyvCWm1FhlhZEGWPGtcWxMxPbad32SeB6i__O1E2SVcPO1e1g-ZgINvRnz-rQK3DVx_hwLfn0WRWViJzPS7eoepEx9AlWurW_IuFJoOcA8RyfzuhpisGKju42neSGS98GkDvsoGYDGsDYf6uMKhMoPcuLbZQBzX3KexO3zc1oqkSTDGg54ubqfQG0MgcZuwiJVJPMTLF8CWhV0daGPvtvkhOgiGxDuxbgV_3zKOWmojhVpoYS6XdFCgIR7lt2zdDuDFm-JnPcqxLVDOLMKI1xRxs0Ac_vwIGBcLm1PsCYVtRpIUwX8dehRGyntZ9tM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_UygBxEg3qQa7mLn7MRg20LeEwdBmdLL3FMYdTJjxcY5unlZ2p_D14d4G48V6_jKPOnvOdpNj-dk5i-Fkyu4sCtBg4S0iPBj2_c_dRKM2-R9Wb9aO9-XTz4n3A5ZFO6O7gmI8erM7AvsP-Lv3HlFDC4fIfZOX5FeER3VinyT8__QmUTwZEXRRcwUWq_lWLuQSPJDd2vAM0BDJmUoiGas5Oh0dQnSgqZtTsNGltoosWHqzACsdW-XIj9uBcTZf_fjgUQz4ejNxNYvhulXSRNcZbdg6joVGEEa5sxu0N-kOlJPCUnnAU4vQMcw== \ No newline at end of file From fb2546e7bf361d51681f79a40278285d6165e726 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 16:34:33 -0300 Subject: [PATCH 2/9] no relative imports --- oceans/RPSstuff/__init__.py | 38 -------------------------- oceans/__init__.py | 22 --------------- oceans/colormaps/__init__.py | 6 ----- oceans/datasets/__init__.py | 17 ------------ oceans/datasets/datasets.py | 4 +-- oceans/filters/__init__.py | 21 --------------- oceans/ocfis/__init__.py | 50 ----------------------------------- oceans/plotting/__init__.py | 17 ------------ oceans/sandbox/__init__.py | 11 -------- oceans/sw_extras/__init__.py | 47 -------------------------------- oceans/sw_extras/sw_extras.py | 2 -- 11 files changed, 2 insertions(+), 233 deletions(-) diff --git a/oceans/RPSstuff/__init__.py b/oceans/RPSstuff/__init__.py index 06711d1..e69de29 100644 --- a/oceans/RPSstuff/__init__.py +++ b/oceans/RPSstuff/__init__.py @@ -1,38 +0,0 @@ -""" -Miscellaneous tools from Rich Signell's RPSstuff (matlab) -========================================================= - -""" - -from .RPSstuff import ( - angled, - coast2bln, - fixcoast, - gregorian, - h2hms, - hms2h, - jdmat2jdrps, - jdrps2jdmat, - julian, - ms2hms, - near, - s2hms, - ss2, -) - - -__all__ = [ - angled, - coast2bln, - fixcoast, - gregorian, - h2hms, - hms2h, - jdmat2jdrps, - jdrps2jdmat, - julian, - ms2hms, - near, - s2hms, - ss2, -] diff --git a/oceans/__init__.py b/oceans/__init__.py index 11384ed..0a9a203 100644 --- a/oceans/__init__.py +++ b/oceans/__init__.py @@ -1,25 +1,3 @@ -from . import ( - RPSstuff, - colormaps, - datasets, - filters, - ocfis, - plotting, - sw_extras, -) - - -__all__ = [ - RPSstuff, - colormaps, - datasets, - filters, - ocfis, - plotting, - sw_extras, -] - - from ._version import get_versions # noqa __version__ = get_versions()['version'] del get_versions diff --git a/oceans/colormaps/__init__.py b/oceans/colormaps/__init__.py index d0b4d49..e69de29 100644 --- a/oceans/colormaps/__init__.py +++ b/oceans/colormaps/__init__.py @@ -1,6 +0,0 @@ -from .colormaps import cm, get_color - -__all__ = [ - cm, - get_color, -] diff --git a/oceans/datasets/__init__.py b/oceans/datasets/__init__.py index 521efea..e69de29 100644 --- a/oceans/datasets/__init__.py +++ b/oceans/datasets/__init__.py @@ -1,17 +0,0 @@ -from .datasets import ( - etopo_subset, - get_depth, - get_isobath, - woa_profile, - woa_subset, -) - - -__all__ = [ - 'etopo_subset', - 'get_depth', - 'get_isobath', - 'woa_profile', - 'woa_subset', - 'get_gebco15', - ] diff --git a/oceans/datasets/datasets.py b/oceans/datasets/datasets.py index aea59a5..ba19133 100644 --- a/oceans/datasets/datasets.py +++ b/oceans/datasets/datasets.py @@ -4,8 +4,8 @@ import numpy as np -from ..RPSstuff import near -from ..ocfis import get_profile, wrap_lon180 +from oceans.RPSstuff import near +from oceans.ocfis import get_profile, wrap_lon180 def _woa_variable(variable): diff --git a/oceans/filters/__init__.py b/oceans/filters/__init__.py index a07e7fa..e69de29 100644 --- a/oceans/filters/__init__.py +++ b/oceans/filters/__init__.py @@ -1,21 +0,0 @@ -from .filters import ( - fft_lowpass, - lanc, - md_trenberth, - medfilt1, - pl33tn, - smoo1, - smoo2, - weim, -) - -__all__ = [ - fft_lowpass, - lanc, - md_trenberth, - medfilt1, - pl33tn, - smoo1, - smoo2, - weim, -] diff --git a/oceans/ocfis/__init__.py b/oceans/ocfis/__init__.py index d64e5a2..e69de29 100644 --- a/oceans/ocfis/__init__.py +++ b/oceans/ocfis/__init__.py @@ -1,50 +0,0 @@ -from .ocfis import ( - alphanum_key, - bin_dates, - binave, - binavg, - cart2pol, - complex_demodulation, - del_eta_del_x, - despike, - get_profile, - lagcorr, - mld, - pcaben, - pol2cart, - series_spline, - shiftdim, - spdir2uv, - spec_rot, - strip_mask, - uv2spdir, - wrap_lon180, - wrap_lon360, -) -from .synop import scaloa - - -__all__ = [ - alphanum_key, - bin_dates, - binave, - binavg, - cart2pol, - complex_demodulation, - del_eta_del_x, - despike, - get_profile, - lagcorr, - mld, - pcaben, - pol2cart, - scaloa, - series_spline, - shiftdim, - spdir2uv, - spec_rot, - strip_mask, - uv2spdir, - wrap_lon180, - wrap_lon360, -] diff --git a/oceans/plotting/__init__.py b/oceans/plotting/__init__.py index bbf59f0..e69de29 100644 --- a/oceans/plotting/__init__.py +++ b/oceans/plotting/__init__.py @@ -1,17 +0,0 @@ -from .plotting import ( - EditPoints, - compass, - get_pointsxy, - landmask, - level_colormap, - stick_plot, -) - -__all__ = [ - EditPoints, - compass, - get_pointsxy, - landmask, - level_colormap, - stick_plot, -] diff --git a/oceans/sandbox/__init__.py b/oceans/sandbox/__init__.py index 3892228..e69de29 100644 --- a/oceans/sandbox/__init__.py +++ b/oceans/sandbox/__init__.py @@ -1,11 +0,0 @@ -from .lines import ( - LineCurvature2D, - LineNormals2D, - inverse3, -) - -__all__ = [ - LineCurvature2D, - LineNormals2D, - inverse3, -] diff --git a/oceans/sw_extras/__init__.py b/oceans/sw_extras/__init__.py index b2f5726..e69de29 100644 --- a/oceans/sw_extras/__init__.py +++ b/oceans/sw_extras/__init__.py @@ -1,47 +0,0 @@ -from .gamma_GP_from_SP_pt import gamma_GP_from_SP_pt -from .sw_extras import ( - N, - cor_beta, - cph, - cr_depth, - inertial_period, - kdpar, - photic_depth, - psu2ppt, - richnumb, - shear, - sigma_t, - sigmatheta, - soundspeed, - spice, - strat_period, - tcond, - visc, - zmld_boyer, - zmld_so, -) -from .waves import Waves - -__all__ = [ - N, - Waves, - cor_beta, - cph, - cr_depth, - gamma_GP_from_SP_pt, - inertial_period, - kdpar, - photic_depth, - psu2ppt, - richnumb, - shear, - sigma_t, - sigmatheta, - soundspeed, - spice, - strat_period, - tcond, - visc, - zmld_boyer, - zmld_so, -] diff --git a/oceans/sw_extras/sw_extras.py b/oceans/sw_extras/sw_extras.py index 8d2a4b3..0bfd34d 100644 --- a/oceans/sw_extras/sw_extras.py +++ b/oceans/sw_extras/sw_extras.py @@ -4,8 +4,6 @@ """ -from __future__ import (absolute_import, division, print_function) - from copy import copy import numpy as np From ff3fc4e3f32e126ea3688554935bc2e76d6a8cc4 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 16:34:53 -0300 Subject: [PATCH 3/9] doc tools --- requirements-dev.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 65e4366..ec02f5d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ cartopy +doctr flake8 flake8-builtins flake8-comprehensions @@ -7,7 +8,9 @@ flake8-mutable flake8-print flake8-quotes iris +nbsphinx netcdf4 pandas pytest scipy +sphinx From fa895cac0fedb85660a40b735c41d9d673dc99ff Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 17:19:12 -0300 Subject: [PATCH 4/9] no __init__ --- oceans/{RPSstuff => }/RPSstuff.py | 0 oceans/RPSstuff/__init__.py | 0 oceans/{colormaps => }/cmap_data/cbathy.dat | 0 oceans/{colormaps => }/cmap_data/coolavhrrmap.dat | 0 oceans/{colormaps => }/cmap_data/ctopo.dat | 0 oceans/{colormaps => }/cmap_data/odv.dat | 0 oceans/{colormaps => }/cmap_data/redblue_dark.dat | 0 oceans/{colormaps => }/cmap_data/redblue_light.dat | 0 oceans/{colormaps => }/cmap_data/redgreen.dat | 0 oceans/{colormaps => }/cmap_data/rscolmap.dat | 0 oceans/{colormaps => }/colormaps.py | 0 oceans/colormaps/__init__.py | 0 oceans/{datasets => }/datasets.py | 0 oceans/datasets/__init__.py | 0 oceans/{filters => }/filters.py | 0 oceans/filters/__init__.py | 0 oceans/{ocfis => }/ocfis.py | 0 oceans/ocfis/__init__.py | 0 oceans/{plotting => }/plotting.py | 0 oceans/plotting/__init__.py | 0 oceans/sandbox/__init__.py | 0 oceans/sw_extras/__init__.py | 0 oceans/{ocfis => }/synop.py | 0 23 files changed, 0 insertions(+), 0 deletions(-) rename oceans/{RPSstuff => }/RPSstuff.py (100%) delete mode 100644 oceans/RPSstuff/__init__.py rename oceans/{colormaps => }/cmap_data/cbathy.dat (100%) rename oceans/{colormaps => }/cmap_data/coolavhrrmap.dat (100%) rename oceans/{colormaps => }/cmap_data/ctopo.dat (100%) rename oceans/{colormaps => }/cmap_data/odv.dat (100%) rename oceans/{colormaps => }/cmap_data/redblue_dark.dat (100%) rename oceans/{colormaps => }/cmap_data/redblue_light.dat (100%) rename oceans/{colormaps => }/cmap_data/redgreen.dat (100%) rename oceans/{colormaps => }/cmap_data/rscolmap.dat (100%) rename oceans/{colormaps => }/colormaps.py (100%) delete mode 100644 oceans/colormaps/__init__.py rename oceans/{datasets => }/datasets.py (100%) delete mode 100644 oceans/datasets/__init__.py rename oceans/{filters => }/filters.py (100%) delete mode 100644 oceans/filters/__init__.py rename oceans/{ocfis => }/ocfis.py (100%) delete mode 100644 oceans/ocfis/__init__.py rename oceans/{plotting => }/plotting.py (100%) delete mode 100644 oceans/plotting/__init__.py delete mode 100644 oceans/sandbox/__init__.py delete mode 100644 oceans/sw_extras/__init__.py rename oceans/{ocfis => }/synop.py (100%) diff --git a/oceans/RPSstuff/RPSstuff.py b/oceans/RPSstuff.py similarity index 100% rename from oceans/RPSstuff/RPSstuff.py rename to oceans/RPSstuff.py diff --git a/oceans/RPSstuff/__init__.py b/oceans/RPSstuff/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/colormaps/cmap_data/cbathy.dat b/oceans/cmap_data/cbathy.dat similarity index 100% rename from oceans/colormaps/cmap_data/cbathy.dat rename to oceans/cmap_data/cbathy.dat diff --git a/oceans/colormaps/cmap_data/coolavhrrmap.dat b/oceans/cmap_data/coolavhrrmap.dat similarity index 100% rename from oceans/colormaps/cmap_data/coolavhrrmap.dat rename to oceans/cmap_data/coolavhrrmap.dat diff --git a/oceans/colormaps/cmap_data/ctopo.dat b/oceans/cmap_data/ctopo.dat similarity index 100% rename from oceans/colormaps/cmap_data/ctopo.dat rename to oceans/cmap_data/ctopo.dat diff --git a/oceans/colormaps/cmap_data/odv.dat b/oceans/cmap_data/odv.dat similarity index 100% rename from oceans/colormaps/cmap_data/odv.dat rename to oceans/cmap_data/odv.dat diff --git a/oceans/colormaps/cmap_data/redblue_dark.dat b/oceans/cmap_data/redblue_dark.dat similarity index 100% rename from oceans/colormaps/cmap_data/redblue_dark.dat rename to oceans/cmap_data/redblue_dark.dat diff --git a/oceans/colormaps/cmap_data/redblue_light.dat b/oceans/cmap_data/redblue_light.dat similarity index 100% rename from oceans/colormaps/cmap_data/redblue_light.dat rename to oceans/cmap_data/redblue_light.dat diff --git a/oceans/colormaps/cmap_data/redgreen.dat b/oceans/cmap_data/redgreen.dat similarity index 100% rename from oceans/colormaps/cmap_data/redgreen.dat rename to oceans/cmap_data/redgreen.dat diff --git a/oceans/colormaps/cmap_data/rscolmap.dat b/oceans/cmap_data/rscolmap.dat similarity index 100% rename from oceans/colormaps/cmap_data/rscolmap.dat rename to oceans/cmap_data/rscolmap.dat diff --git a/oceans/colormaps/colormaps.py b/oceans/colormaps.py similarity index 100% rename from oceans/colormaps/colormaps.py rename to oceans/colormaps.py diff --git a/oceans/colormaps/__init__.py b/oceans/colormaps/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/datasets/datasets.py b/oceans/datasets.py similarity index 100% rename from oceans/datasets/datasets.py rename to oceans/datasets.py diff --git a/oceans/datasets/__init__.py b/oceans/datasets/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/filters/filters.py b/oceans/filters.py similarity index 100% rename from oceans/filters/filters.py rename to oceans/filters.py diff --git a/oceans/filters/__init__.py b/oceans/filters/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/ocfis/ocfis.py b/oceans/ocfis.py similarity index 100% rename from oceans/ocfis/ocfis.py rename to oceans/ocfis.py diff --git a/oceans/ocfis/__init__.py b/oceans/ocfis/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/plotting/plotting.py b/oceans/plotting.py similarity index 100% rename from oceans/plotting/plotting.py rename to oceans/plotting.py diff --git a/oceans/plotting/__init__.py b/oceans/plotting/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/sandbox/__init__.py b/oceans/sandbox/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/sw_extras/__init__.py b/oceans/sw_extras/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/oceans/ocfis/synop.py b/oceans/synop.py similarity index 100% rename from oceans/ocfis/synop.py rename to oceans/synop.py From 3df899cef59635581316d1fd2c0188c366b9f5ee Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 17:25:46 -0300 Subject: [PATCH 5/9] remove untested old function --- oceans/datasets.py | 106 --------------------------------------------- 1 file changed, 106 deletions(-) diff --git a/oceans/datasets.py b/oceans/datasets.py index ba19133..89d5512 100644 --- a/oceans/datasets.py +++ b/oceans/datasets.py @@ -340,112 +340,6 @@ def _get_indices(bbox, lons, lats): return imin, imax+1, jmin, jmax+1 -def get_gebco15(x, y, topofile='gebco15-40s_30-52w_30seg.nc'): - """ - Usage - ----- - H, D, Xo, Yo = get_gebco15(x, y, topofile='gebco/gebco_08_30seg.nc') - - Description - ----------- - Finds the depth of points of coordinates 'x','y' using GEBCO data set. - - Parameters - ---------- - x : 1D array - Array containing longitudes of the points of unknown depth. - - y : 1D array - Array containing latitudes of the points of unknown depth. - - topofile : string, optional - String containing path to the GEBCO netCDF file. - - Returns - ------- - H : 1D array - Array containing depths of points closest to the input X, Y - coordinates. - - X : 1D array - Array of horizontal distance associated with array 'H'. - - D : 1D array - Array containing distances (in km) from the input X, Y - coordinates to the data points. - - Xo : 1D array - Array containing longitudes of the data points. - - Yo : 1D array - Array containing latitudes of the data points. - - NOTES - ------- - This function reads the entire netCDF file before extracting the wanted - data. Therefore, it does not handle the full GEBCO dataset (1.8 GB) - efficiently. - - TODO - ------- - Make it possible to work with the full gebco dataset, by extracting only - the wanted indexes. - - Code History - --------------------------------------- - Author of the original Matlab code (ftopo.m, ETOPO2 dataset): - Marcelo Andrioni - December 2008: Modification performed by Cesar Rocha - to handle ETOPO1 dataset. - July 2012: Python Translation and modifications performed by André Palóczy - Filho - to handle GEBCO dataset (30 arc seconds resolution). - - """ - from seawater import dist - - x, y = list(map(np.asanyarray, (x, y))) - - # Opening netCDF file and extracting data. - grid = Dataset(topofile) - yyr = grid.variables['y_range'][:] - xxr = grid.variables['x_range'][:] - spacing = grid.variables['spacing'][:] - dx, dy = spacing[0], spacing[1] - - # Creating lon and lat 1D arrays. - xx = np.arange(xxr[0], xxr[1], dx) - xx = xx + dx / 2 - yy = np.arange(yyr[0], yyr[1], dy) - yy = yy + dy / 2 - h = grid.variables['z'][:] - grid.close() - - # Retrieving nearest point for each input coordinate. - A = np.asanyarray([]) - xx, yy = np.meshgrid(xx, yy) - ni, nj = xx.shape[0], yy.shape[1] - h = np.reshape(h, (ni, nj)) - h = np.flipud(h) - Xo = A.copy() - Yo = A.copy() - H = A.copy() - D = A.copy() - for I in range(x.size): - ix = near(xx[0, :], x[I]) - iy = near(yy[:, 0], y[I]) - H = np.append(H, h[iy, ix]) - # Calculating distance between input and GEBCO points. - D = np.append(D, dist([x[I], xx[0, ix]], [y[I], yy[iy, 0]], - units='km')[0]) - Xo = np.append(Xo, xx[0, ix]) - Yo = np.append(Yo, yy[iy, 0]) - # Calculating distance axis. - X = np.append(0, np.cumsum(dist(Xo, Yo, units='km')[0])) - - return H, X, D, Xo, Yo - - if __name__ == '__main__': import doctest doctest.testmod() From 9aa217942b6eca60b7b642f8a99fb3dd70e5a0ee Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 19:28:21 -0300 Subject: [PATCH 6/9] fix docs --- oceans/RPSstuff.py | 80 +++++++++--------- oceans/colormaps.py | 4 +- oceans/datasets.py | 1 - oceans/filters.py | 104 +++++++----------------- oceans/ocfis.py | 31 +++---- oceans/plotting.py | 2 +- oceans/sw_extras/gamma_GP_from_SP_pt.py | 4 +- oceans/sw_extras/sw_extras.py | 54 ++++++------ oceans/sw_extras/waves.py | 2 +- 9 files changed, 112 insertions(+), 170 deletions(-) diff --git a/oceans/RPSstuff.py b/oceans/RPSstuff.py index ef467a5..fac34a2 100644 --- a/oceans/RPSstuff.py +++ b/oceans/RPSstuff.py @@ -11,8 +11,8 @@ def h2hms(hours): """ Converts hours to hours, minutes, and seconds. - Example - ------- + Examples + -------- >>> h2hms(12.51) (12.0, 30.0, 36.0) @@ -28,8 +28,8 @@ def hms2h(h, m=None, s=None): """ Converts hours, minutes, and seconds to hours. - Example - ------- + Examples + -------- >>> hms2h(12., 30., 36.) 12.51 >>> # Or, @@ -53,8 +53,8 @@ def ms2hms(millisecs): """ Converts milliseconds to integer hour, minute, seconds. - Example - ------- + Examples + -------- >>> ms2hms(1e3 * 60) (0.0, 1.0, 0.0) @@ -82,22 +82,21 @@ def julian(y, m=0, d=0, h=0, mi=0, s=0, noon=False): If you want Julian days to start and end at noon set `noon` to True. INPUT: - y = year (e.g., 1979) component - m = month (1-12) component - d = day (1-31) component of Gregorian date - - hour = hours (0-23) - min = minutes (0-59) - sec = decimal seconds - or - h = decimal hours (assumed 0 if absent) + y : year (e.g., 1979) component + m : month (1-12) component + d : day (1-31) component of Gregorian date + hour : hours (0-23) + min : minutes (0-59) + sec : decimal seconds or + h : decimal hours (assumed 0 if absent) OUTPUT: - j = decimal Julian day number + j : decimal Julian day number + last revised 1/3/96 by Rich Signell (rsignell@usgs.gov) - Example - ------- + Examples + -------- >>> julian(1968, 5, 23, 0) array([2440000.]) @@ -128,8 +127,8 @@ def jdrps2jdmat(jd): Convert Signell's Julian days to Matlab's Serial day matlab's serial date = 1 at 0000 UTC, 1-Jan-0000. - Example - ------- + Examples + -------- >>> jdrps2jdmat(2440000) array([718941.]) @@ -142,8 +141,8 @@ def jdmat2jdrps(jdmat): Convert Matlab's Serial Day to Signell's Julian days matlab's serial date = 1 at 0000 UTC, 1-Jan-0000. - Example - ------- + Examples + -------- >>> jdmat2jdrps(718941) array([2440000.]) @@ -161,18 +160,18 @@ def gregorian(jd, noon=False): INPUT: jd = decimal Julian days - OUTPUT: gtime = six column Gregorian time matrix, where each row is - [yyyy mo da hr mi sec]. - yyyy = year (e.g., 1979) - mo = month (1-12) - da = day (1-31) - hr = hour (0-23) - mi = minute (0-59) - sec = decimal seconds - example: [1990 12 12 0 0 0] is midnight on Dec 12, 1990. - - Example - ------- + OUTPUT: gtime = six column Gregorian time matrix, where each row is: + [yyyy mo da hr mi sec]. + yyyy = year (e.g., 1979) + mo = month (1-12) + da = day (1-31) + hr = hour (0-23) + mi = minute (0-59) + sec = decimal seconds + example: [1990 12 12 0 0 0] is midnight on Dec 12, 1990. + + Examples + -------- >>> gregorian(2440000) array([[1968., 5., 23., 0., 0., 0.]]) @@ -227,8 +226,8 @@ def s2hms(secs): Converts seconds to integer hour,minute,seconds Usage: hour, min, sec = s2hms(secs) - Example - ------- + Examples + -------- >>> s2hms(3600 + 60 + 1) (1.0, 1.0, 1) @@ -309,10 +308,11 @@ def z0toCn(z0, H): C = Chezy "C" (non-dimensional) n = Manning's "n" (non-dimensional) - Example: - C, n = z0toCn(0.003, np.arange(2, 200)) - finds vectors C and n corresponding to a z0=0.003 and - a range of water depths from 2--200 meters + Examples + -------- + >>> # finds vectors C and n corresponding to a z0=0.003 + >>> # and a range of water depths from 2--200 meters. + >>> C, n = z0toCn(0.003, np.arange(2, 200)) """ diff --git a/oceans/colormaps.py b/oceans/colormaps.py index b4ba5a1..8212bb8 100644 --- a/oceans/colormaps.py +++ b/oceans/colormaps.py @@ -18,7 +18,7 @@ def __init__(self, **kw): def get_color(color): """ - http://stackoverflow.com/questions/10254207/color-and-line-writing-using-matplotlib + https://stackoverflow.com/questions/10254207/color-and-line-writing-using-matplotlib """ for hue in range(color): @@ -73,7 +73,7 @@ def zebra_cm(a=4, m=0.5, n=256): References ---------- - [1] Hooker, S. B. et al, Detecting Dipole Ring Separatrices with Zebra + Hooker, S. B. et al, Detecting Dipole Ring Separatrices with Zebra Palettes, IEEE Transactions on Geosciences and Remote Sensing, vol. 33, 1306-1312, 1995 diff --git a/oceans/datasets.py b/oceans/datasets.py index 89d5512..8adf416 100644 --- a/oceans/datasets.py +++ b/oceans/datasets.py @@ -4,7 +4,6 @@ import numpy as np -from oceans.RPSstuff import near from oceans.ocfis import get_profile, wrap_lon180 diff --git a/oceans/filters.py b/oceans/filters.py index 175296b..5f16f91 100644 --- a/oceans/filters.py +++ b/oceans/filters.py @@ -73,7 +73,7 @@ def smoo1(datain, window_len=11, window='hanning'): Notes ----- - original from: http://www.scipy.org/Cookbook/SignalSmooth + original from: https://scipy-cookbook.readthedocs.io/items/SignalSmooth.html This method is based on the convolution of a scaled window with the signal. The signal is prepared by introducing reflected copies of the signal (with the window size) in both ends so that transient parts are minimized in the @@ -141,56 +141,31 @@ def smoo1(datain, window_len=11, window='hanning'): def smoo2(A, hei, wid, kind='hann', badflag=-9999, beta=14): """ - Usage - ----- - As = smoo2(A, hei, wid, kind='hann', badflag=-9999, beta=14) - - Description - ----------- Calculates the smoothed array 'As' from the original array 'A' using the specified window of type 'kind' and shape ('hei', 'wid'). + Usage: + As = smoo2(A, hei, wid, kind='hann', badflag=-9999, beta=14) + Parameters ---------- - A : 2D array - Array to be smoothed. - - hei : integer - Window height. Must be odd and greater than or equal to 3. - - wid : integer - Window width. Must be odd and greater than or equal to 3. - - kind : string, optional - One of the window types available in the numpy module: - - hann (default) : Gaussian-like. The weight decreases toward the - ends. Its end-points are zeroed. - hamming : Similar to the hann window. Its end-points are - not zeroed, therefore it is discontinuous at - the edges, and may produce artifacts. - blackman : Similar to the hann and hamming windows, with - sharper ends. - bartlett : Triangular-like. Its end-points are zeroed. - kaiser : Flexible shape. Takes the optional parameter - "beta" as a shape parameter. For beta=0, the - window is rectangular. As beta increases, the - window gets narrower. - - Refer to Numpy for details about each window type. - + A : 2D array + Array to be smoothed. + hei : integer + Window height. Must be odd and greater than or equal to 3. + wid : integer + Window width. Must be odd and greater than or equal to 3. + kind : string, optional + Refer to Numpy for details about each window type. badflag : float, optional - The bad data flag. Elements of the input array 'A' holding this - value are ignored. - - beta : float, optional - Shape parameter for the kaiser window. For windows other than - the kaiser window, this parameter does nothing. + The bad data flag. Elements of the input array 'A' holding this value are ignored. + beta : float, optional + Shape parameter for the kaiser window. Returns ------- - As : 2D array - The smoothed array. + As : 2D array + The smoothed array. André Palóczy Filho (paloczy@gmail.com) April 2012 @@ -285,40 +260,23 @@ def smoo2(A, hei, wid, kind='hann', badflag=-9999, beta=14): def weim(x, N, kind='hann', badflag=-9999, beta=14): """ - Usage - ----- - xs = weim(x, N, kind='hann', badflag=-9999, beta=14) - - Description - ----------- Calculates the smoothed array 'xs' from the original array 'x' using the specified window of type 'kind' and size 'N'. 'N' must be an odd number. + Usage: + xs = weim(x, N, kind='hann', badflag=-9999, beta=14) + + Parameters ---------- - x : 1D array - Array to be smoothed. - - N : integer - Window size. Must be odd. - - kind : string, optional - One of the window types available in the numpy module: - - hann (default) : Gaussian-like. The weight decreases toward the - ends. Its end-points are zeroed. - hamming : Similar to the hann window. Its end-points are - not zeroed, therefore it is discontinuous at the - edges, and may produce undesired artifacts. - blackman : Similar to the hann and hamming windows, with - sharper ends. - bartlett : Triangular-like. Its end-points are zeroed. - kaiser : Flexible shape. Takes the optional parameter - "beta" as a shape parameter. For beta=0, the - window is rectangular. As beta increases, the - window gets narrower. - - Refer to the numpy functions for details about each window type. + x : 1D array + Array to be smoothed. + + N : integer + Window size. Must be odd. + + kind : string, optional + Refer to Numpy for details about each window type. badflag : float, optional The bad data flag. Elements of the input array 'A' holding this @@ -456,10 +414,6 @@ def medfilt1(x, L=3): >>> ax = plt.subplot(212) >>> lims2 = ax.set_ylim([min(y1min, y2min), max(y1max, y2max)]) - Notes - ----- - Based on: http://staff.washington.edu/bdjwww/medfilt.py - """ xin = np.atleast_1d(np.asanyarray(x)) diff --git a/oceans/ocfis.py b/oceans/ocfis.py index b5dbc00..cbc7afd 100644 --- a/oceans/ocfis.py +++ b/oceans/ocfis.py @@ -98,7 +98,7 @@ def del_eta_del_x(U, f, g, balance='geostrophic', R=None): Calculate :mat: `\frac{\partial \eta} {\partial x}` for different force balances - Parameters: + Parameters ---------- U : array_like velocity magnitude [m/s] @@ -148,7 +148,7 @@ def mld(SA, CT, p, criterion='pdvar'): 'density' : computed based on the constant potential density difference criterion, pd[0] - pd[mld] = 0.125 in sigma units. - `pdvar` : computed based on variable potential density criterion + 'pdvar' : computed based on variable potential density criterion pd[0] - pd[mld] = var(T[0], S[0]), where var is a variable potential density difference which corresponds to constant temperature difference of 0.5 degree C. @@ -162,7 +162,7 @@ def mld(SA, CT, p, criterion='pdvar'): References ---------- - .. [1] Monterey, G., and S. Levitus, 1997: Seasonal variability of mixed + Monterey, G., and S. Levitus, 1997: Seasonal variability of mixed layer depth for the World Ocean. NOAA Atlas, NESDIS 14, 100 pp. Washington, D.C. @@ -250,7 +250,7 @@ def pcaben(u, v): ... print('Flatness: {}'.format(flatness)) Notes: - http://pubs.usgs.gov/of/2002/of02-217/m-files/pcaben.m + https://pubs.usgs.gov/of/2002/of02-217/m-files/pcaben.m """ @@ -316,7 +316,7 @@ def spec_rot(u, v): References ---------- - .. [1] J. Gonella Deep Sea Res., 833-846, 1972. + J. Gonella Deep Sea Res., 833-846, 1972. """ @@ -599,8 +599,11 @@ def despike(self, n=3, recursive=False): def pol2cart(theta, radius, units='deg'): """ Convert from polar to Cartesian coordinates - **usage**: - x, y = pol2cart(theta, radius, units='deg'). + + Examples + -------- + >>> pol2cart(0, 1, units='deg') + (1.0, 0.0) """ if units in ['deg', 'degs']: @@ -614,8 +617,8 @@ def cart2pol(x, y): """ Convert from Cartesian to polar coordinates. - Example - ------- + Examples + -------- >>> x = [+0, -0.5] >>> y = [+1, +0.5] >>> cart2pol(x, y) @@ -696,10 +699,6 @@ def get_profile(x, y, f, xi, yi, mode='nearest', order=3): >>> get_profile(x, y, f, xi, yi, order=3) array([17606, 15096, 18540]) - Notes - ----- - http://mail.scipy.org/pipermail/scipy-user/2011-June/029857.html - """ from scipy.ndimage import map_coordinates @@ -738,7 +737,7 @@ def strip_mask(arr, fill_value=np.NaN): def shiftdim(x, n=None): """ - Matlab's shiftdim in python. + Matlab-like shiftdim in python. Examples -------- @@ -756,10 +755,6 @@ def shiftdim(x, n=None): >>> c.shape == a.shape True - Notes - ----- - http://www.python-it.org/forum/index.php?topic=4688.0 - """ def no_leading_ones(shape): diff --git a/oceans/plotting.py b/oceans/plotting.py index 6dc935b..f62e1a0 100644 --- a/oceans/plotting.py +++ b/oceans/plotting.py @@ -209,7 +209,7 @@ class EditPoints(object): >>> _ = ax.set_title('Click and drag a point to move it') >>> _ = ax.axis([-2, 2, -2, 2]) - Based on http://matplotlib.org/examples/event_handling/poly_editor.html + Based on https://matplotlib.org/examples/event_handling/poly_editor.html """ epsilon = 5 # Maximum pixel distance to count as a point hit. diff --git a/oceans/sw_extras/gamma_GP_from_SP_pt.py b/oceans/sw_extras/gamma_GP_from_SP_pt.py index 058af80..836f702 100644 --- a/oceans/sw_extras/gamma_GP_from_SP_pt.py +++ b/oceans/sw_extras/gamma_GP_from_SP_pt.py @@ -6,7 +6,7 @@ def in_polygon(xp, yp, polygon, transform=None, radius=0.0): Check is points `xp` and `yp` are inside the `polygon`. Polygon is a `matplotlib.path.Path` object. - http://stackoverflow.com/questions/21328854/shapely-and-matplotlib-point-in-polygon-not-accurate-with-geolocation + https://stackoverflow.com/questions/21328854/shapely-and-matplotlib-point-in-polygon-not-accurate-with-geolocation Examples -------- @@ -238,7 +238,7 @@ def gamma_GP_from_SP_pt(SP, pt, p, lon, lat): Examples -------- - >>> from oceans.sw_extras import gamma_GP_from_SP_pt + >>> from oceans.sw_extras.gamma_GP_from_SP_pt import gamma_GP_from_SP_pt >>> SP = [35.066, 35.086, 35.089, 35.078, 35.025, 34.851, 34.696, 34.572, ... 34.531, 34.509, 34.496, 34.452, 34.458, 34.456, 34.488, 34.536, ... 34.579, 34.612, 34.642, 34.657, 34.685, 34.707, 34.72, 34.729] diff --git a/oceans/sw_extras/sw_extras.py b/oceans/sw_extras/sw_extras.py index 0bfd34d..7c4da22 100644 --- a/oceans/sw_extras/sw_extras.py +++ b/oceans/sw_extras/sw_extras.py @@ -1,9 +1,3 @@ -""" -Extra seawater functions -======================== - -""" - from copy import copy import numpy as np @@ -39,7 +33,7 @@ def sigma_t(s, t, p): -------- >>> # Data from UNESCO Tech. Paper in Marine Sci. No. 44, p22. >>> from seawater.library import T90conv - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> s = [0, 0, 0, 0, 35, 35, 35, 35] >>> t = T90conv([0, 0, 30, 30, 0, 0, 30, 30]) >>> p = [0, 10000, 0, 10000, 0, 10000, 0, 10000] @@ -49,12 +43,12 @@ def sigma_t(s, t, p): References ---------- - .. [1] Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for + Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for computation of fundamental properties of seawater. UNESCO Tech. Pap. in Mar. Sci., No. 44, 53 pp. Eqn.(31) p.39. http://www.scor-int.org/Publications.htm - .. [2] Millero, F.J., Chen, C.T., Bradshaw, A., and Schleicher, K. A new + Millero, F.J., Chen, C.T., Bradshaw, A., and Schleicher, K. A new high pressure equation of state for seawater. Deap-Sea Research., 1980, Vol27A, pp255-264. doi:10.1016/0198-0149(80)90016-3 @@ -91,7 +85,7 @@ def sigmatheta(s, t, p, pr=0): -------- >>> # Data from UNESCO Tech. Paper in Marine Sci. No. 44, p22. >>> from seawater.library import T90conv - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> s = [0, 0, 0, 0, 35, 35, 35, 35] >>> t = T90conv([0, 0, 30, 30, 0, 0, 30, 30]) >>> p = [0, 10000, 0, 10000, 0, 10000, 0, 10000] @@ -101,12 +95,12 @@ def sigmatheta(s, t, p, pr=0): References ---------- - .. [1] Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for + Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for computation of fundamental properties of seawater. UNESCO Tech. Pap. in Mar. Sci., No. 44, 53 pp. Eqn.(31) p.39. http://www.scor-int.org/Publications.htm - .. [2] Millero, F.J., Chen, C.T., Bradshaw, A., and Schleicher, K. A new + Millero, F.J., Chen, C.T., Bradshaw, A., and Schleicher, K. A new high pressure equation of state for seawater. Deap-Sea Research., 1980, Vol27A, pp255-264. doi:10.1016/0198-0149(80)90016-3 @@ -138,7 +132,7 @@ def N(bvfr2): Examples -------- >>> import numpy as np - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> s = np.array([[0, 0, 0], [15, 15, 15], [30, 30, 30],[35,35,35]]) >>> t = np.repeat(15, s.size).reshape(s.shape) >>> p = [[0], [250], [500], [1000]] @@ -151,10 +145,10 @@ def N(bvfr2): References ---------- - .. [1] A.E. Gill 1982. p.54 eqn 3.7.15 "Atmosphere-Ocean Dynamics" + A.E. Gill 1982. p.54 eqn 3.7.15 "Atmosphere-Ocean Dynamics" Academic Press: New York. ISBN: 0-12-283522-0 - .. [2] Jackett, David R., Trevor J. Mcdougall, 1995: Minimal Adjustment of + Jackett, David R., Trevor J. Mcdougall, 1995: Minimal Adjustment of Hydrographic Profiles to Achieve Static Stability. J. Atmos. Oceanic Technol., 12, 381-389. doi: 10.1175/1520-0426(1995)012<0381:MAOHPT>2.0.CO;2 @@ -180,7 +174,7 @@ def cph(bvfr2): Examples -------- >>> import numpy as np - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> s = np.array([[0, 0, 0], [15, 15, 15], [30, 30, 30],[35,35,35]]) >>> t = np.repeat(15, s.size).reshape(s.shape) >>> p = [[0], [250], [500], [1000]] @@ -192,7 +186,7 @@ def cph(bvfr2): References ---------- - .. [1] A.E. Gill 1982. p.54 eqn 3.7.15 "Atmosphere-Ocean Dynamics" + A.E. Gill 1982. p.54 eqn 3.7.15 "Atmosphere-Ocean Dynamics" Academic Press: New York. ISBN: 0-12-283522-0 """ @@ -228,7 +222,7 @@ def shear(z, u, v=0): Examples -------- - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> z = [[0], [250], [500], [1000]] >>> u = [[0.5, 0.5, 0.5], [0.15, 0.15, 0.15], ... [0.03, 0.03, .03], [0.,0.,0.]] @@ -282,7 +276,7 @@ def richnumb(bvfr2, S2): TODO: check the example and add real values >>> import numpy as np >>> import seawater as sw - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> s = np.array([[0, 0, 0], [15, 15, 15], [30, 30, 30],[ 35, 35, 35]]) >>> t = np.repeat(15, s.size).reshape(s.shape) >>> p = [[0], [250], [500], [1000]] @@ -328,16 +322,16 @@ def cor_beta(lat): Examples -------- - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> swe.cor_beta(0) 2.2891225867210798e-11 References ---------- - .. [1] S. Pond & G.Pickard 2nd Edition 1986 Introductory Dynamical + S. Pond & G.Pickard 2nd Edition 1986 Introductory Dynamical Oceanography Pergamon Press Sydney. ISBN 0-08-028728-X - .. [2] A.E. Gill 1982. p.54 eqn 3.7.15 "Atmosphere-Ocean Dynamics" + A.E. Gill 1982. p.54 eqn 3.7.15 "Atmosphere-Ocean Dynamics" Academic Press: New York. ISBN: 0-12-283522-0 """ @@ -364,7 +358,7 @@ def inertial_period(lat): Examples -------- - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> lat = 30. >>> swe.inertial_period(lat)/3600 23.93484986278565 @@ -395,7 +389,7 @@ def strat_period(N): -------- >>> import numpy as np >>> import seawater as sw - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> s = np.array([[0, 0, 0], [15, 15, 15], [30, 30, 30],[35,35,35]]) >>> t = np.repeat(15, s.size).reshape(s.shape) >>> p = [[0], [250], [500], [1000]] @@ -434,7 +428,7 @@ def visc(s, t, p): Examples -------- - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> swe.visc(40., 40., 1000.) 8.200192496633804e-07 @@ -473,14 +467,14 @@ def tcond(s, t, p): Examples -------- - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> swe.tcond(35, 20, 0) 0.5972445569999999 References ---------- - .. [1] Caldwell's DSR 21:131-137 (1974) eq. 9 - .. [2] Catelli et al.'s DSR 21:311-3179(1974) eq. 5 + Caldwell's DSR 21:131-137 (1974) eq. 9 + Catelli et al.'s DSR 21:311-3179(1974) eq. 5 Modifications: Original 1998/01/19 - Ayal Anis 1998 @@ -533,13 +527,13 @@ def spice(s, t, p): Examples -------- - >>> from oceans import sw_extras as swe + >>> import oceans.sw_extras.sw_extras as swe >>> swe.spice(33, 15, 0) array(0.54458641) References ---------- - .. [1] A state variable for characterizing water masses and their + A state variable for characterizing water masses and their diffusive stability: spiciness. Prog. in Oceanography Volume 54, 2002, Pages 493-501. diff --git a/oceans/sw_extras/waves.py b/oceans/sw_extras/waves.py index 7484c0e..207724b 100644 --- a/oceans/sw_extras/waves.py +++ b/oceans/sw_extras/waves.py @@ -36,7 +36,7 @@ class Waves(object): Examples -------- - >>> from oceans.sw_extras import Waves + >>> from oceans.sw_extras.waves import Waves >>> wav = Waves(h=10, T=5, L=None) >>> print("ho/Lo = %s" % wav.hoLo) ho/Lo = 0.2561951195588007 From b19c6274adaf2d0ce96772a236dcbca0c5079022 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 19:33:49 -0300 Subject: [PATCH 7/9] docs --- .travis.yml | 4 +- docs/Makefile | 19 ++++ docs/source/RPSstuff.rst | 7 ++ docs/source/_static/logo.png | Bin 0 -> 9037 bytes docs/source/colormaps.rst | 7 ++ docs/source/conf.py | 196 +++++++++++++++++++++++++++++++++++ docs/source/datasets.rst | 7 ++ docs/source/filters.rst | 7 ++ docs/source/index.rst | 28 +++++ docs/source/ocfis.rst | 7 ++ docs/source/plotting.rst | 7 ++ 11 files changed, 287 insertions(+), 2 deletions(-) create mode 100644 docs/Makefile create mode 100644 docs/source/RPSstuff.rst create mode 100644 docs/source/_static/logo.png create mode 100644 docs/source/colormaps.rst create mode 100644 docs/source/conf.py create mode 100644 docs/source/datasets.rst create mode 100644 docs/source/filters.rst create mode 100644 docs/source/index.rst create mode 100644 docs/source/ocfis.rst create mode 100644 docs/source/plotting.rst diff --git a/.travis.yml b/.travis.yml index 3430626..ac8e8a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,11 +61,11 @@ deploy: provider: pypi user: ocefpaf password: - secure: "BdJc76Z+DnmmamZSX+QCGZDnf+FW/JQOnVZ2t59r2r2RM4860Wf6GSL/Ncw6v8G3sOghWQcMzFdY5e6aNzAW0Ddm2YKHAsfxgurbEsnlzwsNPBWv2280ca7TtlFk2JkqhtYQOkoBFbA8+e/lC8ZC6aAVffQAT1NE4lEs0/Jd+TA=" + secure: "HifofjCDgTUP3hv0C8xD411JBCIp7VziSE5SiD9ZXo9CGo/rnr2rxtIcA9QDHfwO0n1iK26AhUbmeUURecn7+GjvvwCsbN3y21zfx0/D6KCSCvfEuJBJG2uAZqbNBFkT5//96umsavVngp0vNzOASDCljBgC9t5X0r1JnybQUro=" distributions: sdist bdist_wheel upload_docs: no on: - repo: pyoceans/oceans + repo: pyoceans/python-oceans tags: true all_branches: master condition: '$TEST_TARGET == "default"' diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..69fe55e --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,19 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/source/RPSstuff.rst b/docs/source/RPSstuff.rst new file mode 100644 index 0000000..b0caccc --- /dev/null +++ b/docs/source/RPSstuff.rst @@ -0,0 +1,7 @@ +:mod:`oceans.RPSstuff` +---------------------- + +.. automodule:: oceans.RPSstuff + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/_static/logo.png b/docs/source/_static/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..33fe4a8f968b50282633d030d82192d969a4b2bc GIT binary patch literal 9037 zcmbW+cQhP8yf5(GD2pgjV`KFdL5Oa(AfhH&L9`{hh=gUWE_xTeMq5M|y^DwvWeK}_ zuURY+M2~1M_uhBzxqsgGzUR#RGxN{q%$zwhzqy{do(F^iD9Fh{cDLokjx0nh!qplT*2gM{Fl$cM!`>3{yS#R_= zRKnUdn39U+HY@lJ-(CKD0)moK(lRhvIn~E%>Kd9_+WIdH42_IU5H_}Uuk2qtyg|FU zdw6(eKU62)ukw-j;g6UCWer*>euY}%jW^30`Di)~ZD&PKpkp5HjzXJvT ze~JDZ^xvNAIRG^Y@ZW-w&;yhJL-#jPX?^nJA(qq^pN`L$b0ow0`JtRXK52qLS7t9T zk^N7#*Pj$#B+|Q2-m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{6>ZW2~&GyKlY7EZ@=DY*%N(e*aSN zH2%q73RR-WvrHeD2pgV+#nZk)|7L_70!0VwD1pYthex%|x06*5?@mq6{U74lq?QQ1wGb14wv~(V@5sky8?-MEbAvmdCrD2$ zN$!P2bDGJ!nwhOF!*l~7+UcO#c*FBnh%Z{dEZWq%@2<6c>RCjUt6;@vkYrk&1i|_b z$8)v_FegFR41uj~8(Lb|oX05RA^z^8rdzib5E)-bscsDh-6o4vq*a9N>=_2s4ybah zv|wFsE6VOIFE2Mfsar4~ukE!t4dmi(3z^hbDV41d@tC^OUXCSl%B+PKP+v9AJxR2%5xj5zzzfPB7C zI>hpukRSV~3P93qo`EkbH5%YKL|+n`d3)oXOj)%G++3xiFkH%a3PrFW$hgK2&I6qPWxp_B^MKlD72 zP(rRx)Y1c~V3(jkh-Kn74t0e0aZIUt;&1hK%bZf=@w4#fw^4wgE+t}&0aA%rG<|tq z_=;*xkOgpjT(}fKOf1Sf(^`zLd}&skAu`3wb$U|%V0`~m|CLJ8CEZmBVnVhor7|ZQ z9^)$QuIO{8SPQqbl=^1;()Jp#%enTZWPi-GZV8)m&yG0u(TyqyC~q8ds8_9WR6H>0 z|1s*9gT@a^D^2BDO#4r+-XtT~);J0Ko8D=izE2PSW<1QDs>}F7@l7&RBB_U#vJ_cp z2d9;Lk$6-paFkN!GAyCBDd_x!wC%t1{yj6tzp{N+}CT&b2ad?pWh=xCXp@CLD1Q zvD>j7e_X`Drb7$u{+O@4XJnguV?=cYiLEn literal 0 HcmV?d00001 diff --git a/docs/source/colormaps.rst b/docs/source/colormaps.rst new file mode 100644 index 0000000..2cd332b --- /dev/null +++ b/docs/source/colormaps.rst @@ -0,0 +1,7 @@ +:mod:`oceans.colormaps` +----------------------- + +.. automodule:: oceans.colormaps + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..5064314 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'oceans' +copyright = '2018, Filipe Fernandes' +author = 'Filipe Fernandes' + +from oceans._version import get_versions +version = release = get_versions()['version'] +del get_versions + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.mathjax', + 'sphinx.ext.githubpages', + 'sphinx.ext.viewcode', + 'sphinx.ext.napoleon', + 'nbsphinx', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# 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 + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +html_theme_options = { + 'logo': 'logo.png', + 'logo_name': 'oceans', + 'github_user': 'pyoceans', + 'github_repo': 'oceans', + 'github_banner': True, + 'travis_button': True, + 'fixed_sidebar': True, +} + +# 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'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +html_sidebars = { + '**': [ + 'about.html', + 'navigation.html', + 'relations.html', # needs 'show_related': True theme option to display + 'searchbox.html', + 'donate.html', + ] +} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'oceansdoc' + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'oceans.tex', 'oceans Documentation', + 'Filipe Fernandes', 'manual'), +] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'oceans', 'oceans Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'oceans', 'oceans Documentation', + author, 'oceans', 'One line description of project.', + 'Miscellaneous'), +] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + + +# -- Extension configuration ------------------------------------------------- \ No newline at end of file diff --git a/docs/source/datasets.rst b/docs/source/datasets.rst new file mode 100644 index 0000000..728a07a --- /dev/null +++ b/docs/source/datasets.rst @@ -0,0 +1,7 @@ +:mod:`oceans.datasets` +---------------------- + +.. automodule:: oceans.datasets + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/filters.rst b/docs/source/filters.rst new file mode 100644 index 0000000..52dc4c8 --- /dev/null +++ b/docs/source/filters.rst @@ -0,0 +1,7 @@ +:mod:`oceans.filters` +--------------------- + +.. automodule:: oceans.filters + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..29475e8 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,28 @@ +.. oceans documentation master file, created by + sphinx-quickstart on Fri Nov 2 15:42:53 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Misc helper functions for ocean sciences +======================================== + +Most of the functions here are Python versions of some common Matlab functions. +They are untested and probably buggy. Use with caution! + +.. toctree:: + :maxdepth: 3 + :caption: Contents: + + datasets + colormaps + plotting + ocfis + filters + RPSstuff + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/ocfis.rst b/docs/source/ocfis.rst new file mode 100644 index 0000000..4d3853a --- /dev/null +++ b/docs/source/ocfis.rst @@ -0,0 +1,7 @@ +:mod:`oceans.ocfis` +------------------- + +.. automodule:: oceans.ocfis + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/plotting.rst b/docs/source/plotting.rst new file mode 100644 index 0000000..343a103 --- /dev/null +++ b/docs/source/plotting.rst @@ -0,0 +1,7 @@ +:mod:`oceans.plotting` +---------------------- + +.. automodule:: oceans.plotting + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file From d31cbbcb19c11896960e49b50becfd4c0a1abadd Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 19:50:41 -0300 Subject: [PATCH 8/9] push docs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ac8e8a4..93ccdee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ script: pushd docs ; make clean html linkcheck ; popd ; - python -m doctr deploy --built-docs ; + python -m doctr deploy --built-docs docs/build/html . ; fi doctr: From a1035274d7730dbfa96278f7796bf08398308e49 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 2 Nov 2018 19:52:46 -0300 Subject: [PATCH 9/9] fix copy-n-pasta --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 93ccdee..626e52e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: include: - name: default env: TEST_TARGET=default PY=3.7 - - python: coding_standards + - name: coding_standards env: TEST_TARGET=coding_standards PY=3.7 - name: docs env: TEST_TARGET=docs PY=3.7