Skip to content

Commit

Permalink
Update to make complete package (#1)
Browse files Browse the repository at this point in the history
* Rename files

* Update code

* Add derivative work line to license

* Add missing repo files

* Add and use missing imports/deps

* Update authors
  • Loading branch information
sethaxen authored Sep 19, 2022
1 parent 701a209 commit 1bb5466
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
/Manifest.toml
/docs/build/
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2013 Forio and [Quaternions.jl contributors](https://github.com/JuliaGeometry/Quaternions.jl/graphs/contributors)
Copyright (c) 2022 Seth Axen <[email protected]> and Yuto Horikawa <[email protected]> and [Octonions.jl contributors](https://github.com/JuliaGeometry/Octonions.jl/graphs/contributors)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
18 changes: 18 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name = "Octonions"
uuid = "d00ba074-1e29-4f5e-9fd4-d67071d6a14d"
version = "0.1.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
Quaternions = "0.5.6"
julia = "1"

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

[targets]
test = ["Test"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Octonions

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaGeometry.github.io/Octonions.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaGeometry.github.io/Octonions.jl/dev/)
[![Build Status](https://github.com/JuliaGeometry/Octonions.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaGeometry/Octonions.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/JuliaGeometry/Octonions.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaGeometry/Octonions.jl)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Octonions = "d00ba074-1e29-4f5e-9fd4-d67071d6a14d"
25 changes: 25 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Octonions
using Documenter

DocMeta.setdocmeta!(Octonions, :DocTestSetup, :(using Octonions); recursive=true)

makedocs(;
modules=[Octonions],
authors="Seth Axen <[email protected]> and Yuto Horikawa <[email protected]> and contributors",
repo="https://github.com/JuliaGeometry/Octonions.jl/blob/{commit}{path}#{line}",
sitename="Octonions.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://JuliaGeometry.github.io/Octonions.jl",
edit_link="main",
assets=String[],
),
pages=[
"Home" => "index.md",
],
)

deploydocs(;
repo="github.com/JuliaGeometry/Octonions.jl",
devbranch="main",
)
14 changes: 14 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```@meta
CurrentModule = Octonions
```

# Octonions

Documentation for [Octonions](https://github.com/JuliaGeometry/Octonions.jl).

```@index
```

```@autodocs
Modules = [Octonions]
```
18 changes: 18 additions & 0 deletions src/Octonions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Octonions

import Base: +, -, *, /, ^, ==
import Base: abs, abs2, conj, exp, inv, isreal, isfinite, isinf, iszero, isnan, log, real, sqrt
import Base: promote_rule, float
import Base: rand, randn
import LinearAlgebra: normalize
using Quaternions: Quaternion
using Random

Base.@irrational INV_SQRT_EIGHT 0.3535533905932737622004 sqrt(big(0.125))

include("octonion.jl")

export Octonion, OctonionF16, OctonionF32, OctonionF64
export imag_part, normalize, normalizea, octo, octorand

end # module
File renamed without changes.
7 changes: 4 additions & 3 deletions test/Octonion.jl → test/octonion.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Quaternions
using LinearAlgebra
using Octonions
using Quaternions: Quaternion, QuaternionF64
using Random
using Test

Expand Down Expand Up @@ -168,7 +169,7 @@ using Test
qnorm = normalize(q)
@test real(q) === q.s
@test_throws MethodError imag(q)
@test @test_deprecated(Quaternions.imag(q)) == [q.v1, q.v2, q.v3, q.v4, q.v5, q.v6, q.v7]
@test @test_deprecated(Octonions.imag(q)) == [q.v1, q.v2, q.v3, q.v4, q.v5, q.v6, q.v7]
@test imag_part(q) === (q.v1, q.v2, q.v3, q.v4, q.v5, q.v6, q.v7)
@test conj(q) ===
Octonion(q.s, -q.v1, -q.v2, -q.v3, -q.v4, -q.v5, -q.v6, -q.v7, q.norm)
Expand All @@ -186,7 +187,7 @@ using Test
@test conj(conj(q)) === q
@test conj(conj(qnorm)) === qnorm
@test float(Octonion(1:8...)) === Octonion(1.0:8.0...)
@test Quaternions.abs_imag(q) ==
@test Octonions.abs_imag(q) ==
abs(Octonion(0, q.v1, q.v2, q.v3, q.v4, q.v5, q.v6, q.v7))
end

Expand Down
10 changes: 5 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Test
using Quaternions
using Octonions

include("helpers.jl")
include("Quaternion.jl")
include("Octonion.jl")
include("DualQuaternion.jl")
@testset "Octonions.jl" begin
include("helpers.jl")
include("octonion.jl")
end

2 comments on commit 1bb5466

@sethaxen
Copy link
Collaborator 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/68578

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.1.0 -m "<description of version>" 1bb5466b6a0632b571c676d7d91617942edff4cd
git push origin v0.1.0

Please sign in to comment.