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

support +/- AbstractFill from FillArrays #118

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

Conversation

putianyi889
Copy link
Contributor

@putianyi889 putianyi889 commented Mar 16, 2023

@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.18%. Comparing base (4f757e7) to head (f15f67e).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #118      +/-   ##
==========================================
+ Coverage   86.14%   86.18%   +0.03%     
==========================================
  Files           6        6              
  Lines         758      760       +2     
==========================================
+ Hits          653      655       +2     
  Misses        105      105              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


@test convert(AbstractArray{Float64}, transpose(1:∞)) ≡ convert(AbstractArray{Float64}, transpose(oneto(∞))) ≡
convert(AbstractMatrix{Float64}, transpose(1:∞)) ≡ convert(AbstractMatrix{Float64}, transpose(oneto(∞))) ≡
AbstractMatrix{Float64}(transpose(1:∞)) ≡ AbstractMatrix{Float64}(transpose(oneto(∞))) ≡
AbstractArray{Float64}(transpose(1:∞)) ≡ AbstractArray{Float64}(transpose(oneto(∞))) ≡
transpose(InfUnitRange(1.0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this work anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced InfUnitRange(1.0) with 1.0:∞ which is InfStepRange

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

julia> typeof(float(1:5))
StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah should InfUnitRange be restricted to integers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a subtype of OrdinalRange which by definition only accepts integers.

StepRange throws error for float input while UnitRange doesn't... I'm not sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a subtype of OrdinalRange which by definition only accepts integers.

I don't think there's a strict requirement on element types, only that the step should be an integer. Floating point UnitRanges are currently allowed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Floating point UnitRanges are currently allowed

They are, but the only way to construct them is the default constructor. The tests convert eltypes, which always result in StepRangeLen in Julia Base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants