{"id":18595464,"url":"https://github.com/ericjang/circulararrays.jl","last_synced_at":"2026-01-25T15:31:29.798Z","repository":{"id":29510238,"uuid":"33048494","full_name":"ericjang/CircularArrays.jl","owner":"ericjang","description":"Circular Arrays implementation in Julia.","archived":false,"fork":false,"pushed_at":"2015-03-28T20:25:15.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-26T20:42:54.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericjang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-28T20:10:15.000Z","updated_at":"2015-03-28T20:25:15.000Z","dependencies_parsed_at":"2022-09-03T19:11:35.104Z","dependency_job_id":null,"html_url":"https://github.com/ericjang/CircularArrays.jl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2FCircularArrays.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2FCircularArrays.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2FCircularArrays.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericjang%2FCircularArrays.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericjang","download_url":"https://codeload.github.com/ericjang/CircularArrays.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239379322,"owners_count":19628684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T01:19:47.395Z","updated_at":"2025-11-02T05:30:31.150Z","avatar_url":"https://github.com/ericjang.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CircularArrays.jl\n\n[![Build Status](https://travis-ci.org/ericjang/CircularArrays.jl.svg?branch=master)](https://travis-ci.org/ericjang/CircularArrays.jl)\n\nCircular Arrays implementation in Julia.\n\n## What is this for?\n\nUseful for implementing queues of future events with some max delay. Use regular slicing notation to set future data, except data wraps around if it overflows. See [this article](http://en.wikipedia.org/wiki/Circular_buffer). \n\n## Usage:\n\n```julia\nusing CircularArrays\nx = reshape([i for i in 1:15],3,5)\ncarray = CircularArray(x)\nadvance_head!(carray,2)\ngetindex(carray,1:2,2:5) == [10 13 1 4; 11 14 2 5];\ntrue\n```\n\nYou can use regular slicing syntax as well:\n```\ncarray[1:2,2:5] == [10 13 1 4; 11 14 2 5]\ntrue\n```\n\nHere's another example:\n```julia\nusing CircularArrays\nc2 = CircularArray(reshape([i for i in 1:28],4,7))\nadvance_head!(c2,3)\nsetindex!(c2,[3:6],1:4,3)\nc2.data == \n[1  5   9  13  17  3  25; \n 2  6  10  14  18  4  26; \n 3  7  11  15  19  5  27; \n 4  8  12  16  20  6  28]\n\ntrue\n```\n\nCircularArrays works with any array type, of any number of dimensions. You can specify which dimension is the circular one.\n\n```julia\nusing CircularArrays\ncdim = 1\nX = falses(4,3,5)\nC = CircularArray(X,cdim)\nadvance_head!(C,1)\nC[1,1:3,1:5] = trues(3,5)\nreshape(C.data[2,:,:],3,5) == trues(3,5)\ntrue\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericjang%2Fcirculararrays.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericjang%2Fcirculararrays.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericjang%2Fcirculararrays.jl/lists"}