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

Add type tags for number ranges #2284

Merged

Conversation

RunDevelopment
Copy link
Member

image

I added type tags for number ranges. The tags only approximate the actual set of numbers. E.g. the types 0..100 and 0..5 | 95..100 will both be displayed as 0 ~ 100. This simplification is necessary to display more complex number types, and I also think that the loss in information is okay. The bounds are the most important information (IMO) and those are still displayed correctly.

Small sets of numbers will be displayed as is. E.g. 1 | int(98..100) will be displayed as 1 | 98 | 99 | 100 instead of as 1 ~ 100. This will only work for set with 4 or fewer numbers. So e.g. int(1..4) will be displayed as 1 | 2 | 3 | 4, but int(1..5) will be displayed as 1 ~ 5.

Open questions:

  • Notation. How should we denote this information? I used type notation for small sets (e.g. 1 | 3 | 4) and a new range notation for ranges with tilde ~. Maybe we should use the type notations there as well? E.g. 1..100 vs 1 ~ 100.

@joeyballentine
Copy link
Member

How should we denote this information?

I'm not sure what way would be easiest for users to understand, though I certainly think 0..100 is a bit more intuitive than 0 ~ 100. Honestly either would be fine with me

@RunDevelopment
Copy link
Member Author

I changed it to .. and improved the formatting in general. Numbers with a lot of decimal places now only show a few digits. Tooltips still show the full numbers.

image
image

Copy link
Member

@joeyballentine joeyballentine left a comment

Choose a reason for hiding this comment

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

LGTM

@joeyballentine joeyballentine merged commit 5d5e364 into chaiNNer-org:main Oct 25, 2023
4 checks passed
@RunDevelopment RunDevelopment deleted the number-range-type-tag branch October 25, 2023 17:38
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.

2 participants