Skip to content

Commit f51b59a

Browse files
committed
Return namedtuple of numpy arrays
1 parent 40f3e96 commit f51b59a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
author_email='[email protected]',
3030
license='GPL',
3131
packages=['ttvfast', ],
32+
install_requires=['numpy', ],
3233
ext_modules=[ttvfast, ],
3334
classifiers=[
3435
'Development Status :: 3 - Alpha',

ttvfast/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88

99
from collections import namedtuple
10+
import numpy as np
1011
from ._ttvfast import _ttvfast as _ttvfast_fn
1112
from . import models
1213

@@ -36,12 +37,12 @@ def ttvfast(planets, stellar_mass, time, dt, total, rv_times=None):
3637
positions, rv = _ttvfast_fn(params, dt, time, total, n_plan, input_flag, len_rv, rv_times)
3738

3839
return TTVFastResult(
39-
planets=positions[0],
40-
epochs=positions[1],
41-
times=positions[2],
42-
rsky=positions[3],
43-
vsky=positions[4],
44-
rv=rv
40+
planets=np.array(positions[0]),
41+
epochs=np.array(positions[1]),
42+
times=np.array(positions[2]),
43+
rsky=np.array(positions[3]),
44+
vsky=np.array(positions[4]),
45+
rv=np.array(rv) if rv else None,
4546
)
4647

4748
__all__ = ['ttvfast']

0 commit comments

Comments
 (0)