Skip to content

Commit 04006f0

Browse files
authored
Merge pull request #9 from JuliaAstro/mg/ci
Switch CI to GitHub Actions
2 parents 7bd7057 + ab27dcb commit 04006f0

File tree

10 files changed

+121
-50
lines changed

10 files changed

+121
-50
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 59 14 * * *
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: "Add the General registry via Git"
11+
run: |
12+
import Pkg
13+
ENV["JULIA_PKG_SERVER"] = ""
14+
Pkg.Registry.add("General")
15+
shell: julia --color=yes {0}
16+
- name: "Install CompatHelper"
17+
run: |
18+
import Pkg
19+
name = "CompatHelper"
20+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
21+
version = "3"
22+
Pkg.add(; name, uuid, version)
23+
shell: julia --color=yes {0}
24+
- name: "Run CompatHelper"
25+
run: |
26+
import CompatHelper
27+
CompatHelper.main()
28+
shell: julia --color=yes {0}
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/TagBot.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
name: TagBot
22
on:
3-
schedule:
4-
- cron: 0 * * * *
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: 3
510
jobs:
611
TagBot:
12+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
713
runs-on: ubuntu-latest
814
steps:
915
- uses: JuliaRegistries/TagBot@v1
1016
with:
1117
token: ${{ secrets.GITHUB_TOKEN }}
18+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: "master"
6+
tags: ["*"]
7+
pull_request:
8+
release:
9+
10+
jobs:
11+
test:
12+
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
julia-version:
18+
- "1.6"
19+
- "1"
20+
- "nightly"
21+
os:
22+
- ubuntu-latest
23+
## macOS and Windows faile because of
24+
## https://github.com/cjdoris/PythonCall.jl/issues/165
25+
# - macos-latest
26+
# - windows-latest
27+
julia-arch:
28+
- x64
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: julia-actions/setup-julia@v1
32+
with:
33+
version: ${{ matrix.julia-version }}
34+
arch: ${{ matrix.julia-arch }}
35+
- uses: julia-actions/cache@v1
36+
- uses: julia-actions/julia-buildpkg@latest
37+
- uses: julia-actions/julia-runtest@latest
38+
- uses: julia-actions/julia-uploadcodecov@v0.1
39+
continue-on-error: true
40+
- uses: julia-actions/julia-uploadcoveralls@v0.1
41+
continue-on-error: true

.travis.yml

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

CondaPkg.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
channels = ["astropy", "conda-forge"]
2+
3+
[deps]
4+
python = "=3.7"
5+
astropy = "=4.3"
6+
reproject = "=0.5"

