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

feat!: Remove PartialEq impl for ConstF64 #1079

Merged
merged 3 commits into from
May 21, 2024
Merged

feat!: Remove PartialEq impl for ConstF64 #1079

merged 3 commits into from
May 21, 2024

Conversation

doug-q
Copy link
Collaborator

@doug-q doug-q commented May 20, 2024

Comparing floats for equality is notoriously difficult. So we don't.

Note that we change the serialisation round-tripping checks a bit, because Const nodes containt CustomConsts that do not implement equals_const will break equality checks on the Hugrs.

BREAKING CHANGE: Remove PartialEq impl for ConstF64

Comparing floats for equality is notoriously difficult. So we don't.

Note that we change the serialisation round-tripping checks a bit,
because `Const` nodes containt `CustomConst`s that do not implement
`equals_const` will break equality checks on the Hugrs.

BREAKING CHANGE: Remove `PartialEq` impl for `ConstF64`
@doug-q doug-q requested a review from a team as a code owner May 20, 2024 10:55
@doug-q doug-q requested a review from acl-cqc May 20, 2024 10:55
Copy link

codecov bot commented May 20, 2024

Codecov Report

Attention: Patch coverage is 97.29730% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 86.58%. Comparing base (b3d44c9) to head (ca52e81).

Files Patch % Lines
hugr/src/hugr/serialize/test.rs 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1079      +/-   ##
==========================================
+ Coverage   86.51%   86.58%   +0.06%     
==========================================
  Files          88       83       -5     
  Lines       17971    17596     -375     
  Branches    17582    17596      +14     
==========================================
- Hits        15548    15235     -313     
+ Misses       1603     1541      -62     
  Partials      820      820              
Flag Coverage Δ
rust 86.58% <97.29%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@doug-q doug-q linked an issue May 20, 2024 that may be closed by this pull request
@doug-q doug-q requested review from cqc-alec and removed request for acl-cqc May 21, 2024 08:50
@doug-q
Copy link
Collaborator Author

doug-q commented May 21, 2024

I've removed @acl-cqc as reviewer and added @cqc-alec to relieve Alan a bit. Please do complain if you've a problem.

@@ -110,8 +110,5 @@ mod test {
assert_eq!(const_f64_1.value(), 1.0);
assert_eq!(*const_f64_2, 2.0);
assert_eq!(const_f64_1.name(), "f64(1)");
assert!(const_f64_1.equal_consts(&ConstF64::new(1.0)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should keep (but negate) this test, for coverage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea.

@doug-q doug-q enabled auto-merge May 21, 2024 11:51
@doug-q doug-q added this pull request to the merge queue May 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 21, 2024
@doug-q doug-q added this pull request to the merge queue May 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 21, 2024
@doug-q doug-q added this pull request to the merge queue May 21, 2024
Merged via the queue into main with commit 8af8f8a May 21, 2024
18 checks passed
@doug-q doug-q deleted the doug/no-equals-const branch May 21, 2024 14:01
This was referenced May 21, 2024
This was referenced May 29, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 29, 2024
## 🤖 New release
* `hugr`: 0.4.0 -> 0.5.0
* `hugr-cli`: 0.1.0
* `hugr-core`: 0.1.0
* `hugr-passes`: 0.1.0

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr`
<blockquote>

## 0.5.0 (2024-05-29)

### Bug Fixes

- Missing re-exports in `hugr::hugr`
([#1127](#1127))
- Set initial version of hugr-core to 0.1.0
([#1129](#1129))

### Features

- [**breaking**] Remove `PartialEq` impl for `ConstF64`
([#1079](#1079))
- [**breaking**] Allow "Row Variables" declared as List<Type>
([#804](#804))
- Hugr binary cli tool ([#1096](#1096))
- [**breaking**] Move passes from `algorithms` into a separate crate
([#1100](#1100))
- [**breaking**] Disallow nonlocal value edges into FuncDefn's
([#1061](#1061))
- [**breaking**] Move cli in to hugr-cli sub-crate
([#1107](#1107))
- Add verbosity, return `Hugr` from `run`.
([#1116](#1116))
- Unseal and make public the traits `HugrInternals` and
`HugrMutInternals` ([#1122](#1122))

### Refactor

- [**breaking**] No Ports in TypeRow
([#1087](#1087))
- Add a `hugr-core` crate
([#1108](#1108))
</blockquote>

## `hugr-core`
<blockquote>

## 0.1.0 (2024-05-29)

### Bug Fixes

- Set initial version of hugr-core to 0.1.0
([#1129](#1129))

### Features

- [**breaking**] Move cli in to hugr-cli sub-crate
([#1107](#1107))
- Make internals of int ops and the "int" CustomType more public.
([#1114](#1114))
- Unseal and make public the traits `HugrInternals` and
`HugrMutInternals` ([#1122](#1122))

### Refactor

- Add a `hugr-core` crate
([#1108](#1108))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: Agustin Borgna <agustin.borgna@quantinuum.com>
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.

Remove impl PartialEq for ConstF64
2 participants