These are chat archives for SHTOOLS/SHTOOLS

28th
Jul 2016
MMesch
@MMesch
Jul 28 2016 08:51
The last thing that doesn't work is pip install -e . . It doesn't build the docs.
MMesch
@MMesch
Jul 28 2016 12:25
The shclasses module is not copied by setup.py
It should work again now.
I also used globals() to get rid of the star import:
# --- Import all functions into pyshtools namespace ----
for _name, _func in _SHTOOLS.__dict__.items():
    if callable(_func):
        __all__.append(_name)
        globals()[_name] = _func
Ilya Oshchepkov
@ioshchepkov
Jul 28 2016 12:34
Yep, in #33 I also fixed shclasses...
MMesch
@MMesch
Jul 28 2016 12:34
u ok. Sorry
I'll merge it
Ilya Oshchepkov
@ioshchepkov
Jul 28 2016 13:01
@all Can we remove empty lib and modules directories from root path and add their creation to the Makefile?
Mark Wieczorek
@MarkWieczorek
Jul 28 2016 13:26
I refactored the init file again by loading everything from submodules. The main namespace now only contains the three main classes, shtools (which groups all the routines), and submodules for legendre, expand, rotate, gravmag, etc. If you have any comments, let me know: SHTOOLS/SHTOOLS#34
I'll look at the empty folders. There was I reason I did this, but now I don't remember why. You're right that they can probably just be created in the make file (how does the setup.py file deal with this?)
Also, I just started having problems importing the _SHTOOLS.so file in python2.7. I have no idea why this is happening now and I can't quite figure out what the problem is. Everything works fine in python3.
% python2.7
Python 2.7.12 (default, Jun 29 2016, 14:05:02) 
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _SHTOOLS
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: numpy.core.multiarray failed to import
Has anyone seen anything like this before?
MMesch
@MMesch
Jul 28 2016 13:31
Did you build with python3?
Mark Wieczorek
@MarkWieczorek
Jul 28 2016 13:32
I built with both, and I have both _SHTOOLS.cpython-35m-darwin.so _SHTOOLS.so
Ilya Oshchepkov
@ioshchepkov
Jul 28 2016 13:32
@MarkWieczorek setup.py doesn't need them at all
Mark Wieczorek
@MarkWieczorek
Jul 28 2016 13:34
This worked before, so I don't get it. It might be related to an new version of numpy I installed.
MMesch
@MMesch
Jul 28 2016 13:38
possible.
I think its a good idea to make submodules.
Mark Wieczorek
@MarkWieczorek
Jul 28 2016 13:50
let me know if I did it correctly....
MMesch
@MMesch
Jul 28 2016 13:56
I think so. Do you read the documentation in the main __init__.py file?
I don't know whether that works
Ilya Oshchepkov
@ioshchepkov
Jul 28 2016 14:31
submodules look good, but maybe move classes in root dir too?
Mark Wieczorek
@MarkWieczorek
Jul 28 2016 16:31
I'll look into the shclasses directory later...