These are chat archives for SHTOOLS/SHTOOLS

9th
Sep 2016
Mark Wieczorek
@MarkWieczorek
Sep 09 2016 13:11
With the discussion of renaming get_coeffs and get_grid to to_array, what do you think about removing the word get from all of these routines? If there was a logic for doing this in the first place, it was that all of these return arrays, and not class instances.
get_grid -> to_array
get_coeffs -> to array
get_degrees -> degrees
get_powerspectrum() -> powerspectrum
get_lats() -> lats
get_lons() -> lots
get_k -> k
get_powerperdegree -> powerspectrum
get_couplingmatrix -> couplingmatrix
get_biasedpowerspectrum -> biasedpowerspectrum
get_multitaperpowerspectrum -> multitaperpowerspectrum
get_multitapercrosspowerspectrum -> multitapercrosspowerspectrum
Ilya Oshchepkov
@ioshchepkov
Sep 09 2016 13:53
looks ok except k - it is too short and not self-explanatory
Ilya Oshchepkov
@ioshchepkov
Sep 09 2016 13:59
And to add what each function returns it is better to add type in the doc string, like in numpy docs, for example
Returns:    out : ndarray
Ilya Oshchepkov
@ioshchepkov
Sep 09 2016 14:07
but I think in most cases it is obvious
Mark Wieczorek
@MarkWieczorek
Sep 09 2016 14:34
ok. its on my to-do list
Mark Wieczorek
@MarkWieczorek
Sep 09 2016 15:02

Also, which do you prefer? numpy doesn't use line breaks after the headers.

Evaluate the coefficients on a spherical grid.

Usage
-----

SHGridInstance = x.expand([grid, lmax, lmax_calc, zeros])

Parameters
----------

grid      : 'DH' or 'DH1' for an equisampled lat/lon grid with
            nlat=nlon, 'DH2' for an equidistant lat/lon grid with
            nlon=2*nlat, or 'GLQ' for a Gauss-Legendre quadrature grid.

or

Evaluate the coefficients on a spherical grid.

Usage
-----
SHGridInstance = x.expand([grid, lmax, lmax_calc, zeros])

Parameters
----------
grid      : 'DH' or 'DH1' for an equisampled lat/lon grid with
            nlat=nlon, 'DH2' for an equidistant lat/lon grid with
            nlon=2*nlat, or 'GLQ' for a Gauss-Legendre quadrature grid.
Ilya Oshchepkov
@ioshchepkov
Sep 09 2016 17:09
I think it is better to use less space. There is no harm to readability
And even an improvement from mobile point of view
Elliott Sales de Andrade
@QuLogic
Sep 09 2016 19:39
The parameter is not documented correctly, as far as numpydoc goes
Should be:
grid : str
    'DH' or 'DH1' for an equisampled lat/lon grid with nlat=nlon, .....
that is, name : type and description indented on the next line
Elliott Sales de Andrade
@QuLogic
Sep 09 2016 20:04
Also, copy=False is better than no_copy=True
Mark Wieczorek
@MarkWieczorek
Sep 09 2016 21:08
agreed, I'll start cleaning this up in about a week.