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 range-check for numbers #4

Open
JasonAllenCorns opened this issue Mar 2, 2017 · 1 comment
Open

Add range-check for numbers #4

JasonAllenCorns opened this issue Mar 2, 2017 · 1 comment
Assignees

Comments

@JasonAllenCorns
Copy link
Collaborator

JasonAllenCorns commented Mar 2, 2017

in addition to equals, above, below, please add a validation method for "between", such that

          "criteria": [
            {
              "has": {
                "trait": "hasNumberValue",
                "comparison": "between",
                "start": 1,
                "end": 10
              }
            }
          ]
        },

This would cut improve on the compound criteria that includes an "above" and a "below" with an "all" match.

@JasonAllenCorns JasonAllenCorns self-assigned this Mar 2, 2017
@JasonAllenCorns JasonAllenCorns added this to the 2.1 milestone Mar 2, 2017
@CM-SiteUI
Copy link
Contributor

CM-SiteUI commented Mar 3, 2017

The percentScale criteria is similar to this, but the range in limited to [0, 100]. The has method can be extended to include a "between", with a slightly different signature:

"criteria": [
            {
              "has": {
                "trait": "hasNumberValue",
                "comparison": "between",
                "value": {"start": 1, "end": 10}
              }
            }
          ]

or

"criteria": [
            {
              "has": {
                "trait": "hasNumberValue",
                "comparison": "between",
                "value": [min, max]
              }
            }
          ]

JasonAllenCorns pushed a commit to JasonAllenCorns/brie that referenced this issue Aug 28, 2018
…ion. Lessons learned, here: the 'between' statement is a good enough shortcut, but adds some criteria complexity that is lexigraphically solvable by saying 'number is less than x and number is greater than y', which can be solved with existing methods.
JasonAllenCorns pushed a commit to JasonAllenCorns/brie that referenced this issue Aug 28, 2018
JasonAllenCorns pushed a commit to JasonAllenCorns/brie that referenced this issue Aug 28, 2018
@JasonAllenCorns JasonAllenCorns removed this from the 2.2 milestone Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants