Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.3.0 #25

Merged
merged 4 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PTYQoL"
uuid = "551ad714-b11a-4605-8871-12721def4e72"
authors = ["Tianyi Pu <[email protected]> and contributors"]
version = "0.2.10"
version = "0.3.0"

[weakdeps]
AlgebraicNumbers = "e86d093a-a386-599e-b7c7-df0420c8bcba"
Expand All @@ -14,9 +14,9 @@ ClassicalOrthogonalPolynomials = "b30e2e7b-c4ee-47da-9d5f-2c5c27239acd"
ContinuumArrays = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
InfiniteArrays = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
QuasiArrays = "c4ea9172-b204-11e9-377d-29865faadc5c"

Expand All @@ -30,8 +30,7 @@ PTYQoLCircularArraysExt = "CircularArrays"
PTYQoLClassicalOrthogonalPolynomialsExt = "ClassicalOrthogonalPolynomials"
PTYQoLContinuumArraysExt = "ContinuumArrays"
PTYQoLDomainSetsExt = "DomainSets"
PTYQoLInfiniteArraysExt = "InfiniteArrays"
PTYQoLInfinitiesExt = "Infinities"
PTYQoLInfiniteArraysExt = ["InfiniteArrays", "LazyArrays"]
PTYQoLIntervalSetsExt = "IntervalSets"
PTYQoLIrrationalConstantsExt = "IrrationalConstants"
PTYQoLLinearAlgebraExt = "LinearAlgebra"
Expand All @@ -44,6 +43,8 @@ julia = "1"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BeepBeep = "97dd0070-d6c0-43ac-b134-ca84cdbd343e"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

Expand Down
13 changes: 12 additions & 1 deletion ext/PTYQoLInfiniteArraysExt.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
module PTYQoLInfiniteArraysExt

# ambiguities
import InfiniteArrays: RealInfinity, PosInfinity, ℵ₀, InfiniteCardinal
import InfiniteArrays: RealInfinity, PosInfinity, ℵ₀, InfiniteCardinal, LazyLayout, MemoryLayout, UnknownLayout
import Base: Colon, getindex, OverflowSafe, (:), getindex, OneTo, unitrange_last, _sub2ind_recurse
import LazyArrays: islazy_layout

MemoryLayout(a::CartesianIndices) = islazy_layout(typeof(a)) isa Val{true} ? LazyLayout() : UnknownLayout()
@generated function islazy_layout(::Type{CartesianIndices{N,T}}) where {N,T}
for t in T.types
if islazy_layout(t) isa Val{true}
return Val(true)
end
end
return Val(false)
end

(:)(start::RealInfinity, step::AbstractFloat, stop::RealInfinity) = (:)(promote(start, step)..., stop)
(:)(::PosInfinity, ::AbstractFloat, ::PosInfinity) = throw(ArgumentError("Cannot create range starting at infinity"))
Expand Down
91 changes: 0 additions & 91 deletions ext/PTYQoLInfinitiesExt.jl

This file was deleted.

8 changes: 7 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ using Test

@testset "https://github.com/JuliaLang/julia/pull/56433" begin
using Base: TwicePrecision
@test isapprox(Float64(π - Float32(π)) + Float32(π), Float64(π), rtol=1e-14)
using Base.MathConstants
for i in (π, ℯ, γ, catalan)
@test isapprox(Float32(i - Float16(i)) + Float16(i), Float32(i), rtol=1e-6)
@test isapprox(Float64(i - Float32(i)) + Float32(i), Float64(i), rtol=1e-14)
@test isapprox(BigFloat(i - Float64(i)) + Float64(i), BigFloat(i), rtol=1e-30)
@test abs(i-BigFloat(i)) ≥ 0.1*eps(BigFloat)
end
@test -π + π != 0
@test Float16(1):π:100 isa StepRangeLen{Float16,Float64,Float64,Int}
@test 1:π:100 isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64},Int}
Expand Down
Loading