Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eigen and boost #6

Open
hposborn opened this issue Aug 2, 2016 · 5 comments
Open

Eigen and boost #6

hposborn opened this issue Aug 2, 2016 · 5 comments

Comments

@hposborn
Copy link

hposborn commented Aug 2, 2016

I cant seem to install transit. The build_ext seems to need to point to an Eigen3 directory (instead or as well as boost, I'm not sure?). When I install with that (either with pip or with setup.py), it seems to work fine but the nosetests fail with the error:

  File "transit/transit.py", line 8, in <module>
    from ._transit import CythonSolver
ImportError: No module named _transit`

Which seems to me to be a problem due to not finding boost and being unable to load the .pyx/.cpp module? I've tried importing the .pyx module with Cython, but that fails too. Any ideas how to fix this? Is my boost not built properly?

@dfm
Copy link
Owner

dfm commented Aug 2, 2016

I'm not at my computer now but this normally means that you're in the cloned directory. What happens if you navigate elsewhere and import transit? If not, I'll try to sort out of later today.

@hposborn
Copy link
Author

hposborn commented Aug 2, 2016

Oh ok; you were right - I was in the transit folder, so that will be why.
It seems to import transit (and _transit) ok outside of the cloned directory, and the simple exercises work. Nosetests still seems to fail though, this time because of this:

  File "__init__.pxd", line 155, in init transit._transit (transit/_transit.cpp:6658)
ValueError: numpy.dtype has the wrong size, try recompiling. Expected 88, got 96

But hopefully that's just something to do with my nose install?

@dfm
Copy link
Owner

dfm commented Aug 2, 2016

This looks like a numpy version incompatibility ref. Sometimes nose uses a different version of numpy than your standard python. If you didn't get this error when you imported, I wouldn't worry about it. Unfortunately, the tests will probably fail anyways… I've been pretty bad on staying on top of these ones!

@hposborn
Copy link
Author

hposborn commented Aug 4, 2016

I wonder if the same numpy problem is the reason behind another strange effect I'm seeing?
Basically, if I make a lightcurve model with a generated time array (eg np.arange), all is fine. When I use the times directly from K2, I don't get a smooth integration across a transit lightcurve. Instead, only every third exposure has the transit in, the duration is longer, and the tcen is shifted by an apparently random amount. Weirdly, despite the fact the time array is sorted, the effect dissappears when I run:

mod=s.light_curve(np.sort(times))

So I wonder if transit is somehow unsorting it?

@dfm
Copy link
Owner

dfm commented Aug 8, 2016

Crazy! Probably has something to do with byte order... what happens if you do: mod = s.light_curve(np.array(times, dtype=np.float64, order='C'))?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants