Skip to content

Commit

Permalink
Merge pull request #9 from JuliaAstro/mg/ci
Browse files Browse the repository at this point in the history
Switch CI to GitHub Actions
  • Loading branch information
giordano authored Apr 24, 2022
2 parents 7bd7057 + ab27dcb commit 04006f0
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 50 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CompatHelper
on:
schedule:
- cron: 59 14 * * *
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
11 changes: 9 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: "master"
tags: ["*"]
pull_request:
release:

jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version:
- "1.6"
- "1"
- "nightly"
os:
- ubuntu-latest
## macOS and Windows faile because of
## https://github.com/cjdoris/PythonCall.jl/issues/165
# - macos-latest
# - windows-latest
julia-arch:
- x64
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/[email protected]
continue-on-error: true
- uses: julia-actions/[email protected]
continue-on-error: true
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels = ["astropy", "conda-forge"]

[deps]
python = "=3.7"
astropy = "=4.3"
reproject = "=0.5"
17 changes: 6 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Reproject"
uuid = "d1dcc2e6-806e-11e9-2897-3f99785db2ae"
authors = ["Mosè Giordano", "Rohit Kumar"]
version = "0.3.0"
version = "0.3.1"

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

[compat]
julia = "^1.0.0"

[extras]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Conda", "PyCall", "SHA", "Test"]
FITSIO = "0.15, 0.16"
Interpolations = "0.13"
SkyCoords = "0.4, 1"
WCS = "0.5, 0.6"
julia = "1.6"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Reproject

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

Implementation in [Julia](https://julialang.org/) of the
[`reproject`](https://github.com/astropy/reproject) package by Thomas
Expand Down
12 changes: 12 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[deps]
FITSIO = "525bcba6-941b-5504-bd06-fd0dc1a4d2eb"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d"

[compat]
FITSIO = "0.15, 0.16"
PythonCall = "0.8"
WCS = "0.5, 0.6"
julia = "1.6"
25 changes: 14 additions & 11 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@ function download_dep(orig, dest, hash)
end

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

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

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

@test isapprox(reproject(imgin, imgout, order = 0)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 0)[1], nans = true, rtol = 1e-7)
@test isapprox(reproject(imgout, imgin, order = 0)[1]', rp.reproject_interp(hdu1, hdu2.header, order = 0)[1], nans = true, rtol = 1e-6)
@test isapprox(reproject(imgin, imgout, order = 1)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 1)[1], nans = true, rtol = 1e-7)
@test isapprox(reproject(imgin, imgout, order = 2)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 2)[1], nans = true, rtol = 6e-2)
hdu1 = astropy.io.fits.open(gc_2mass_k)[0]
hdu2 = astropy.io.fits.open(gc_msx_e)[0]

@test isapprox(reproject(imgin, imgout, order = 0)[1]', pyconvert(Matrix, rp.reproject_interp(hdu2, hdu1.header, order = 0)[0]), nans = true, rtol = 1e-7)
@test isapprox(reproject(imgout, imgin, order = 0)[1]', pyconvert(Matrix, rp.reproject_interp(hdu1, hdu2.header, order = 0)[0]), nans = true, rtol = 1e-6)
@test isapprox(reproject(imgin, imgout, order = 1)[1]', pyconvert(Matrix, rp.reproject_interp(hdu2, hdu1.header, order = 1)[0]), nans = true, rtol = 1e-7)
@test isapprox(reproject(imgin, imgout, order = 2)[1]', pyconvert(Matrix, rp.reproject_interp(hdu2, hdu1.header, order = 2)[0]), nans = true, rtol = 6e-2)
@test isapprox(reproject(imgin[1], imgout[1], shape_out = (1000,1000))[1]',
rp.reproject_interp(hdu2, astropy.wcs.WCS(hdu1.header), shape_out = (1000,1000))[1], nans = true, rtol = 1e-7)
pyconvert(Matrix, rp.reproject_interp(hdu2, astropy.wcs.WCS(hdu1.header), shape_out = (1000,1000))[0]), nans = true, rtol = 1e-7)

wcs = WCSTransform(2; ctype = ["RA---AIR", "DEC--AIR"], radesys = "UNK")
@test_throws ArgumentError reproject(imgin, wcs, shape_out = (100,100))
Expand Down
5 changes: 1 addition & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using Reproject
using Test
using Conda, PyCall
using PythonCall
using FITSIO, WCS
using SHA: sha256

ENV["PYTHON"]=""
Conda.add_channel("astropy")
Conda.add("reproject")
rp = pyimport("reproject")
astropy = pyimport("astropy")

Expand Down

2 comments on commit 04006f0

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/59050

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.1 -m "<description of version>" 04006f0c60e69635671a0396dcb3161bec952af9
git push origin v0.3.1

Please sign in to comment.