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

Refactor the DiscreteRanged trait #80

Closed
38 opened this issue Nov 14, 2019 · 0 comments
Closed

Refactor the DiscreteRanged trait #80

38 opened this issue Nov 14, 2019 · 0 comments
Projects
Milestone

Comments

@38
Copy link
Member

38 commented Nov 14, 2019

Background

Now the discrete range trait doesn't seem clean because of the following issue:

  • No bound check, the next_value and previous_value requires always returns a value
  • Unknown number of distinct values
  • Linspace coord should be a discrete range, however this can't be used in Histogram since the hash table requires Equal trait but f64 doesn't impl the trait.

However, all the discrete range is equivalent to a integer range, thus we doesn't actually need put any restriction on the traits for the actual values. (Later we may use an array as an discrete coordinate and lifting the trait bound will make this possible)

Drawbacks

In order to know the number of values and handle the bound correctly, we have to make most of the RangeParam not an unit type, and this will makes Histogram::new unsable to applied to most of the coord types. Thus this should be considered as an breaking change.

@38 38 added this to TODO in 0.3 Nov 14, 2019
@38 38 added this to the 0.3 milestone Nov 26, 2019
@38 38 mentioned this issue Dec 1, 2019
@38 38 closed this as completed Dec 1, 2019
@38 38 added this to Frontend Specific in 0.3 Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
0.3
Frontend Specific
Development

No branches or pull requests

1 participant