diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index d94b38d..8ad0284 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -3,10 +3,23 @@ on: schedule: - cron: 0 0 * * * workflow_dispatch: +permissions: + contents: write + pull-requests: write jobs: CompatHelper: runs-on: ubuntu-latest steps: + - name: Check if Julia is already available in the PATH + id: julia_in_path + run: which julia + continue-on-error: true + - name: Install Julia, but only if it is not already available in the PATH + uses: julia-actions/setup-julia@v2 + with: + version: '1' + arch: ${{ runner.arch }} + if: steps.julia_in_path.outcome != 'success' - name: "Add the General registry via Git" run: | import Pkg diff --git a/.github/workflows/DocPreviewCleanup.yml b/.github/workflows/DocPreviewCleanup.yml new file mode 100644 index 0000000..5be23b9 --- /dev/null +++ b/.github/workflows/DocPreviewCleanup.yml @@ -0,0 +1,33 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time +concurrency: + group: doc-preview-cleanup + cancel-in-progress: false + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v4 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "${preview_dir}" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "${preview_dir}" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi + env: + preview_dir: previews/PR${{ github.event.number }} diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index f49313b..0cd3114 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -4,6 +4,22 @@ on: types: - created workflow_dispatch: + inputs: + lookback: + default: "3" +permissions: + actions: read + checks: read + contents: write + deployments: read + issues: read + discussions: read + packages: read + pages: read + pull-requests: read + repository-projects: read + security-events: read + statuses: read jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2964078..d347da3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ on: tags: '*' pull_request: release: + workflow_dispatch: concurrency: # Skip intermediate builds: always. @@ -27,7 +28,7 @@ jobs: version: - '1.6' - '1' - - 'nightly' + - 'pre' os: - ubuntu-latest arch: @@ -38,43 +39,39 @@ jobs: arch: x86 - version: 1 os: macOS-latest - arch: x64 + arch: arm64 - version: 1 os: windows-latest arch: x64 steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - env: - PYTHON: 'Conda' - uses: julia-actions/julia-runtest@v1 with: coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' }} - uses: julia-actions/julia-processcoverage@v1 if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - file: lcov.info + files: lcov.info docs: name: Documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: '1' - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - env: - PYTHON: 'Conda' - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Project.toml b/Project.toml index 1ab7ca0..848cd29 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ArraysOfArrays" uuid = "65a8f2f4-9b39-5baf-92e2-a9cc46fdf018" -version = "0.6.5" +version = "0.6.6" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/vector_of_arrays.jl b/src/vector_of_arrays.jl index 57ba3ae..645a9e2 100644 --- a/src/vector_of_arrays.jl +++ b/src/vector_of_arrays.jl @@ -212,8 +212,13 @@ Base.@propagate_inbounds function Base._getindex(l::IndexStyle, A::VectorOfArray end -Base.@propagate_inbounds function Base._getindex(l::IndexStyle, A::VectorOfArrays, idxs::AbstractVector{<:Integer}) - @boundscheck checkbounds(A, idxs) +@inline _explicit_idxs(::AbstractVector, idxs::AbstractVector{<:Integer}) = idxs +@inline _explicit_idxs(eachidx::AbstractVector, idxs::Base.LogicalIndex) = eachidx[idxs] + +Base.@propagate_inbounds function Base._getindex(l::IndexStyle, A::VectorOfArrays, raw_idxs::AbstractVector{<:Integer}) + @boundscheck checkbounds(A, raw_idxs) + + idxs = _explicit_idxs(eachindex(A), raw_idxs) A_ep = A.elem_ptr A_data = A.data diff --git a/test/vector_of_arrays.jl b/test/vector_of_arrays.jl index 5e24ac2..8ea4d00 100644 --- a/test/vector_of_arrays.jl +++ b/test/vector_of_arrays.jl @@ -168,6 +168,10 @@ using ArraysOfArrays: full_consistency_checks, append_elemptr!, element_ptr @test @inferred(element_ptr(V12)) == V12.elem_ptr + boolidxs = rand(Bool, length(V1)) + @test @inferred(V1[boolidxs]) == V1[eachindex(V1)[boolidxs]] + + ## _view_reshape_spec not yet implemented ## # V1_copy = copy(V1) # V2_copy = copy(V2)