Project.toml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Reproject"
22
uuid = "d1dcc2e6-806e-11e9-2897-3f99785db2ae"
33
authors = ["Mosè Giordano", "Rohit Kumar"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
FITSIO = "525bcba6-941b-5504-bd06-fd0dc1a4d2eb"
@@ -10,13 +10,8 @@ SkyCoords = "fc659fc5-75a3-5475-a2ea-3da92c065361"
1010
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d"
1111

1212
[compat]
13-
julia = "^1.0.0"
14-
15-
[extras]
16-
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
17-
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
18-
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
19-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
20-
21-
[targets]
22-
test = ["Conda", "PyCall", "SHA", "Test"]
13+
FITSIO = "0.15, 0.16"
14+
Interpolations = "0.13"
15+
SkyCoords = "0.4, 1"
16+
WCS = "0.5, 0.6"
17+
julia = "1.6"

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Reproject
22

3-
[![Build Status](https://travis-ci.com/JuliaAstro/Reproject.jl.svg?branch=master)](https://travis-ci.com/JuliaAstro/Reproject.jl)
3+
[![CI](https://github.com/JuliaAstro/Reproject.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/JuliaAstro/Reproject.jl/actions/workflows/ci.yml)
44
[![Coveralls](https://coveralls.io/repos/github/JuliaAstro/Reproject.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaAstro/Reproject.jl?branch=master)
55
[![GitHub release](https://img.shields.io/github/release/JuliaAstro/Reproject.jl.svg)](https://github.com/JuliaAstro/Reproject.jl/releases/)
6-
[![HitCount](http://hits.dwyl.io/JuliaAstro/Reproject.jl.svg)](http://hits.dwyl.io/JuliaAstro/Reproject.jl)
76

87
Implementation in [Julia](https://julialang.org/) of the
98
[`reproject`](https://github.com/astropy/reproject) package by Thomas

test/Project.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[deps]
2+
FITSIO = "525bcba6-941b-5504-bd06-fd0dc1a4d2eb"
3+
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
4+
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
5+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6+
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d"
7+
8+
[compat]
9+
FITSIO = "0.15, 0.16"
10+
PythonCall = "0.8"
11+
WCS = "0.5, 0.6"
12+
julia = "1.6"

test/core.jl

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@ function download_dep(orig, dest, hash)
1414
end
1515

1616
@testset "reproject-core" begin
17-
download_dep("https://astropy.stsci.edu/data/galactic_center/gc_2mass_k.fits", "gc_2mass_k.fits",
17+
download_dep("https://www.astropy.org/astropy-data/galactic_center/gc_2mass_k.fits", "gc_2mass_k.fits",
1818
"763ef344df3ac8fa80ff46f00ca1ec59946ca3f99502562d6fcfb73320b1cec3")
19-
download_dep("https://astropy.stsci.edu/data/galactic_center/gc_msx_e.fits", "gc_msx_e.fits",
19+
download_dep("https://www.astropy.org/astropy-data/galactic_center/gc_msx_e.fits", "gc_msx_e.fits",
2020
"3687fb3763911825f981e74b6a9b82c0e618f7e592b1e0cb17e2c63164e28cd6")
2121

22-
imgin = FITS(joinpath("data", "gc_msx_e.fits")) # project this
23-
imgout = FITS(joinpath("data", "gc_2mass_k.fits")) # into this coordinate
22+
gc_msx_e = joinpath(@__DIR__, "data", "gc_msx_e.fits")
23+
gc_2mass_k = joinpath(@__DIR__, "data", "gc_2mass_k.fits")
2424

25-
hdu1 = astropy.io.fits.open(joinpath("data", "gc_2mass_k.fits"))[1]
26-
hdu2 = astropy.io.fits.open(joinpath("data", "gc_msx_e.fits"))[1]
25+
imgin = FITS(gc_msx_e) # project this
26+
imgout = FITS(gc_2mass_k) # into this coordinate
2727

28-
@test isapprox(reproject(imgin, imgout, order = 0)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 0)[1], nans = true, rtol = 1e-7)
29-
@test isapprox(reproject(imgout, imgin, order = 0)[1]', rp.reproject_interp(hdu1, hdu2.header, order = 0)[1], nans = true, rtol = 1e-6)
30-
@test isapprox(reproject(imgin, imgout, order = 1)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 1)[1], nans = true, rtol = 1e-7)
31-
@test isapprox(reproject(imgin, imgout, order = 2)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 2)[1], nans = true, rtol = 6e-2)
28+
hdu1 = astropy.io.fits.open(gc_2mass_k)[0]
29+
hdu2 = astropy.io.fits.open(gc_msx_e)[0]
30+
31+
@test isapprox(reproject(imgin, imgout, order = 0)[1]', pyconvert(Matrix, rp.reproject_interp(hdu2, hdu1.header, order = 0)[0]), nans = true, rtol = 1e-7)
32+
@test isapprox(reproject(imgout, imgin, order = 0)[1]', pyconvert(Matrix, rp.reproject_interp(hdu1, hdu2.header, order = 0)[0]), nans = true, rtol = 1e-6)
33+
@test isapprox(reproject(imgin, imgout, order = 1)[1]', pyconvert(Matrix, rp.reproject_interp(hdu2, hdu1.header, order = 1)[0]), nans = true, rtol = 1e-7)
34+
@test isapprox(reproject(imgin, imgout, order = 2)[1]', pyconvert(Matrix, rp.reproject_interp(hdu2, hdu1.header, order = 2)[0]), nans = true, rtol = 6e-2)
3235
@test isapprox(reproject(imgin[1], imgout[1], shape_out = (1000,1000))[1]',
33-
rp.reproject_interp(hdu2, astropy.wcs.WCS(hdu1.header), shape_out = (1000,1000))[1], nans = true, rtol = 1e-7)
36+
pyconvert(Matrix, rp.reproject_interp(hdu2, astropy.wcs.WCS(hdu1.header), shape_out = (1000,1000))[0]), nans = true, rtol = 1e-7)
3437

3538
wcs = WCSTransform(2; ctype = ["RA---AIR", "DEC--AIR"], radesys = "UNK")
3639
@test_throws ArgumentError reproject(imgin, wcs, shape_out = (100,100))

test/runtests.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
using Reproject
22
using Test
3-
using Conda, PyCall
3+
using PythonCall
44
using FITSIO, WCS
55
using SHA: sha256
66

7-
ENV["PYTHON"]=""
8-
Conda.add_channel("astropy")
9-
Conda.add("reproject")
107
rp = pyimport("reproject")
118
astropy = pyimport("astropy")
129

0 commit comments

Comments
 (0)