diff --git a/.travis.yml b/.travis.yml index e18f340..52b469d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: # The following versions are the 'default' for tests, unless # overridden underneath. They are defined here in order to save having # to repeat them for all configurations. - - PYTHON_VERSION=3.7 + - PYTHON_VERSION=3.8 - NUMPY_VERSION=stable - ASTROPY_VERSION=stable - MAIN_CMD='python setup.py' diff --git a/fleck/core.py b/fleck/core.py index 04f34d8..a71763e 100644 --- a/fleck/core.py +++ b/fleck/core.py @@ -130,7 +130,7 @@ def sort_plot_points(xy_coord, k0=0): n = len(xy_coord) distance_matrix = squareform(pdist(xy_coord, metric='euclidean')) mask = np.ones(n, dtype='bool') - sorted_order = np.zeros(n, dtype=np.int) + sorted_order = np.zeros(n, dtype=np.int32) indices = np.arange(n) i = 0 @@ -236,7 +236,7 @@ def light_curve(self, spot_lons, spot_lats, spot_radii, inc_stellar, inc_stellar, times=times, planet=planet, time_ref=time_ref) - + # Compute the distance of each spot from the stellar centroid, mask # any spots that are "behind" the star, in other words, x < 0 r = np.ma.masked_array(np.hypot(tilted_spots.y.value, @@ -348,14 +348,14 @@ def spherical_to_cartesian(self, spot_lons, spot_lats, inc_stellar, # Generate array of rotation matrices to rotate the spots about the # stellar rotation axis if times is None or (hasattr(times, '__len__') and times[0] is None): - rotate = rotation_matrix(self.phases[:, np.newaxis, np.newaxis], + rotate = rotation_matrix(self.phases[..., np.newaxis, np.newaxis], axis='z') else: if time_ref is None: time_ref = 0 rotational_phase = 2 * np.pi * ((times - time_ref) / self.rotation_period) * u.rad - rotate = rotation_matrix(rotational_phase[:, np.newaxis, np.newaxis], + rotate = rotation_matrix(rotational_phase[..., np.newaxis, np.newaxis], axis='z') rotated_spots = cartesian.transform(rotate) @@ -747,7 +747,8 @@ def generate_spots(min_latitude, max_latitude, spot_radius, n_spots, delta_latitude = max_latitude - min_latitude if n_inclinations is not None and inclinations is None: inc_stellar = np.arccos(np.random.rand(n_inclinations)) - inc_stellar *= np.sign(np.random.uniform(-1, 1, n_inclinations)) * u.deg + inc_stellar = inc_stellar * np.sign(np.random.uniform(-1, 1, n_inclinations)) * u.rad + inc_stellar = inc_stellar.to(u.deg) else: n_inclinations = len(inclinations) if not inclinations.isscalar else 1 inc_stellar = inclinations