Skip to content

Commit e214752

Browse files
AlecThomsonAlec Thomsonpre-commit-ci[bot]
authored
Install (#93)
* Update env * Update docs * Fix tests * Formatting * style: pre-commit fixes * Clean up CI * Pre commit * style: pre-commit fixes * No sync --------- Co-authored-by: Alec Thomson <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 946508a commit e214752

File tree

17 files changed

+5236
-340
lines changed

17 files changed

+5236
-340
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
61
version: 2
72
updates:
8-
- package-ecosystem: "pip" # See documentation for possible values
9-
directory: "/" # Location of package manifests
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
106
schedule:
117
interval: "weekly"
12-
reviewers:
13-
- "AlecThomson"
8+
groups:
9+
actions:
10+
patterns:
11+
- "*"

.github/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- dependabot
5+
- pre-commit-ci

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
# Many color libraries just need this to be set to any value, but at least
16+
# one distinguishes color depth, where "3" -> "256-bit color".
17+
FORCE_COLOR: 3
18+
# Jupyter is migrating its paths to use standard platformdirs
19+
# given by the platformdirs library. To remove this warning and
20+
# see the appropriate new directories, set the environment variable
21+
# `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
22+
# The use of platformdirs will be the default in `jupyter_core` v6
23+
JUPYTER_PLATFORM_DIRS: 1
24+
25+
jobs:
26+
pre-commit:
27+
name: Format
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.x"
36+
- uses: pre-commit/[email protected]
37+
with:
38+
extra_args: --hook-stage manual --all-files
39+
40+
checks:
41+
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
42+
runs-on: ${{ matrix.runs-on }}
43+
needs: [pre-commit]
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
python-version: ["3.10", "3.11", "3.12", "3.13"]
48+
runs-on: [ubuntu-latest]
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
55+
- uses: actions/setup-python@v5
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
allow-prereleases: true
59+
60+
- name: Install package
61+
run: python -m pip install uv && uv pip install .[dev] --system
62+
63+
- name: Test package
64+
run: >-
65+
python -m pytest -ra --cov --cov-report=xml --cov-report=term
66+
--durations=20 --junitxml=junit.xml -o junit_family=legacy --ignore=submit
67+
68+
- name: Upload coverage reports to Codecov
69+
uses: codecov/codecov-action@v5
70+
with:
71+
token: ${{ secrets.CODECOV_TOKEN }}
72+
slug: AlecThomson/arrakis
73+
74+
- name: Upload test results to Codecov
75+
if: ${{ !cancelled() }}
76+
uses: codecov/test-results-action@v1
77+
with:
78+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/mirror.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/python-app.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ ci:
44

55
repos:
66
- repo: https://github.com/adamchainz/blacken-docs
7-
rev: "1.19.1"
7+
rev: "1.20.0"
88
hooks:
99
- id: blacken-docs
1010
additional_dependencies: [black==24.*]
1111

1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: "v5.0.0"
13+
rev: "v6.0.0"
1414
hooks:
1515
- id: check-added-large-files
1616
- id: check-case-conflict
@@ -33,7 +33,7 @@ repos:
3333
- id: rst-inline-touching-normal
3434

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

5656
- repo: https://github.com/python-jsonschema/check-jsonschema
57-
rev: "0.33.2"
57+
rev: "0.33.3"
5858
hooks:
5959
- id: check-dependabot
6060
- id: check-github-workflows

arrakis/frion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import argparse
77
import logging
88
import os
9+
from collections.abc import Callable
910
from pathlib import Path
1011
from pprint import pformat
11-
from typing import Callable
1212
from typing import NamedTuple as Struct
1313
from urllib.error import URLError
1414

arrakis/linmos.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from pathlib import Path
1313
from pprint import pformat
1414
from typing import NamedTuple as Struct
15+
from typing import overload
1516

1617
import astropy.units as u
1718
import numpy as np
@@ -216,9 +217,21 @@ def genparset(
216217
return parset_file
217218

218219

220+
@overload
221+
def linmos(
222+
parset: None, fieldname: str, image: str, holofile: Path | None = None
223+
) -> None: ...
224+
225+
226+
@overload
227+
def linmos(
228+
parset: str, fieldname: str, image: str, holofile: Path | None = None
229+
) -> pymongo.UpdateOne: ...
230+
231+
219232
@task(name="Run linmos")
220233
def linmos(
221-
parset: str | None, fieldname: str, image: str, holofile: Path
234+
parset: str | None, fieldname: str, image: str, holofile: Path | None = None
222235
) -> pymongo.UpdateOne | None:
223236
"""Run linmos
224237
@@ -248,12 +261,15 @@ def linmos(
248261
log_file = parset.replace(".in", ".log")
249262
linmos_command = shlex.split(f"linmos -c {parset}")
250263

251-
holo_folder = holofile.parent
264+
bind_dir_str = f"{rootdir}:{rootdir}"
265+
if holofile is not None:
266+
holo_folder = holofile.parent
267+
bind_dir_str += f",{holo_folder}:{holo_folder}"
252268

253269
output = sclient.execute(
254270
image=image,
255271
command=linmos_command,
256-
bind=f"{rootdir}:{rootdir},{holo_folder}:{holo_folder}",
272+
bind=bind_dir_str,
257273
return_result=True,
258274
quiet=False,
259275
stream=True,

arrakis/makecat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
import os
99
import time
1010
import warnings
11+
from collections.abc import Callable
1112
from pathlib import Path
1213
from pprint import pformat
13-
from typing import Callable, NamedTuple
14+
from typing import NamedTuple
1415

1516
import astropy.units as u
1617
import dask.dataframe as dd

0 commit comments

Comments
 (0)