Skip to content

Commit

Permalink
Update versioning system and clean up imports
Browse files Browse the repository at this point in the history
Removed the separate version.py file and moved version directly into __init__.py for simplicity. Also, updated pyproject.toml to dynamically fetch the version from the package and streamlined imports by removing unnecessary warning suppressions.
  • Loading branch information
hpparvi committed Aug 6, 2024
1 parent 9f8cf5d commit 815e7d2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 77 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta"

[project]
name = "PyTransit"
version = "2.6.8"
description = 'Fast and painless exoplanet transit light curve modelling.'
authors=[{name='Hannu Parviainen', email='[email protected]'}]
classifiers=[
Expand All @@ -21,13 +20,14 @@ keywords = ['astronomy', 'astrophysics', 'exoplanets']
requires-python = ">= 3.8"
readme = "README.md"
license = {text = "GPLv2"}
dynamic = ["dependencies"]
dynamic = ["version", "dependencies"]

[project.urls]
homepage = 'https://github.com/hpparvi/PyTransit'

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
version = {attr = "pytransit.__version__"}

[tool.setuptools]
include-package-data = true
Expand Down
106 changes: 50 additions & 56 deletions pytransit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,59 +41,53 @@
"""

import warnings
from numba import NumbaDeprecationWarning

#TODO: Find where we're using generated_jit and fix it...

with warnings.catch_warnings():
warnings.simplefilter('ignore', NumbaDeprecationWarning)

from .version import __version__

# Generic
# -------
from .models.transitmodel import TransitModel
from .contamination.filter import DeltaFilter, BoxcarFilter, TabulatedFilter, sdss_g, sdss_r, sdss_i, sdss_z

# Numba models
# ------------
from .models.qpower2 import QPower2Model
from .models.ma_quadratic import QuadraticModel
from .models.ma_uniform import UniformModel
from .models.eclipse_model import EclipseModel
from .models.ma_chromosphere import ChromosphereModel
from .models.general import GeneralModel
from .models.osmodel import OblateStarModel
from .models.gdmodel import GravityDarkenedModel

from .models import RoadRunnerModel, OblatePlanetModel, TransmissionSpectroscopyModel

TSModel = TransmissionSpectroscopyModel
OPModel = OblatePlanetModel
RRModel = RoadRunnerModel

# OpenCL models
# -------------
from .models.qpower2_cl import QPower2ModelCL
from .models.ma_quadratic_cl import QuadraticModelCL
from .models.ma_uniform_cl import UniformModelCL

# LDTk limb darkening for the Swift model
# ---------------------------------------
from .models.ldtkldm import LDTkLDModel, LDTkLD

# Log posterior functions
# -----------------------
from .lpf.lpf import BaseLPF
from .lpf.transitlpf import TransitLPF
from .lpf.cntlpf import PhysContLPF
from .lpf.baselines.legendrebaseline import LegendreBaseline
from .lpf.baselines.linearbaseline import LinearModelBaseline
from .lpf.transitanalysis import TransitAnalysis

# Utilities
# ---------
from .param.parameter import UniformPrior, NormalPrior
from .utils import md_rs_from_rho
from .utils.mocklc import create_mock_light_curve
__version__ = '2.6.9'

# Generic
# -------
from .models.transitmodel import TransitModel
from .contamination.filter import DeltaFilter, BoxcarFilter, TabulatedFilter, sdss_g, sdss_r, sdss_i, sdss_z

# Numba models
# ------------
from .models.qpower2 import QPower2Model
from .models.ma_quadratic import QuadraticModel
from .models.ma_uniform import UniformModel
from .models.eclipse_model import EclipseModel
from .models.ma_chromosphere import ChromosphereModel
from .models.general import GeneralModel
from .models.osmodel import OblateStarModel
from .models.gdmodel import GravityDarkenedModel

from .models import RoadRunnerModel, OblatePlanetModel, TransmissionSpectroscopyModel

TSModel = TransmissionSpectroscopyModel
OPModel = OblatePlanetModel
RRModel = RoadRunnerModel

# OpenCL models
# -------------
from .models.qpower2_cl import QPower2ModelCL
from .models.ma_quadratic_cl import QuadraticModelCL
from .models.ma_uniform_cl import UniformModelCL

# LDTk limb darkening for the Swift model
# ---------------------------------------

from .models.ldtkldm import LDTkLDModel #, LDTkLD
from .models.ldtkldm import LDTkLD

# Log posterior functions
# -----------------------
from .lpf.lpf import BaseLPF
from .lpf.transitlpf import TransitLPF
from .lpf.cntlpf import PhysContLPF
from .lpf.baselines.legendrebaseline import LegendreBaseline
from .lpf.baselines.linearbaseline import LinearModelBaseline
from .lpf.transitanalysis import TransitAnalysis

# Utilities
# ---------
from .param.parameter import UniformPrior, NormalPrior
from .utils import md_rs_from_rho
from .utils.mocklc import create_mock_light_curve
19 changes: 0 additions & 19 deletions pytransit/version.py

This file was deleted.

0 comments on commit 815e7d2

Please sign in to comment.