Skip to content

Implement Interval PointFrom operator#371

Open
dehall wants to merge 1 commit into
masterfrom
pointfrom
Open

Implement Interval PointFrom operator#371
dehall wants to merge 1 commit into
masterfrom
pointfrom

Conversation

@dehall

@dehall dehall commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This PR implements the point from interval operator. (closes #163)

define PointFromUnit2Interval: point from Interval[2,2]

If the given interval is a "unit interval", aka it only contains a single point, this operator returns that point. Otherwise, it throws a runtime error.

To get that single point, it just checks if start() is equal to end(). If both bounds of the interval are null, it returns null, hence checking with both == and equals.

Pull requests into cql-execution require the following.
Submitter and reviewer should ✔ when done.
For items that are not-applicable, mark "N/A" and ✔.

Submitter:

  • This pull request describes why these changes were made
  • Code diff has been done and been reviewed (it does not contain: additional white space, not applicable code changes, debug statements, etc.)
  • Tests are included and test edge cases
  • Tests have been run locally and pass
  • Code coverage has not gone down and all code touched or added is covered.
  • Code passes lint and prettier (hint: use npm run test:plus to run tests, lint, and prettier)
  • All dependent libraries are appropriately updated or have a corresponding PR related to this change
  • cql4browsers.js built with npm run build:browserify if source changed.

Reviewer:

Name:

  • Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose
  • The tests appropriately test the new code, including edge cases
  • You have tried to break the code

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.43%. Comparing base (5c28fd1) to head (1f32af0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #371      +/-   ##
==========================================
+ Coverage   88.41%   88.43%   +0.02%     
==========================================
  Files          54       54              
  Lines        4832     4843      +11     
  Branches     1359     1361       +2     
==========================================
+ Hits         4272     4283      +11     
  Misses        368      368              
  Partials      192      192              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Support "point from" operator

2 participants