Skip to content

Commit c27341d

Browse files
mtfishmangithub-actions[bot]
authored andcommitted
Format .jl files (Runic)
1 parent b9f4f22 commit c27341d

25 files changed

+947
-939
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DerivableInterfaces"
22
uuid = "6c5e35bf-e59e-4898-b73c-732dcc4ba65f"
33
authors = ["ITensor developers <support@itensor.org> and contributors"]
4-
version = "0.5.5"
4+
version = "0.5.6"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

docs/make.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ using DerivableInterfaces: DerivableInterfaces
22
using Documenter: Documenter, DocMeta, deploydocs, makedocs
33

44
DocMeta.setdocmeta!(
5-
DerivableInterfaces, :DocTestSetup, :(using DerivableInterfaces); recursive=true
5+
DerivableInterfaces, :DocTestSetup, :(using DerivableInterfaces); recursive = true
66
)
77

88
include("make_index.jl")
99

1010
makedocs(;
11-
modules=[DerivableInterfaces],
12-
authors="ITensor developers <support@itensor.org> and contributors",
13-
sitename="DerivableInterfaces.jl",
14-
format=Documenter.HTML(;
15-
canonical="https://itensor.github.io/DerivableInterfaces.jl",
16-
edit_link="main",
17-
assets=["assets/favicon.ico", "assets/extras.css"],
18-
),
19-
pages=["Home" => "index.md", "Reference" => "reference.md"],
11+
modules = [DerivableInterfaces],
12+
authors = "ITensor developers <support@itensor.org> and contributors",
13+
sitename = "DerivableInterfaces.jl",
14+
format = Documenter.HTML(;
15+
canonical = "https://itensor.github.io/DerivableInterfaces.jl",
16+
edit_link = "main",
17+
assets = ["assets/favicon.ico", "assets/extras.css"],
18+
),
19+
pages = ["Home" => "index.md", "Reference" => "reference.md"],
2020
)
2121

2222
deploydocs(;
23-
repo="github.com/ITensor/DerivableInterfaces.jl", devbranch="main", push_preview=true
23+
repo = "github.com/ITensor/DerivableInterfaces.jl", devbranch = "main", push_preview = true
2424
)

docs/make_index.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ using Literate: Literate
22
using DerivableInterfaces: DerivableInterfaces
33

44
function ccq_logo(content)
5-
include_ccq_logo = """
5+
include_ccq_logo = """
66
```@raw html
77
<img class="display-light-only" src="assets/CCQ.png" width="20%" alt="Flatiron Center for Computational Quantum Physics logo."/>
88
<img class="display-dark-only" src="assets/CCQ-dark.png" width="20%" alt="Flatiron Center for Computational Quantum Physics logo."/>
99
```
1010
"""
11-
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
12-
return content
11+
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
12+
return content
1313
end
1414

1515
Literate.markdown(
16-
joinpath(pkgdir(DerivableInterfaces), "examples", "README.jl"),
17-
joinpath(pkgdir(DerivableInterfaces), "docs", "src");
18-
flavor=Literate.DocumenterFlavor(),
19-
name="index",
20-
postprocess=ccq_logo,
16+
joinpath(pkgdir(DerivableInterfaces), "examples", "README.jl"),
17+
joinpath(pkgdir(DerivableInterfaces), "docs", "src");
18+
flavor = Literate.DocumenterFlavor(),
19+
name = "index",
20+
postprocess = ccq_logo,
2121
)

docs/make_readme.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ using Literate: Literate
22
using DerivableInterfaces: DerivableInterfaces
33

44
function ccq_logo(content)
5-
include_ccq_logo = """
5+
include_ccq_logo = """
66
<picture>
77
<source media="(prefers-color-scheme: dark)" width="20%" srcset="docs/src/assets/CCQ-dark.png">
88
<img alt="Flatiron Center for Computational Quantum Physics logo." width="20%" src="docs/src/assets/CCQ.png">
99
</picture>
1010
"""
11-
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
12-
return content
11+
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
12+
return content
1313
end
1414

1515
Literate.markdown(
16-
joinpath(pkgdir(DerivableInterfaces), "examples", "README.jl"),
17-
joinpath(pkgdir(DerivableInterfaces));
18-
flavor=Literate.CommonMarkFlavor(),
19-
name="README",
20-
postprocess=ccq_logo,
16+
joinpath(pkgdir(DerivableInterfaces), "examples", "README.jl"),
17+
joinpath(pkgdir(DerivableInterfaces));
18+
flavor = Literate.CommonMarkFlavor(),
19+
name = "README",
20+
postprocess = ccq_logo,
2121
)

