{"id":16705046,"url":"https://github.com/mcabbott/sizemagic.jl","last_synced_at":"2026-03-18T21:34:54.652Z","repository":{"id":117871508,"uuid":"390456907","full_name":"mcabbott/SizeMagic.jl","owner":"mcabbott","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-28T18:37:53.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T05:57:13.971Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcabbott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-28T18:14:32.000Z","updated_at":"2023-03-02T00:39:16.000Z","dependencies_parsed_at":"2023-04-07T13:31:52.170Z","dependency_job_id":null,"html_url":"https://github.com/mcabbott/SizeMagic.jl","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"fcf780b511e966d5177a35b3905cb298c35f2c4b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mcabbott/SizeMagic.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FSizeMagic.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FSizeMagic.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FSizeMagic.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FSizeMagic.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcabbott","download_url":"https://codeload.github.com/mcabbott/SizeMagic.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FSizeMagic.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30628405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-12T19:28:30.105Z","updated_at":"2026-03-17T18:09:42.916Z","avatar_url":"https://github.com/mcabbott.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SizeMagic.jl\n\nThis is an experiment to see how little code might be needed to reproduce what [NamedDims.jl](https://github.com/invenia/NamedDims.jl) does, and (although not yet) what AxisArrays / AxisKeys / AxisIndices / DimensionalData do.\n\nThe best-behaved citizens are those functions which make a new array via `similar(A, T, axes(A))`; these usually automatically propogate OffsetArrays.jl. But many functions go instead via `similar(A, T, size(A))`, for instance all of LinearAlgebra.jl. The basic ideas of this package are:\n\n* If `size(A)` returns a special `NamedInt`, then this information can often propagate through Julia code with no explicit handling. This includes broadcasting, comprehensions, `cat`. It also works from within other wrappers such as `Adjoint`.\n\n* If in addition to `struct NamedArray \u003c: AbstractArray`  we define a wrapper `struct NamedDense \u003c: DenseArray`, and forward funcitons like `pointer`, then things like BLAS can also work with no explicit handling. And no method ambiguities from `*`.\n\nExamples:\n\n```julia\njulia\u003e using SizeMagic\n\njulia\u003e A = named(rand(Int8,3,3), :x, :y) .+ 0;\n\njulia\u003e A'\n(y⩽3)×(x⩽3) adjoint(named(::Matrix{Int64}, :x, :y)) with eltype Int64:\n  71  -65  -10\n  60   54  -84\n -90  -33  -81\n\njulia\u003e axes(A')\n(Base.OneTo(NamedInt(3, :y)), Base.OneTo(NamedInt(3, :x)))\n\njulia\u003e A isa StridedMatrix\ntrue\n\njulia\u003e A' * A\n(y⩽3)×(y⩽3) named(::Matrix{Int64}, :y, :y):\n  9366   1590  -3435\n  1590  13572   -378\n -3435   -378  15750\n\njulia\u003e sum(cbrt, A, dims=:x)\n(x⩽1)×(y⩽3) named(::Matrix{Float64}, :x, :y):\n -2.03434  3.31511  -12.0157\n\njulia\u003e hcat(A, A)\n(x⩽3)×(y⩽6) named(::Matrix{Int64}, :x, :y):\n  71   60  -90   71   60  -90\n -65   54  -33  -65   54  -33\n -10  -84  -81  -10  -84  -81\n\njulia\u003e hcat(A, A')\nERROR: ArgumentError: number of rows of each array must match (got (NamedInt(3, :x), NamedInt(3, :y)))\nStacktrace:\n [1] _typed_hcat(#unused#::Type{Int64}, A::Tuple{SizeMagic.NamedDense{Int64, 2, Matrix{Int64}}, Adjoint{Int64, SizeMagic.NamedDense{Int64, 2, Matrix{Int64}}}})\n   @ Base ./abstractarray.jl:1573\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcabbott%2Fsizemagic.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcabbott%2Fsizemagic.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcabbott%2Fsizemagic.jl/lists"}