Skip to content

Commit 01508f7

Browse files
committed
docs: fix
1 parent 2f5926f commit 01508f7

File tree

6 files changed

+41
-13
lines changed

6 files changed

+41
-13
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ authors = ["Beforerr <zzj956959688@gmail.com> and contributors"]
77
projects = ["test", "docs"]
88

99
[deps]
10+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
1011
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
1112

1213
[compat]
14+
Aqua = "0.8.14"
1315
PythonCall = "0.9"
1416
julia = "1.10"

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# SunPy
22

3-
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaSpacePhysics.github.io/SunPy.jl/stable/)
4-
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaSpacePhysics.github.io/SunPy.jl/dev/)
53
[![Build Status](https://github.com/JuliaSpacePhysics/SunPy.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaSpacePhysics/SunPy.jl/actions/workflows/CI.yml?query=branch%3Amain)
64
[![Coverage](https://codecov.io/gh/JuliaSpacePhysics/SunPy.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaSpacePhysics/SunPy.jl)
75
[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
86

9-
A Julia wrapper around [SunPy](https://github.com/sunpy/sunpy)
7+
A Julia wrapper around [SunPy](https://github.com/sunpy/sunpy)
8+
9+
**Installation**: at the Julia REPL, run `using Pkg; Pkg.add("https://github.com/JuliaSpacePhysics/SunPy.jl")`
10+
11+
**Documentation**: [![Dev](https://img.shields.io/badge/docs-dev-blue.svg?logo=julia)](https://JuliaSpacePhysics.github.io/SunPy.jl/dev/)

docs/make.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
using SunPy
22
using Documenter
3+
using PythonCall
34

4-
DocMeta.setdocmeta!(SunPy, :DocTestSetup, :(using SunPy); recursive = true)
5+
DocMeta.setdocmeta!(SunPy, :DocTestSetup, :(using SunPy))
6+
7+
# Download data first to render the documentation
8+
# Without `sunpy.data.sample.AIA_171_IMAGE` the CI stuck
9+
pyimport("sunpy.data.sample")
10+
sunpy.data.sample.AIA_171_IMAGE
511

612
makedocs(;
713
modules = [SunPy],

docs/src/index.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
```@meta
2-
CurrentModule = SunPy
3-
```
4-
51
# SunPy
62

73
Documentation for [SunPy](https://github.com/JuliaSpacePhysics/SunPy.jl).
@@ -13,9 +9,9 @@ Documentation for [SunPy](https://github.com/JuliaSpacePhysics/SunPy.jl).
139
Modules = [SunPy]
1410
```
1511

16-
## Quickstart
12+
## Acquiring Data
1713

18-
Using the [`Fido`](https://docs.sunpy.org/en/stable/generated/api/sunpy.net.Fido.html) interface (a unified data search and retrieval tool) to obtain solar data.
14+
Obtaining solar data using the [`Fido`](https://docs.sunpy.org/en/stable/generated/api/sunpy.net.Fido.html) interface (a unified data search and retrieval tool).
1915

2016
```@example sunpy
2117
using SunPy, PythonCall
@@ -24,13 +20,12 @@ Fido
2420
Fido.search(a.Time("2012/3/4", "2012/3/6"), a.Instrument.lyra, a.Level.two)
2521
```
2622

27-
`Map` object in sunpy.
23+
## Maps
2824

29-
<!-- https://docs.sunpy.org/en/stable/tutorial/maps.html -->
25+
`Map` object in [sunpy](https://docs.sunpy.org/en/stable/tutorial/maps.html).
3026

3127
```@example sunpy
3228
pyimport("sunpy.data.sample")
3329
sunpy.data.sample.AIA_171_IMAGE
3430
my_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
35-
# my_map.quicklook()
3631
```

src/types.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,17 @@ PythonCall.Py(mod::PythonModule) = getfield(mod, :mod)
1212
name in m.autoimports && return pyimport("$(py.__name__).$name")
1313
return getproperty(py, name)
1414
end
15+
16+
struct Map{T, N, A <: AbstractArray{T, N}} <: AbstractArray{T, N}
17+
py::Py
18+
data::A
19+
end
20+
21+
Base.size(m::Map) = Base.size(m.data)
22+
Base.getindex(m::Map, args...) = Base.getindex(m.data, args...)
23+
Base.show(io::IO, m::MIME"text/plain", map::Map) = Base.show(io, m, map.py)
24+
25+
function Map(path)
26+
py = sunpy.map.Map(path)
27+
return Map(py, PyArray(py.data; copy = false))
28+
end

test/runtests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ using Aqua
77
end
88

99
include("fido.jl")
10+
11+
@testset "Maps" begin
12+
using PythonCall
13+
pyimport("sunpy.data.sample")
14+
m = SunPy.Map(sunpy.data.sample.AIA_171_IMAGE)
15+
@test m isa AbstractArray
16+
@test size(m) == (1024, 1024)
17+
@test m[1] == -95.92475f0
18+
end

0 commit comments

Comments
 (0)