Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define and export SubVector and SubMatrix aliases #50537

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

baumgold
Copy link
Contributor

SubVector is a SubArray with dimensionality of 1

@jishnub
Copy link
Contributor

jishnub commented Jul 14, 2023

Why are the indices necessarily unitranges?

@baumgold
Copy link
Contributor Author

Why are the indices necessarily unitranges?

No good reason. Fixed, thanks.

@jishnub
Copy link
Contributor

jishnub commented Jul 15, 2023

I imagine we might also want SubMatrix along the same lines

@baumgold
Copy link
Contributor Author

It's unclear to me why the following test fails on x86_64-apple-darwin. @jishnub - any ideas? Thanks.

Error During Test at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-x64-5.0/build/default-macmini-x64-5-0/julialang/julia-master/julia-1dd6dbeea0/share/julia/test/abstractarray.jl:762
  | Test threw exception
  | Expression: #= /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-x64-5.0/build/default-macmini-x64-5-0/julialang/julia-master/julia-1dd6dbeea0/share/julia/test/abstractarray.jl:762 =# @inferred(cat3v(As)) == zeros(2, 2, 2)
  | return type Array{Float64, 3} does not match inferred return type Array{_A, 3} where _A

@jishnub
Copy link
Contributor

jishnub commented Jul 30, 2023

That's a known issue, and unrelated to this PR #50550

@brenhinkeller brenhinkeller added the arrays [a, r, r, a, y, s] label Aug 6, 2023
@KristofferC
Copy link
Member

Doctests need updating.

@baumgold
Copy link
Contributor Author

Doctests need updating.

Good catch, thanks. Done.

@mbauman
Copy link
Member

mbauman commented Feb 8, 2024

My only hesitation here is that this changes printing and will cause some doctest churn throughout the ecosystem — will the nicety here be worth the extra collective effort it will entail? This search (r"SubArray.*:$") isn't perfect but it captures a good bulk of the uses: https://juliahub.com/ui/Search?q=SubArray.%2a%3A%24&type=code&r=true

@mbauman mbauman changed the title Define SubVector Define and export SubVector and SubMatrix aliases Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants