Skip to content

Commit 2f72edb

Browse files
authored
Docstanya (#316)
* add my logo * fix chapter 1 test * Some changes made to Chapters 2, 3 and 5 * Some Changes to Chapters 1 and 2 * Some changes to Appendix * update banner/footer and version * Some Changes to Chapters 1, 2, 3 and appendix * change u to uold in example * Some changes to Chapters 2, 4, 5 and 6 * Some changes to Regrid 2, Lib, esmf, gsRegrid and horizontal * Changes made to Chapters 1-7 and sample data * fix API documentation * rename regrid2 directory and delete print message * add module API files * add future and mock requirements * get cwd for readthedocs * Changes made to API * Changes made to API * Changes made to API * Changes to API * test rtd with mock * add future for readthedocs * create git.py in ../.. * add esmf * add print statements for regrid2 * add print for libregrid2 * restore regrid2.Lib for readthedocs * add mock modules * add git.py * try with new mock list * force git.py * force git.py * try readthedocs.yml file * fix readthedocs maping file * change type pdb to pdf * typo requirements.yml * add dependencies * add dependencies and change conf.yml * change API.rst and other rst files * Changes to API * UVCDAT_ANONYMOUS_LOG set to false * check if git.py is there * add gcc to environment.yml * try docker environment.yml * remove git.py * chage Libregrid to regrid2 * revert * revert * add cdms2 class * delet cdms2 class * delet cdms2 class * change conf.py os.path * Changes to API * Changes made to API * Changes to API * Changes made to API * Changes to API * Changes made to API * Changes made to API * Changes to API * Changes to API * Changes made to API * Changes made to API * Changes made to API * push latest rst files * Changes made to API * Made some changes to API * update documentations * Changes made to API * Changes made to API * Changes made to API * Changes made to Section 2 and API * Changes made to Section 2 * Changes made to Chapter 2 * Changes made to Section 2 * Changes made to Chapters 2, 3, 4,5 and 6 * Changes made to Sections 2, 4, 7 and Appendix * Changes made to Chapter 6 and Appendix * Changes made to Section 2 * update summary table for API * add generated files * Changes made to al sections * Changes made to Section 2 and API * Changes made to 2 and API * Made changes to sections 1 and 2 * Issue#231 (#232) * fix #225 passing transiant variable as axis * Fix macOSX * fix ESMF and NPY_STRING * fix data._mask comparison for numpy 1.14 * failing test from vcs added here (#234) * failing test from vcs added here * ok test passes again * reverted for now * commented out test for @durack1 * Cdmsdocsmerge (#223) * First cdms2 documentation revamp * latest changes * add new files and work on avariable documentations * fix index order * revamp documentation * Fixing cdms documentation (docstrings) * update documentation * continue to work on docs * sphinx doctest in manual.rst * chapter 1 continu * add requirments.txt for read-the-doc * move requirements.txt into docs dir * add requirements * Chapter 2 * add chapter 3 * finish chapter 3 started chapter 4 * flake8 python files * chapter 4 regridding * cdms_4 doctest * add other chapters * finish chapter 4 * add chapter 5 * add chapter 6 * cdms chapter 6 * fix TOC * add chapter 7 and appendix * merge docs * add requirements.txt * remove cdat_info * remote cdat_info * fix latex_logo png * pin pyopenssl to 17.2.0 due to myproxyclient failure in py3 * update TOC * work on tables and setup * try to force jquery 3.1 * just copy js script in _static * add highlight python * add sample dataset page * add sample dataset page * work on tables for cdms_2.rst * continue cdms2 documentations * update cdms2 tables * update sections * update table * finish chapter 2 * fix litteral error * unlink .dodsrc for cdscan * First changes from Tanya * some change in chapter 1 and 2 * some changes in Chapter 2 * fix tables * Some changes to Chapter 2 * Some Changes to Chapter 2 * Some changes made to Chapters 1, 2 and 4 * Some changes to Chapter 2 * Some Changes made to Chapter 2 * Some changes to Chapters 2, 3 and 4 * Some changes made to 1 through Appendix * Some Changes made to Chapter 2 * Some Changes to Chapters 1, 2, 3, 6 and Appendix * Some changes made to Chapters 1 thru 7 and appendix * Some changes to Chpaters 1, 2 and 3 * Changes made to Chapters 1, 4, 5 and Appendix * Some changes to Chapter 2 and 4 * Some Changes to Images, Chapter 3 and Appendix * update logo * add my logo * fix chapter 1 test * Fix python3 slice issue(setitem) and flake8 (#243) * fix python 3 aggregation issue and flake8 (#244) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * Netcdf46 (#249) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * try circleci unstable label * try version 2 circleci * try version 2 circleci * change workflow name * change cdtime to cdms * add certificate to circleci * add fix conda-upload in circleci 2.0 * update prep_for_build version * fix curl command * fix cicleci for cdms * use unstable channel change uvcdat for cdat * build cdms on circleci 2.0 * fix circleci config.yml * change Users/distiler to /Users/denisnadeau * add gcc_linux * add LDSHARED for linux * disable cert and py results * add gcc_linux-64 * change cdscan link * fix myproxy * add esmf and esmpy to py3 env * Revert "Netcdf46 (#249)" (#250) This reverts commit a9e29ea. * Netcdf46 (#251) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * try circleci unstable label * try version 2 circleci * try version 2 circleci * change workflow name * change cdtime to cdms * add certificate to circleci * add fix conda-upload in circleci 2.0 * update prep_for_build version * fix curl command * fix cicleci for cdms * use unstable channel change uvcdat for cdat * build cdms on circleci 2.0 * fix circleci config.yml * change Users/distiler to /Users/denisnadeau * add gcc_linux * add LDSHARED for linux * disable cert and py results * add gcc_linux-64 * change cdscan link * fix myproxy * add esmf and esmpy to py3 env * inverse dodsrc and curl commands * move unlink above cdscan test * fix ESGF test * add new dodsrc files * create dodsrc on-demand * put back tests for unstable * Netcdf46 (#252) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * try circleci unstable label * try version 2 circleci * try version 2 circleci * change workflow name * change cdtime to cdms * add certificate to circleci * add fix conda-upload in circleci 2.0 * update prep_for_build version * fix curl command * fix cicleci for cdms * use unstable channel change uvcdat for cdat * build cdms on circleci 2.0 * fix circleci config.yml * change Users/distiler to /Users/denisnadeau * add gcc_linux * add LDSHARED for linux * disable cert and py results * add gcc_linux-64 * change cdscan link * fix myproxy * add esmf and esmpy to py3 env * inverse dodsrc and curl commands * move unlink above cdscan test * fix ESGF test * add new dodsrc files * create dodsrc on-demand * put back tests for unstable * instal anaconda-client before calling conda-upload * Changes made to API * Made some changes to API * Changes made to API * Changes made to API * Changes made to API * Changes made to Section 2 and API * Changes made to Section 2 * Changes made to Chapter 2 * Changes made to Section 2 * Changes made to Chapters 2, 3, 4,5 and 6 * Changes made to Sections 2, 4, 7 and Appendix * Changes made to Chapter 6 and Appendix * Changes made to Section 2 * Changes made to al sections * Changes made to Section 2 and API * Changes made to 2 and API * Made changes to sections 1 and 2 * Issue#231 (#232) * fix #225 passing transiant variable as axis * Fix macOSX * fix ESMF and NPY_STRING * fix data._mask comparison for numpy 1.14 * Fix python3 slice issue(setitem) and flake8 (#243) * fix python 3 aggregation issue and flake8 (#244) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * Netcdf46 (#249) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * try circleci unstable label * try version 2 circleci * try version 2 circleci * change workflow name * change cdtime to cdms * add certificate to circleci * add fix conda-upload in circleci 2.0 * update prep_for_build version * fix curl command * fix cicleci for cdms * use unstable channel change uvcdat for cdat * build cdms on circleci 2.0 * fix circleci config.yml * change Users/distiler to /Users/denisnadeau * add gcc_linux * add LDSHARED for linux * disable cert and py results * add gcc_linux-64 * change cdscan link * fix myproxy * add esmf and esmpy to py3 env * Revert "Netcdf46 (#249)" (#250) This reverts commit a9e29ea. * Netcdf46 (#251) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * try circleci unstable label * try version 2 circleci * try version 2 circleci * change workflow name * change cdtime to cdms * add certificate to circleci * add fix conda-upload in circleci 2.0 * update prep_for_build version * fix curl command * fix cicleci for cdms * use unstable channel change uvcdat for cdat * build cdms on circleci 2.0 * fix circleci config.yml * change Users/distiler to /Users/denisnadeau * add gcc_linux * add LDSHARED for linux * disable cert and py results * add gcc_linux-64 * change cdscan link * fix myproxy * add esmf and esmpy to py3 env * inverse dodsrc and curl commands * move unlink above cdscan test * fix ESGF test * add new dodsrc files * create dodsrc on-demand * put back tests for unstable * Netcdf46 (#252) * Fix python3 slice issue(setitem) and flake8 * update to libnetcdf 4.6 * try circleci unstable label * try version 2 circleci * try version 2 circleci * change workflow name * change cdtime to cdms * add certificate to circleci * add fix conda-upload in circleci 2.0 * update prep_for_build version * fix curl command * fix cicleci for cdms * use unstable channel change uvcdat for cdat * build cdms on circleci 2.0 * fix circleci config.yml * change Users/distiler to /Users/denisnadeau * add gcc_linux * add LDSHARED for linux * disable cert and py results * add gcc_linux-64 * change cdscan link * fix myproxy * add esmf and esmpy to py3 env * inverse dodsrc and curl commands * move unlink above cdscan test * fix ESGF test * add new dodsrc files * create dodsrc on-demand * put back tests for unstable * instal anaconda-client before calling conda-upload * Fix table titles * Change made to Section 4 * fix bindex issue in hgrid * Changes to all * Corrections made to API Lib * Changes to API * fix ascii art * Changes to Sections 2, 4 and 5 * Changes made to all * Changes made to Sections 2, 6 and Appendix * Changes made to Section 2 * Changes made to Section 2 * Changes made to Section 2 and 5 * Changes to Sections 2, 6 and 7 * Changes to API * Changes made to API * Made Changes to API * Changes made to API * Changes made to Section 4 and 7 * Changes made to API * Changes made to API * Revisit run tests (#262) * migrate run_tests.py to use TestRunnerBase * remove accidentally added tests/coverage.json * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * revisit run_tests.py * add cacert.pem in run_tests.py when running cdms test within the lab * add cacert.pem in run_tests.py when running cdms test within the lab * add cacert.pem in run_tests.py when running cdms test within the lab * add cacert.pem in run_tests.py when running cdms test within the lab - rerun tests * add cacert.pem in run_tests.py when running cdms test within the lab - remove install from -c cdat/label/unstable * put back -c cdat/label/unstable * fix Axis.py * update documentation * fix environment dependencies * add/remote generated files * try to fix API.rst * add regrid2 to docs * Changes made to API * fix space with parameters * fix readthedocs using numpydoc * update environment * fix some autodocs * add hgrid * Changes made to API * Changes made to API * fix avariable bad location methods * Changes to Appendix and API * Changes to Chapter 1 and 2 * Changes made to Section 2 * Changes made to Section 2 * Changes made to Section 2 * Changes to sections 1, 2, 3 and 4 * Changes to section 2 * Changes made to entire docuemnt * Changes to Section 1 and 2 * Changes made to Section 2 * Changes made to Sections 2 thru 6 * Changes made to Chapters 3 and 6 * add jupyter notebook * Changes to all * Changes to Jupyter Notebooks * Changes to all * update documentation for version 3.1.0 * merge documentations * change banner and sidebar colors * Changes to API * fix style sheet * Changes to API * Changes to API * Changes to API and Sections * Changes to all * will this fix master? (#292) * Changes to Sections 1 and 2 * fix cdtime and scripts * trigger read-the-docs * fix more cdtime doc issues * fix typo Default-Calendar * fix conflicts * pass flake8 * udpate chapter1 * Changes * add jupyter notebook * jupyter chapter1 fixed * cleanup chapter 1 jupyter * add tmp_T42_to_POP43_conserv file * chapter 2 and chapter 3 * Changes to Jupyter Notebooks 1 and 2 * clean up * update chapter4 * chapter 4 regridder opendap * chapter 2 using OpenDAP * chapter 2 using OpenDAP * update all chapters * add chapter4 * Changes to Jupiter Notebooks 1 and 2 * Changes to Jupyter Notebooks 1a and 2a * Changes to Jupyter Notebooks 1a, 2a, 3a, 4a * Changes to Jupyter Notebooks 1a, 2a, 3a,4a, 5a * Changes to Jupyter Notebooks 1a thru 4a * Changes to Section 1, 2 * Changes to Sections 1 and 2 * Changes to Sections 1-3 * Changes to Jupyter Notebooks * Changes to Chapters 2, 5 and 6 * Changes to Sections 1 and 2 * Changes to API * fix double Notes section * Changes to API * Changes made to API * Change to API * Changes to API * Changes to API * Changes to Sections * Changes to Sections * Changes to Section 1 * Changes to all * Changes to Sections 2 and 4 * flake8 files
1 parent 48b3294 commit 2f72edb

32 files changed

+2161
-1797
lines changed

Lib/MV2.py

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ def __init__(self, mafunc):
8181
"""
8282
Parameters
8383
----------
84-
var_unary_operation(mafunc)
8584
86-
mafunc is an numpy.ma masked_unary_function.
85+
var_unary_operation(mafunc)
86+
87+
mafunc is an numpy.ma masked_unary_function.
8788
"""
8889
self.mafunc = mafunc
8990
self.__doc__ = mafunc.__doc__
@@ -101,9 +102,9 @@ def __init__(self, mafunc):
101102
Parameters
102103
----------
103104
104-
var_unary_operation(mafunc)
105+
var_unary_operation(mafunc)
105106
106-
mafunc is an numpy.ma masked_unary_function.
107+
mafunc is an numpy.ma masked_unary_function.
107108
"""
108109
self.mafunc = mafunc
109110
self.__doc__ = mafunc.__doc__
@@ -120,22 +121,23 @@ def __call__(self, a, axis=0, **kwargs):
120121

121122
def commonDomain(a, b, omit=None):
122123
"""
124+
Common Domain
125+
123126
Parameters
124127
----------
125128
126-
commonDomain(a,b)
127-
tests that the domains of variables/arrays a and b are equal,
129+
commonDomain(a,b) : tests that the domains of variables/arrays a and b are equal,
128130
129131
Returns
130132
-------
131133
132-
the common domain if equal, or None if not equal.
134+
the common domain if equal, or None if not equal.
133135
134-
The domains may differ in that one domain may have leading
135-
axes not common to the other; the result domain will contain those axes.
136+
The domains may differ in that one domain may have leading
137+
axes not common to the other; the result domain will contain those axes.
136138
137-
If <omit> is specified, as an integer i, skip comparison of the ith dimension
138-
and return None for the ith (common) dimension.
139+
If <omit> is specified, as an integer i, skip comparison of the ith dimension
140+
and return None for the ith (common) dimension.
139141
"""
140142

141143
if isinstance(b, AbstractVariable):
@@ -151,10 +153,8 @@ def commonAxes(a, bdom, omit=None):
151153
152154
Parameters
153155
----------
154-
'a':
155-
is a variable or array,
156-
'b':
157-
is an axislist or None.
156+
'a' : is a variable or array,
157+
'b' : is an axislist or None.
158158
"""
159159
if isinstance(a, AbstractVariable) and bdom is not None:
160160
adom = a.getAxisList()
@@ -209,23 +209,23 @@ def commonAxes(a, bdom, omit=None):
209209

210210
def commonGrid(a, b, axes):
211211
"""
212+
Common Grid
213+
212214
Parameters
213215
----------
214216
215-
commonGrid(a,b,axes)
217+
commonGrid(a,b,axes) : tests if the grids associated with variables a, b are equal
218+
and consistent with the list of axes.
216219
217-
tests if the grids associated with variables a, b are equal
218-
and consistent with the list of axes.
220+
If so, the common grid is returned, else None is returned.
219221
220-
If so, the common grid is returned, else None is returned.
222+
a and b can be numpy arrays, in which case the result is None.
221223
222-
a and b can be numpy arrays, in which case the result is None.
224+
The common grid is 'consistent' with axes if the grid axes (e.g., the axes of
225+
latitude and longitude coordinate variables) are members of the list 'axes'.
223226
224-
The common grid is 'consistent' with axes if the grid axes (e.g., the axes of
225-
latitude and longitude coordinate variables) are members of the list 'axes'.
226-
227-
If the grid(s) of a, b are rectilinear, the result is None, as the grids
228-
are implicitly defined by the axes.
227+
If the grid(s) of a, b are rectilinear, the result is None, as the grids
228+
are implicitly defined by the axes.
229229
"""
230230
if isinstance(b, AbstractVariable):
231231
gb = b.getGrid()
@@ -272,8 +272,9 @@ def __init__(self, mafunc):
272272
Parameters
273273
----------
274274
275-
var_binary_operation(mafunc)
276-
mafunc is an numpy.ma masked_binary_function.
275+
var_binary_operation(mafunc)
276+
277+
mafunc is an numpy.ma masked_binary_function.
277278
"""
278279
self.mafunc = mafunc
279280
self.__doc__ = mafunc.__doc__
@@ -599,14 +600,15 @@ def sort(a, axis=-1):
599600

600601
def choose(myindices, t):
601602
"""
603+
Choose
602604
603605
Returns
604606
-------
605607
606-
an array shaped like indices containing elements chosen from t.
607-
If an element of t is the special element masked, any element of
608-
the result that "chooses" that element is masked. The result has
609-
only the default axes.
608+
an array shaped like indices containing elements chosen from t.
609+
If an element of t is the special element masked, any element of
610+
the result that "chooses" that element is masked. The result has
611+
only the default axes.
610612
"""
611613
maresult = numpy.ma.choose(myindices, list(map(_makeMaskedArg, t)))
612614
F = getattr(t, "fill_value", 1.e20)
@@ -626,11 +628,12 @@ def where(condition, x, y):
626628

627629
def masked_where(condition, x, copy=1):
628630
"""
631+
Marked Where
629632
630633
Returns
631634
-------
632635
633-
x as an array masked where condition is true. Also masked where x or condition masked.
636+
x as an array masked where condition is true. Also masked where x or condition masked.
634637
"""
635638
tx = _makeMaskedArg(x)
636639
tcondition = _makeMaskedArg(condition)
@@ -936,14 +939,17 @@ def outer(self, a, b):
936939

937940
def asarray(data, typecode=None, dtype=None):
938941
"""
942+
939943
asarray(data, typecode=None, dtype=None) is equivalent to array(data, dtype=None, copy=0)
940944
945+
Assarray
941946
942947
Returns
943948
-------
944949
945-
data if dtype is None or data is a MaskedArray of the same dtype.
946-
typecode arg is for backward compatibility.
950+
data if dtype is None or data is a MaskedArray of the same dtype.
951+
952+
typecode arg is for backward compatibility.
947953
"""
948954
dtype = _convdtype(dtype, typecode)
949955
if isinstance(data, AbstractVariable) and (
@@ -995,7 +1001,8 @@ def ones(myshape, typecode=float, savespace=0, axes=None,
9951001

9961002

9971003
def outerproduct(a, b):
998-
"""outerproduct(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))
1004+
"""
1005+
outerproduct(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))
9991006
"""
10001007
ta = asVariable(a, writeable=1)
10011008
tb = asVariable(b, writeable=1)
@@ -1058,9 +1065,11 @@ def reshape(a, newshape, axes=None, attributes=None, id=None, grid=None):
10581065
def resize(a, new_shape, axes=None, attributes=None, id=None, grid=None):
10591066
"""resize(a, new_shape)
10601067
1068+
Resize
1069+
10611070
Returns
10621071
-------
1063-
a new array with the specified shape.
1072+
a new array with the specified shape.
10641073
10651074
The original array's total size can be any size.
10661075
"""
@@ -1079,12 +1088,13 @@ def resize(a, new_shape, axes=None, attributes=None, id=None, grid=None):
10791088
def masked_array(a, mask=None, fill_value=None,
10801089
axes=None, attributes=None, id=None):
10811090
"""
1091+
Masked Array
1092+
10821093
Parameters
10831094
----------
1084-
masked_array(a, mask=None) =
1085-
array(a, mask=mask, copy=0, fill_value=fill_value)
1095+
masked_array(a, mask=None) = array(a, mask=mask, copy=0, fill_value=fill_value)
10861096
1087-
Use fill_value(a) if None.
1097+
Use fill_value(a) if None.
10881098
"""
10891099
maresult = numpy.ma.masked_array(
10901100
_makeMaskedArg(a),
@@ -1099,13 +1109,15 @@ def masked_array(a, mask=None, fill_value=None,
10991109
def masked_values(data, value, rtol=1.e-5, atol=1.e-8, copy=1,
11001110
savespace=0, axes=None, attributes=None, id=None):
11011111
"""
1112+
Masked Values
1113+
11021114
Parameters
11031115
----------
1104-
masked_values(data, value, rtol=1.e-5, atol=1.e-8)
1116+
masked_values(data, value, rtol=1.e-5, atol=1.e-8)
11051117
1106-
Create a masked array; mask is None if possible.
1107-
May share data values with original array, but not recommended.
1108-
Masked where abs(data-value)<= atol + rtol * abs(value)
1118+
Create a masked array; mask is None if possible.
1119+
May share data values with original array, but not recommended.
1120+
Masked where abs(data-value)<= atol + rtol * abs(value)
11091121
"""
11101122
maresult = numpy.ma.masked_values(_makeMaskedArg(
11111123
data), value, rtol=rtol, atol=atol, copy=copy)
@@ -1134,10 +1146,9 @@ def set_default_fill_value(value_type, value):
11341146
"""Set the default fill value for value_type to value.
11351147
Parameters
11361148
----------
1137-
value_type is a string:
1138-
'real','complex','character','integer',or 'object'.
1149+
value_type is a string : real','complex','character','integer',or 'object'.
11391150
1140-
value should be a scalar or single-element array.
1151+
value should be a scalar or single-element array.
11411152
"""
11421153
if value_type == 'real':
11431154
numpy.ma.default_real_fill_value = value
@@ -1158,13 +1169,15 @@ def fromfunction(f, dimensions):
11581169

11591170
def diagonal(a, offset=0, axis1=0, axis2=1):
11601171
"""
1172+
Diagonal
1173+
11611174
Parameters
11621175
----------
1163-
diagonal(a, offset=0, axis1=0, axis2 = 1)
1176+
diagonal(a, offset=0, axis1=0, axis2 = 1)
11641177
11651178
Returns
11661179
-------
1167-
the given diagonals defined by the two dimensions of the array.
1180+
The given diagonals defined by the two dimensions of the array.
11681181
"""
11691182
F = getattr(a, "fill_value", 1.e20)
11701183
return TransientVariable(numpy.ma.diagonal(_makeMaskedArg(a),

0 commit comments

Comments
 (0)