These are chat archives for SHTOOLS/SHTOOLS

22nd
Jul 2016
MMesch
@MMesch
Jul 22 2016 09:24
Hi @ioshchepkov
I added a few things to setup.py
did you have any further changes?
I am just trying to get numpy to build the F2PY part
and I have a question regarding:
download_url='https://github.com/SHTOOLS/SHTOOLS/releases'

I think it should be

download_url=("https://github.com/SHTOOLS/SHTOOLS/zipball/master")

MMesch
@MMesch
Jul 22 2016 10:49
@ioshchepkov I have moved the f2py build to setup.py
it is not working for the docs etc yet. But I wanted to push before going to eat, in case you are working on it as well...
the doc building has to be included and also there might be some minor issues with the libraries
MMesch
@MMesch
Jul 22 2016 12:31
@all , setup.py works on my computer. only the Fortran library is build by the makefile. Ultimately it should also be build by setup.py to ensure that the library versions are the same
try python setup.py build
you might need to adapt some flags, etc...
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 12:50
% python setup.py build
Traceback (most recent call last):
  File "setup.py", line 23, in <module>
    import ipdb
ImportError: No module named ipdb
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 13:02
can setup.py be used to install this module? Or do I really need to do it myself? If so, we'll need to add this to the instructions.
MMesch
@MMesch
Jul 22 2016 13:27
oups. It is not needed
I'll remove the input
it is the debugger
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 13:39
It mostly works, but I have naming issues concerning python, python2, pyhton3, f2py, f2py2, f2py3. Is there a way to fix this in the setup.py file (like checking whether f2py is for v2 or v3)?
MMesch
@MMesch
Jul 22 2016 13:39
what kind of naming issues?
I thought that import numpy.distutils.xxx will automatically choose the f2py that belongs to your numpy installation...
never tested if it actually works though
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 13:46
python setup.py build seems to work (v2.7), but if I use python3 it crashes
actually maybe it is ok, I'll look at this more tomorrow. Can setup.py uninstall as well?
MMesch
@MMesch
Jul 22 2016 13:49
yes it should
we need to add a clean part also
I think pip does the uninstall thing automatically
if it is possible to provide fftw3 with anaconda, we can even package it completely
MMesch
@MMesch
Jul 22 2016 14:28
I have added a Contributors.txt file with @ioshchepkov
@MarkWieczorek We should translate one or several examples to ipython notebooks.
examples and tests could be decoupled somewhat
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 14:31
you can add @qulogic too.
MMesch
@MMesch
Jul 22 2016 15:23
ok
MMesch
@MMesch
Jul 22 2016 15:40
pip install . works fine with python3 on my system
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 16:13
@MMesch I am wondering if we should make real and complex classes for the grids: DHRealGrid, DHComplexGrid, GLQRealGrid, GLQComplexGrid
The other option is to test np.iscomplexob(inputgrid) within the existing classes before calling any routine.
What's your preference?
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 16:22
For symmetry reasons with the real and complex coeff classes, maybe it is best to add real and complex DH and GLQ grid classes...
MMesch
@MMesch
Jul 22 2016 16:48
Yes. Any redundancy that can be avoided is good!
afterwards, it doesn't take much to implement the subclasses. Just the conversions between each possibility is really some work

This doesn't work:

__all__ += ['SHCoeffs', 'SHRealCoefficients', 'SHComplexCoefficients',
            'SHGrid', 'DHGrid', 'GLQGrid', 'SHWindow', 'SHSymmetricWindow',
            'SHAsymmetricWindow']


for _name, _func in _SHTOOLS.__dict__.items():
    if callable(_func):
        __all__.append(_name)

it doesn't import the functions into the namespace. So I added the star import from ._SHTOOLS import * again. If anyone knows a solution, pls add it.

