Skip to content

Commit

Permalink
- Made sure LDTk is an optional dependency.
Browse files Browse the repository at this point in the history
- Bumped up the version number.
  • Loading branch information
hpparvi committed Nov 26, 2024
1 parent 344bb58 commit 8caf8d9
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers=[
]

keywords = ['astronomy', 'astrophysics', 'exoplanets']
requires-python = ">= 3.8"
requires-python = ">= 3.10"
readme = "README.md"
license = {text = "GPLv2"}
dynamic = ["version", "dependencies"]
Expand Down
8 changes: 5 additions & 3 deletions pytransit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"""

__version__ = '2.6.11'
__version__ = '2.6.12'

# Generic
# -------
Expand Down Expand Up @@ -74,8 +74,10 @@
# LDTk limb darkening for the Swift model
# ---------------------------------------

from .models.ldtkldm import LDTkLDModel #, LDTkLD
from .models.ldtkldm import LDTkLD
try:
from .models.ldtkldm import LDTkLDModel, LDTkLD
except ImportError:
pass

# Log posterior functions
# -----------------------
Expand Down
3 changes: 3 additions & 0 deletions pytransit/lpf/lpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ def add_ldtk_prior(self, teff: tuple, logg: tuple, z: tuple, passbands: tuple,
raise DeprecationWarning(
'Passing passbands by name has been deprecated, they should be now Filter instances.')

if not with_ldtk:
raise ModuleNotFoundError('Could not import LDTk, cannot add an LDTk prior.')

self.ldsc = LDPSetCreator(teff, logg, z, list(passbands))
self.ldps = self.ldsc.create_profiles(1000)
self.ldps.resample_linear_z()
Expand Down
1 change: 0 additions & 1 deletion pytransit/lpf/tess/ctesslpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from numpy import repeat, inf, where, newaxis, squeeze, atleast_2d, isfinite, concatenate, zeros
from numpy.random import uniform
from uncertainties import ufloat, UFloat
from ldtk import tess

from ..tesslpf import TESSLPF
from ...param import UniformPrior as UP, NormalPrior as NP, PParameter
Expand Down
2 changes: 0 additions & 2 deletions pytransit/lpf/tess/tmpclpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
from pytransit.lpf.tesslpf import TESSLPF, downsample_time
from pytransit.orbits import as_from_rhop, i_from_ba
from pytransit.param import UniformPrior as UP, NormalPrior as NP, PParameter, GParameter
from ldtk import tess
from pytransit.utils.misc import fold
from scipy.ndimage import label
from uncertainties import ufloat, UFloat


Expand Down
2 changes: 1 addition & 1 deletion pytransit/lpf/tesslpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def add_ldtk_prior(teff, logg, z):
if with_ldtk:
super().add_ldtk_prior(teff, logg, z, passbands=(tess,))
else:
raise ImportError('Could not import LDTk, cannot add an LDTk prior.')
raise ModuleNotFoundError('Could not import LDTk, cannot add an LDTk prior.')

def plot_individual_transits(self, solution: str = 'de', pv: ndarray = None, ncols: int = 2, n_samples: int = 100,
xlim: tuple = None, ylim: tuple = None, axs=None, figsize: tuple = None,
Expand Down
3 changes: 1 addition & 2 deletions pytransit/models/ldtkldm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
from typing import Tuple, Optional, Union
from pathlib import Path

from numpy import ndarray, linspace, meshgrid, transpose, asarray, newaxis, errstate
from numba import njit
from numpy import zeros, interp, pi, ndarray, linspace, meshgrid, transpose, asarray, newaxis, errstate
from scipy.interpolate import interpn, interpnd, RegularGridInterpolator as RGI

from .ldmodel import LDModel
from .numba.ldtkldm import trilinear_interpolation_set, integrate_profiles_set
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ setuptools
deprecated
seaborn
emcee
ldtk
pyopencl
corner
celerite
Expand Down

0 comments on commit 8caf8d9

Please sign in to comment.