Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "CompatHelper"

on:
schedule:
- cron: 0 0 * * *
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: "Format Check"

on:
push:
branches:
- 'main'
tags: '*'
pull_request:
pull_request_target:
paths: ['**/*.jl']
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
actions: write
pull-requests: write

jobs:
format-check:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
.vscode/
Manifest.toml
benchmark/*.json
dev/
docs/LocalPreferences.toml
docs/Manifest.toml
docs/build/
docs/src/index.md
examples/LocalPreferences.toml
test/LocalPreferences.toml
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ci:
skip: [julia-formatter]
skip: [runic]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -11,7 +11,7 @@ repos:
- id: end-of-file-fixer
exclude_types: [markdown] # incompatible with Literate.jl

- repo: "https://github.com/domluna/JuliaFormatter.jl"
rev: v2.1.6
- repo: https://github.com/fredrikekre/runic-pre-commit
rev: v2.0.1
hooks:
- id: "julia-formatter"
- id: runic
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SparseArraysBase"
uuid = "0d5efcca-f356-4864-8770-e1ed8d78f208"
authors = ["ITensor developers <support@itensor.org> and contributors"]
version = "0.7.4"
version = "0.7.5"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ julia> Pkg.add("SparseArraysBase")

````julia
using SparseArraysBase:
SparseArrayDOK,
SparseMatrixDOK,
SparseVectorDOK,
eachstoredindex,
getstoredindex,
getunstoredindex,
isstored,
setstoredindex!,
setunstoredindex!,
storedlength,
storedpairs,
storedvalues,
zero!
SparseArrayDOK,
SparseMatrixDOK,
SparseVectorDOK,
eachstoredindex,
getstoredindex,
getunstoredindex,
isstored,
setstoredindex!,
setunstoredindex!,
storedlength,
storedpairs,
storedvalues,
zero!
using Test: @test, @test_throws

a = SparseArrayDOK{Float64}(undef, 2, 2)
Expand Down Expand Up @@ -135,14 +135,14 @@ b = a[1:2, 2]
a = SparseArrayDOK{Float64}(undef, 2, 2)
a .= 2
for I in eachindex(a)
@test a[I] == 2
@test a[I] == 2
end
@test storedlength(a) == length(a)

a = SparseArrayDOK{Float64}(undef, 2, 2)
fill!(a, 2)
for I in eachindex(a)
@test a[I] == 2
@test a[I] == 2
end
@test storedlength(a) == length(a)

Expand Down
22 changes: 11 additions & 11 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ using SparseArraysBase: SparseArraysBase
using Documenter: Documenter, DocMeta, deploydocs, makedocs

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

include("make_index.jl")

makedocs(;
modules=[SparseArraysBase],
authors="ITensor developers <support@itensor.org> and contributors",
sitename="SparseArraysBase.jl",
format=Documenter.HTML(;
canonical="https://itensor.github.io/SparseArraysBase.jl",
edit_link="main",
assets=["assets/favicon.ico", "assets/extras.css"],
),
pages=["Home" => "index.md", "Reference" => "reference.md"],
modules = [SparseArraysBase],
authors = "ITensor developers <support@itensor.org> and contributors",
sitename = "SparseArraysBase.jl",
format = Documenter.HTML(;
canonical = "https://itensor.github.io/SparseArraysBase.jl",
edit_link = "main",
assets = ["assets/favicon.ico", "assets/extras.css"],
),
pages = ["Home" => "index.md", "Reference" => "reference.md"],
)

deploydocs(;
repo="github.com/ITensor/SparseArraysBase.jl", devbranch="main", push_preview=true
repo = "github.com/ITensor/SparseArraysBase.jl", devbranch = "main", push_preview = true
)
16 changes: 8 additions & 8 deletions docs/make_index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ using Literate: Literate
using SparseArraysBase: SparseArraysBase

function ccq_logo(content)
include_ccq_logo = """
include_ccq_logo = """
```@raw html
<img class="display-light-only" src="assets/CCQ.png" width="20%" alt="Flatiron Center for Computational Quantum Physics logo."/>
<img class="display-dark-only" src="assets/CCQ-dark.png" width="20%" alt="Flatiron Center for Computational Quantum Physics logo."/>
```
"""
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
return content
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
return content
end

Literate.markdown(
joinpath(pkgdir(SparseArraysBase), "examples", "README.jl"),
joinpath(pkgdir(SparseArraysBase), "docs", "src");
flavor=Literate.DocumenterFlavor(),
name="index",
postprocess=ccq_logo,
joinpath(pkgdir(SparseArraysBase), "examples", "README.jl"),
joinpath(pkgdir(SparseArraysBase), "docs", "src");
flavor = Literate.DocumenterFlavor(),
name = "index",
postprocess = ccq_logo,
)
16 changes: 8 additions & 8 deletions docs/make_readme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ using Literate: Literate
using SparseArraysBase: SparseArraysBase

function ccq_logo(content)
include_ccq_logo = """
include_ccq_logo = """
<picture>
<source media="(prefers-color-scheme: dark)" width="20%" srcset="docs/src/assets/CCQ-dark.png">
<img alt="Flatiron Center for Computational Quantum Physics logo." width="20%" src="docs/src/assets/CCQ.png">
</picture>
"""
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
return content
content = replace(content, "{CCQ_LOGO}" => include_ccq_logo)
return content
end

Literate.markdown(
joinpath(pkgdir(SparseArraysBase), "examples", "README.jl"),
joinpath(pkgdir(SparseArraysBase));
flavor=Literate.CommonMarkFlavor(),
name="README",
postprocess=ccq_logo,
joinpath(pkgdir(SparseArraysBase), "examples", "README.jl"),
joinpath(pkgdir(SparseArraysBase));
flavor = Literate.CommonMarkFlavor(),
name = "README",
postprocess = ccq_logo,
)
32 changes: 16 additions & 16 deletions examples/README.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# # SparseArraysBase.jl
#
#
# [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://itensor.github.io/SparseArraysBase.jl/stable/)
# [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://itensor.github.io/SparseArraysBase.jl/dev/)
# [![Build Status](https://github.com/ITensor/SparseArraysBase.jl/actions/workflows/Tests.yml/badge.svg?branch=main)](https://github.com/ITensor/SparseArraysBase.jl/actions/workflows/Tests.yml?query=branch%3Amain)
Expand Down Expand Up @@ -44,19 +44,19 @@ julia> Pkg.add("SparseArraysBase")
# ## Examples

using SparseArraysBase:
SparseArrayDOK,
SparseMatrixDOK,
SparseVectorDOK,
eachstoredindex,
getstoredindex,
getunstoredindex,
isstored,
setstoredindex!,
setunstoredindex!,
storedlength,
storedpairs,
storedvalues,
zero!
SparseArrayDOK,
SparseMatrixDOK,
SparseVectorDOK,
eachstoredindex,
getstoredindex,
getunstoredindex,
isstored,
setstoredindex!,
setunstoredindex!,
storedlength,
storedpairs,
storedvalues,
zero!
using Test: @test, @test_throws

a = SparseArrayDOK{Float64}(undef, 2, 2)
Expand Down Expand Up @@ -127,14 +127,14 @@ b = a[1:2, 2]
a = SparseArrayDOK{Float64}(undef, 2, 2)
a .= 2
for I in eachindex(a)
@test a[I] == 2
@test a[I] == 2
end
@test storedlength(a) == length(a)

a = SparseArrayDOK{Float64}(undef, 2, 2)
fill!(a, 2)
for I in eachindex(a)
@test a[I] == 2
@test a[I] == 2
end
@test storedlength(a) == length(a)

Expand Down
30 changes: 15 additions & 15 deletions src/SparseArraysBase.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module SparseArraysBase

export SparseArrayDOK,
SparseMatrixDOK,
SparseVectorDOK,
OneElementArray,
OneElementMatrix,
OneElementVector,
eachstoredindex,
isstored,
oneelement,
sparse,
sparserand,
sparserand!,
sparsezeros,
storedlength,
storedpairs,
storedvalues
SparseMatrixDOK,
SparseVectorDOK,
OneElementArray,
OneElementMatrix,
OneElementVector,
eachstoredindex,
isstored,
oneelement,
sparse,
sparserand,
sparserand!,
sparsezeros,
storedlength,
storedpairs,
storedvalues

include("abstractsparsearrayinterface.jl")
include("sparsearrayinterface.jl")
Expand Down
Loading
Loading