Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "AlecThomson"
groups:
actions:
patterns:
- "*"
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3
# Jupyter is migrating its paths to use standard platformdirs
# given by the platformdirs library. To remove this warning and
# see the appropriate new directories, set the environment variable
# `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
# The use of platformdirs will be the default in `jupyter_core` v6
JUPYTER_PLATFORM_DIRS: 1

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual --all-files

checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install package
run: python -m pip install uv && uv pip install .[dev] --system

- name: Test package
run: >-
python -m pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20 --junitxml=junit.xml -o junit_family=legacy --ignore=submit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: AlecThomson/arrakis

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
24 changes: 0 additions & 24 deletions .github/workflows/mirror.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/python-app.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ ci:

repos:
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.19.1"
rev: "1.20.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==24.*]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
rev: "v6.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -33,7 +33,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.12.3"
rev: "v0.13.0"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -54,7 +54,7 @@ repos:
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.33.2"
rev: "0.33.3"
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
2 changes: 1 addition & 1 deletion arrakis/frion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import argparse
import logging
import os
from collections.abc import Callable
from pathlib import Path
from pprint import pformat
from typing import Callable
from typing import NamedTuple as Struct
from urllib.error import URLError

Expand Down
22 changes: 19 additions & 3 deletions arrakis/linmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pathlib import Path
from pprint import pformat
from typing import NamedTuple as Struct
from typing import overload

import astropy.units as u
import numpy as np
Expand Down Expand Up @@ -216,9 +217,21 @@ def genparset(
return parset_file


@overload
def linmos(
parset: None, fieldname: str, image: str, holofile: Path | None = None
) -> None: ...


@overload
def linmos(
parset: str, fieldname: str, image: str, holofile: Path | None = None
) -> pymongo.UpdateOne: ...


@task(name="Run linmos")
def linmos(
parset: str | None, fieldname: str, image: str, holofile: Path
parset: str | None, fieldname: str, image: str, holofile: Path | None = None
) -> pymongo.UpdateOne | None:
"""Run linmos
Expand Down Expand Up @@ -248,12 +261,15 @@ def linmos(
log_file = parset.replace(".in", ".log")
linmos_command = shlex.split(f"linmos -c {parset}")

holo_folder = holofile.parent
bind_dir_str = f"{rootdir}:{rootdir}"
if holofile is not None:
holo_folder = holofile.parent
bind_dir_str += f",{holo_folder}:{holo_folder}"

output = sclient.execute(
image=image,
command=linmos_command,
bind=f"{rootdir}:{rootdir},{holo_folder}:{holo_folder}",
bind=bind_dir_str,
return_result=True,
quiet=False,
stream=True,
Expand Down
3 changes: 2 additions & 1 deletion arrakis/makecat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import os
import time
import warnings
from collections.abc import Callable
from pathlib import Path
from pprint import pformat
from typing import Callable, NamedTuple
from typing import NamedTuple

import astropy.units as u
import dask.dataframe as dd
Expand Down
Loading
Loading