-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: Proposed review changes to #485 #506
Conversation
4deae10
to
e5b0601
Compare
tests/integration/conftest.py
Outdated
@@ -92,7 +88,14 @@ def f(hugr: Package, expected: Any, fn_name: str = "main"): | |||
|
|||
@pytest.fixture | |||
def run_int_fn(): | |||
return _run_fn("run_int_function") | |||
run_to_res = _run_fn("run_int_function") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The awkward thing is that this makes run_int_fn
(the same as before but) different from run_float_fn
, so perhaps they should be named differently. check_int_fn
perhaps, although it'd be less change to rename the new run_float_fn
instead....thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agree. maybe eval_float_fn
? It's not too bad to rename run_int_fn
-> check_int_fn
. Alternatively, we could perhaps move the pytest.approx
(nice btw!), would run_float_fn(package, expected = pytest.approx(x))
work?
@@ -112,7 +112,7 @@ def main(a1: angle, a2: angle) -> bool: | |||
a3 = -a1 + a2 * -3 | |||
a3 -= a1 | |||
a3 += 2 * a1 | |||
return a3 == -a2 | |||
return a3 / 3 == -a2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a straightforward reversion of an unnecessary change. (The code is not executed, the result does not have to be true
, and division is valid.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed, this is leftover from a moment where division was banned.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## ss/fix-angle-lower #506 +/- ##
===================================================
Coverage 91.67% 91.67%
===================================================
Files 59 59
Lines 6138 6138
===================================================
Hits 5627 5627
Misses 511 511 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Alan, I really appreciate the help here.
@@ -112,7 +112,7 @@ def main(a1: angle, a2: angle) -> bool: | |||
a3 = -a1 + a2 * -3 | |||
a3 -= a1 | |||
a3 += 2 * a1 | |||
return a3 == -a2 | |||
return a3 / 3 == -a2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed, this is leftover from a moment where division was banned.
tests/integration/conftest.py
Outdated
@@ -92,7 +88,14 @@ def f(hugr: Package, expected: Any, fn_name: str = "main"): | |||
|
|||
@pytest.fixture | |||
def run_int_fn(): | |||
return _run_fn("run_int_function") | |||
run_to_res = _run_fn("run_int_function") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agree. maybe eval_float_fn
? It's not too bad to rename run_int_fn
-> check_int_fn
. Alternatively, we could perhaps move the pytest.approx
(nice btw!), would run_float_fn(package, expected = pytest.approx(x))
work?
Hah! Yes, it's much easier than what I did. I was remembering an Alternatively we could modify |
No description provided.