Skip to content

Commit e7272be

Browse files
Merge pull request #2 from JuliaSpaceMissionDesign/dev
Update to version 1.1.6
2 parents a5c5f4e + 772aae9 commit e7272be

File tree

6 files changed

+48
-18
lines changed

6 files changed

+48
-18
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ jobs:
1313
matrix:
1414
version:
1515
- '1.8'
16+
- '1.9'
1617
- nightly
1718
os:
1819
- ubuntu-latest
1920
arch:
2021
- x64
2122
steps:
22-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2324
- uses: julia-actions/setup-julia@v1
2425
with:
2526
version: ${{ matrix.version }}

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CalcephEphemeris"
22
uuid = "54e8752a-b65a-4aac-bda5-4918ee1e3cc5"
33
authors = ["JSMD Team"]
4-
version = "1.1.5"
4+
version = "1.1.6"
55

66
[deps]
77
CALCEPH = "1537fe66-4725-5aba-80f4-3a74792cecc1"
@@ -10,7 +10,7 @@ JSMDInterfaces = "6b30ee2f-618e-4a15-bf4e-7df7b496e609"
1010
[compat]
1111
CALCEPH = "1.1"
1212
julia = "1"
13-
JSMDInterfaces = "1.2"
13+
JSMDInterfaces = "1.3"
1414

1515
[extras]
1616
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This package is a lightweight wrapper around [CALCEPH.jl](https://github.com/Jul
1515
This package can be installed using Julia's package manager:
1616
```julia
1717
julia> import Pkg;
18+
1819
julia> Pkg.add("CalcephEphemeris.jl")
1920
```
2021

docs/src/index.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
_A lightweight CALCEPH.jl wrapper for the JSMD ecosystem._
44

5-
This package is a lightweight wrapper around [CALCEPH.jl](https://github.com/JuliaAstro/CALCEPH.jl)
6-
that implements the [JSMDInterfaces.jl](https://github.com/JuliaSpaceMissionDesign/JSMDInterfaces.jl)
7-
interfaces to extract data from SPICE and INPOP ephemeris kernels.
5+
This package is a lightweight wrapper around [CALCEPH.jl](https://github.com/JuliaAstro/CALCEPH.jl) that implements the [JSMDInterfaces.jl](https://github.com/JuliaSpaceMissionDesign/JSMDInterfaces.jl) interfaces to extract data from SPICE and INPOP ephemeris kernels.
86

97
The CALCEPH is a C++ library written by the research team Astronomie et systèmes dynamiques
108
(CNRS/Observatoire de Paris/IMCCE). For further information on CALCEPH visit its
119
[official website](https://www.imcce.fr/inpop/calceph) or its original
1210
[Julia wrapper](https://github.com/JuliaAstro/CALCEPH.jl).
11+
12+
13+
## Installation
14+
15+
This package can be installed using Julia's package manager:
16+
17+
```julia
18+
julia> import Pkg;
19+
20+
julia> Pkg.add("CalcephEphemeris.jl")
21+
```

src/CalcephEphemeris.jl

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,39 @@ files specified by `files`.
3535
### Example
3636
```julia-repl
3737
julia> eph1 = CalcephProvider("PATH_TO_KERNEL")
38-
CalcephProvider(CALCEPH.Ephem(Ptr{Nothing} [...]))
38+
1-kernel CalcephProvider
39+
"PATH_TO_KERNEL"
3940
4041
julia> eph2 = CalcephProvider(["PATH_TO_KERNEL_1", "PATH_TO_KERNEL_2"])
41-
CalcephProvider(CALCEPH.Ephem(Ptr{Nothing} [...]))
42+
2-kernel CalcephProvider:
43+
"PATH_TO_KERNEL_1"
44+
"PATH_TO_KERNEL_2"
4245
```
4346
"""
4447
struct CalcephProvider <: jEph.AbstractEphemerisProvider
4548
ptr::CalcephEphemHandler
49+
files::Vector{String}
4650
function CalcephProvider(files::Vector{<:AbstractString})
47-
ptr = CalcephEphemHandler(unique(files))
51+
filepaths = unique(files)
52+
ptr = CalcephEphemHandler(filepaths)
4853
prefetch(ptr)
49-
return new(ptr)
54+
return new(ptr, filepaths)
5055
end
5156
end
57+
5258
CalcephProvider(file::AbstractString) = CalcephProvider([file])
5359

60+
function Base.show(io::IO, eph::CalcephProvider)
61+
print(io, "$(length(eph.files))-kernel CalcephProvider")
62+
end
63+
64+
function Base.show(io::IO, ::MIME"text/plain", eph::CalcephProvider)
65+
println(io, eph, ":")
66+
for file in eph.files
67+
println(io, " $(repr(file))")
68+
end
69+
end
70+
5471
jEph.load(::Type{CalcephProvider}, file::AbstractString) = CalcephProvider(file)
5572

5673
function jEph.load(::Type{CalcephProvider}, files::Vector{<:AbstractString})
@@ -68,7 +85,7 @@ end
6885
"""
6986
ephem_position_records(eph::CalcephProvider)
7087
71-
Get an array of [`jEph.EphemPointRecord`](@ref), providing detailed informations on the
88+
Get an array of `EphemPointRecord`, providing detailed informations on the
7289
position content of the ephemeris file.
7390
"""
7491
function jEph.ephem_position_records(eph::CalcephProvider)
@@ -95,7 +112,7 @@ end
95112
"""
96113
ephem_orient_records(eph::CalcephProvider)
97114
98-
Get an array of [`jEph.EphemAxesRecord`](@ref), providing detailed
115+
Get an array of `EphemAxesRecord`, providing detailed
99116
informations on the orientation content of the ephemeris file.
100117
"""
101118
function jEph.ephem_orient_records(eph::CalcephProvider)
@@ -177,9 +194,6 @@ must be equal to 3*order:
177194
- res[10:12] contain the jerk (d³x/dt³, d³y/dt³, d³z/dt³) for order ≥ 3
178195
179196
The values stores in `res` are always returned in km, km/s, km/s², km/s³
180-
181-
### See also
182-
See also [`ephem_orient!`](@ref)
183197
"""
184198
function jEph.ephem_compute!(
185199
res,
@@ -229,9 +243,6 @@ The values stores in `res` are always returned in rad, rad/s, rad/s², rad/s³
229243
!!! note
230244
The `center` argument is only requested for compatibility reasons but is neglected
231245
by CALCEPH.
232-
233-
### See also
234-
See also [`ephem_compute!`](@ref)
235246
"""
236247
function jEph.ephem_orient!(
237248
res, eph::CalcephProvider, jd0::Number, time::Number, target::Int, ::Int, order::Int

test/runtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ end;
2626

2727
kern = jEphem.load(CalcephProvider, [path_pa421, path_de432])
2828

29+
# Test CalcephProvider printing
30+
@test repr(de432) == "1-kernel CalcephProvider"
31+
@test repr(CalcephProvider([path_de432, path_pa421])) == "2-kernel CalcephProvider"
32+
33+
io = IOBuffer();
34+
show(IOContext(io, :limit => false), "text/plain", de432)
35+
@test String(take!(io)) == "1-kernel CalcephProvider:\n \"$path_de432\"\n"
36+
2937
points = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 199, 299, 301, 399]
3038
axes = [1, 31006]
3139

0 commit comments

Comments
 (0)