examples/README.jl

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# # DerivableInterfaces.jl
2-
#
2+
#
33
# [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://itensor.github.io/DerivableInterfaces.jl/stable/)
44
# [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://itensor.github.io/DerivableInterfaces.jl/dev/)
55
# [![Build Status](https://github.com/ITensor/DerivableInterfaces.jl/actions/workflows/Tests.yml/badge.svg?branch=main)](https://github.com/ITensor/DerivableInterfaces.jl/actions/workflows/Tests.yml?query=branch%3Amain)
@@ -60,56 +60,56 @@ julia> Pkg.add("DerivableInterfaces")
6060
# ## Examples
6161

6262
using DerivableInterfaces:
63-
DerivableInterfaces, @array_aliases, @derive, @interface, interface
63+
DerivableInterfaces, @array_aliases, @derive, @interface, interface
6464
using Test: @test
6565

6666
# Define an interface.
6767
struct SparseArrayInterface end
6868

6969
# Define interface functions.
7070
@interface ::SparseArrayInterface function Base.getindex(a, I::Int...)
71-
checkbounds(a, I...)
72-
!isstored(a, I...) && return getunstoredindex(a, I...)
73-
return getstoredindex(a, I...)
71+
checkbounds(a, I...)
72+
!isstored(a, I...) && return getunstoredindex(a, I...)
73+
return getstoredindex(a, I...)
7474
end
7575
@interface ::SparseArrayInterface function Base.setindex!(a, value, I::Int...)
76-
checkbounds(a, I...)
77-
iszero(value) && return a
78-
if !isstored(a, I...)
79-
setunstoredindex!(a, value, I...)
76+
checkbounds(a, I...)
77+
iszero(value) && return a
78+
if !isstored(a, I...)
79+
setunstoredindex!(a, value, I...)
80+
return a
81+
end
82+
setstoredindex!(a, value, I...)
8083
return a
81-
end
82-
setstoredindex!(a, value, I...)
83-
return a
8484
end
8585

8686
# Define a type that will derive the interface.
87-
struct SparseArrayDOK{T,N} <: AbstractArray{T,N}
88-
storage::Dict{CartesianIndex{N},T}
89-
size::NTuple{N,Int}
87+
struct SparseArrayDOK{T, N} <: AbstractArray{T, N}
88+
storage::Dict{CartesianIndex{N}, T}
89+
size::NTuple{N, Int}
9090
end
9191
storage(a::SparseArrayDOK) = a.storage
9292
Base.size(a::SparseArrayDOK) = a.size
9393
function SparseArrayDOK{T}(size::Int...) where {T}
94-
N = length(size)
95-
return SparseArrayDOK{T,N}(Dict{CartesianIndex{N},T}(), size)
94+
N = length(size)
95+
return SparseArrayDOK{T, N}(Dict{CartesianIndex{N}, T}(), size)
9696
end
9797
function isstored(a::SparseArrayDOK, I::Int...)
98-
return CartesianIndex(I) in keys(storage(a))
98+
return CartesianIndex(I) in keys(storage(a))
9999
end
100100
function getstoredindex(a::SparseArrayDOK, I::Int...)
101-
return storage(a)[CartesianIndex(I)]
101+
return storage(a)[CartesianIndex(I)]
102102
end
103103
function getunstoredindex(a::SparseArrayDOK, I::Int...)
104-
return zero(eltype(a))
104+
return zero(eltype(a))
105105
end
106106
function setstoredindex!(a::SparseArrayDOK, value, I::Int...)
107-
storage(a)[CartesianIndex(I)] = value
108-
return a
107+
storage(a)[CartesianIndex(I)] = value
108+
return a
109109
end
110110
function setunstoredindex!(a::SparseArrayDOK, value, I::Int...)
111-
storage(a)[CartesianIndex(I)] = value
112-
return a
111+
storage(a)[CartesianIndex(I)] = value
112+
return a
113113
end
114114

115115
# Specify the interface the type adheres to.
@@ -119,9 +119,9 @@ DerivableInterfaces.interface(::Type{<:SparseArrayDOK}) = SparseArrayInterface()
119119
@array_aliases SparseArrayDOK
120120

121121
# DerivableInterfaces the interface for the type.
122-
@derive (T=SparseArrayDOK,) begin
123-
Base.getindex(::T, ::Int...)
124-
Base.setindex!(::T, ::Any, ::Int...)
122+
@derive (T = SparseArrayDOK,) begin
123+
Base.getindex(::T, ::Int...)
124+
Base.setindex!(::T, ::Any, ::Int...)
125125
end
126126

127127
a = SparseArrayDOK{Float64}(2, 2)

ext/DerivableInterfacesBlockArraysExt/DerivableInterfacesBlockArraysExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using BlockArrays: BlockedOneTo, blockedrange, blocklengths
44
using DerivableInterfaces.Concatenate: Concatenate
55

66
function Concatenate.cat_axis(a1::BlockedOneTo, a2::BlockedOneTo)
7-
return blockedrange([blocklengths(a1); blocklengths(a2)])
7+
return blockedrange([blocklengths(a1); blocklengths(a2)])
88
end
99

1010
end

0 commit comments

Comments
 (0)