Mark Wieczorek
@MarkWieczorek
Jul 22 2016 16:58
I think that works. All is only used in this circumstance (if I understand correctly)
>>> from pyshtools import *
Loading SHTOOLS -- version 3.3-beta
>>> dir()
['BAtoHilmDH', 'BAtoHilmRhoHDH', 'CilmMinusDH', 'CilmMinusRhoHDH', 'CilmPlusDH', 'CilmPlusRhoHDH', 'ComputeDG82', 'ComputeDMap', 'ComputeDm', 'Curve2Mask', 'DownContFilterMA', 'DownContFilterMC', 'EigValSym', 'EigValVecSym', 'EigValVecSymTri', 'GLQGridCoord', 'MakeCircleCoord', 'MakeEllipseCoord', 'MakeGeoidGridDH', 'MakeGravGradGridDH', 'MakeGravGridDH', 'MakeGrid2D', 'MakeGridDH', 'MakeGridDHC', 'MakeGridGLQ', 'MakeGridGLQC', 'MakeGridPoint', 'MakeMagGridDH', 'NormalGravity', 'PLegendre', 'PLegendreA', 'PLegendreA_d1', 'PLegendre_d1', 'PlBar', 'PlBar_d1', 'PlON', 'PlON_d1', 'PlSchmidt', 'PlSchmidt_d1', 'PlmBar', 'PlmBar_d1', 'PlmIndex', 'PlmON', 'PlmON_d1', 'PlmSchmidt', 'PlmSchmidt_d1', 'PreGLQ', 'RandomGaussian', 'RandomN', 'SHAdmitCorr', 'SHBias', 'SHBiasAdmitCorr', 'SHBiasK', 'SHCilmToCindex', 'SHCilmToVector', 'SHCindexToCilm', 'SHCoeffs', 'SHConfidence', 'SHCrossPowerDensityL', 'SHCrossPowerDensityLC', 'SHCrossPowerL', 'SHCrossPowerLC', 'SHCrossPowerSpectrum', 'SHCrossPowerSpectrumC', 'SHCrossPowerSpectrumDensity', 'SHCrossPowerSpectrumDensityC', 'SHExpandDH', 'SHExpandDHC', 'SHExpandGLQ', 'SHExpandGLQC', 'SHExpandLSQ', 'SHFindLWin', 'SHGLQ', 'SHGrid', 'SHLocalizedAdmitCorr', 'SHMTCouplingMatrix', 'SHMTDebias', 'SHMTVarOpt', 'SHMagPowerL', 'SHMagPowerSpectrum', 'SHMultiTaperCSE', 'SHMultiTaperSE', 'SHMultiply', 'SHPowerDensityL', 'SHPowerDensityLC', 'SHPowerL', 'SHPowerLC', 'SHPowerSpectrum', 'SHPowerSpectrumC', 'SHPowerSpectrumDensity', 'SHPowerSpectrumDensityC', 'SHRead', 'SHRead2', 'SHRead2Error', 'SHReadError', 'SHReadErrorH', 'SHReadH', 'SHReadJPL', 'SHReadJPLError', 'SHReturnTapers', 'SHReturnTapersM', 'SHReturnTapersMap', 'SHRotateCoef', 'SHRotateRealCoef', 'SHSjkPG', 'SHVectorToCilm', 'SHWindow', 'SHctor', 'SHrtoc', 'SphericalCapCoef', 'Wigner3j', 'YilmIndexVector', '_ConstantClass', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', '_ndarrayinfo', 'classes', 'constant', 'djpi2']
MMesch
@MMesch
Jul 22 2016 17:01
Yes. But the star import needs to still be there I think.
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 17:03

Agreed, did I delete it by accident?

Concerning the real/complex classes: we could easily get rid of SHRealCoeffs and SHComplexCoeffs if you wanted to. All you would need to do is check if np.iscomplexob(inputcoeffs) is true or not, and then call the appropriate pyshtools function in the classmethod.

Mark Wieczorek
@MarkWieczorek
Jul 22 2016 17:20
Actually, now I am a bit confused. In looking at the init file, you have both from . import _SHTOOLS and from . import _SHTOOLS *
It was working fine for me using only the second one. Why do we need the first one?
MMesch
@MMesch
Jul 22 2016 17:34
The first brings everything to the main pistols namespace. The second is just for looping through the functions
Mark Wieczorek
@MarkWieczorek
Jul 22 2016 19:22
I just tried each of the two imports separately in the init file, and from . import _SHTOOLS isn't necessary. It only loads the fortran routines into pyshtools._SHTOOLS, and not pyshtools. If you use from . import _SHTOOLS * not only does it load the fortran routines into pyshtools, but also pyshtools._SHTOOLS.