Commit 902f9a57 authored by Gaetano Scandariato's avatar Gaetano Scandariato
Browse files

chore: declare equinox, bound JAX and Python, add lint and fast-test CI jobs

parent d3feeac9
Loading
Loading
Loading
Loading
+31 −0
Changes for .gitlab-ci.yml: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Checks on every push and merge request: formatting, lint and the fast tests
# on CPU (`-m "not slow"`; the slow tests, which run samplers for many steps or
# time compilation, run in the full local suite before each release).
stages:
  - test
  - deploy

lint:
  stage: test
  image: python:3.13-slim
  timeout: 15 minutes
  script:
    - pip install --quiet black ruff
    - black --check src tests
    - ruff check src tests

tests:
  stage: test
  image: python:3.13-slim
  timeout: 45 minutes
  variables:
    JAX_PLATFORMS: cpu
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  cache:
    paths:
      - .cache/pip
  script:
    - apt-get update -qq && apt-get install -y -qq git > /dev/null
    - pip install --quiet -e ".[dev]"
    - python -m pytest -q -m "not slow" --disable-warnings

pages:
  stage: deploy
  image: alpine:latest
+9 −4
Changes for pyproject.toml: 9 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -13,14 +13,13 @@ authors = [
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
requires-python = ">=3.10"
requires-python = ">=3.11"
keywords = ["exoplanets", "astronomy", "mcmc", "bayesian", "jax", "numpyro", "transit", "phase-curve"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Science/Research",
    "Topic :: Scientific/Engineering :: Astronomy",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
@@ -28,8 +27,11 @@ classifiers = [
]

dependencies = [
    "jax>=0.4.0",
    "jaxlib>=0.4.0",
    # jax.shard_map with check_vma needs JAX 0.7; tested up to 0.11 (JAX changes
    # its API between minor versions, so the upper bound is the last one tested)
    "jax>=0.7,<0.12",
    "jaxlib>=0.7,<0.12",
    "equinox>=0.11",
    "jaxoplanet>=0.1.0",
    "numpyro>=0.22.0",
    "numpy>=2.0",
@@ -90,6 +92,9 @@ testpaths = ["tests"]
# however pytest is launched (`pytest` or `python -m pytest`).
pythonpath = ["."]
addopts = ["--strict-markers"]
# `pytest -m "not slow"` skips the tests that run samplers for many steps or time
# compilation (the CI job); the full suite still runs them.
markers = ["slow: runs samplers or times compilation (minutes); skipped by `-m 'not slow'`"]

# ---------------------------------------------------------------------------
# Black – the uncompromising code formatter
+0 −2
Changes for runPyAETNA.py: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -35,7 +35,5 @@ if __name__ == "__main__":
            # "examples/test_spectral_mixture.yaml",
        ]

        configFiles = ["examples/test_spectral_mixture.yaml"]

    # data.working_dir and data.file_path are read from each YAML file
    main(configFiles)