Skip to content

refactor(app, api): add comparison states support for both mounts in cal check#5583

Merged
b-cooper merged 124 commits into
edgefrom
api_cal-check-comparison-states
May 7, 2020
Merged

refactor(app, api): add comparison states support for both mounts in cal check#5583
b-cooper merged 124 commits into
edgefrom
api_cal-check-comparison-states

Conversation

@b-cooper
Copy link
Copy Markdown
Contributor

@b-cooper b-cooper commented May 5, 2020

overview

Add support for difference vector comparisons for each point check in robot calibration flow. Also
add branching logic for different attached instruments cases and remove pipette id parameter from
triggers.

changelog

  • Differentiate "joggingToFoo" and "comparingFoo" states
  • Wire up second pipette into flow if present and only check height and point one
  • add difference vector checking that is returned to client, keyed by step, in comparisonsByStep of the session status
  • remove need for back end to pass pipette_id's around as parameters. Should probably deprecate entirely in next PR

review requests

Push branch to Robot and launch run app from branch. With the calibration check feature flag toggled "on". Proceed with the Check. The comparison screens are stubbed for now, but should have a "Continue" button that will proceed to the next check. Jogging outside of the threshold for tip pick up will lead to bad calibration data state (which doesn't have a view yet). Jogging outside of the threshold for any other check will add a record in redux under comparisonsByStep -> exceedsThreshold: true. This will be mapped to view logic in the next PR.

risk assessment

Whole flow is still behind a feature flag, this doesn't touch anything exposed or shared.

@mcous mcous deleted the api_cal-check-comparison-states branch October 14, 2020 21:03
SyntaxColoring added a commit that referenced this pull request May 2, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 16, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 16, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 16, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 16, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 16, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 16, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 17, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 19, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 19, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 19, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 20, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 20, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 22, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 23, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 24, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 24, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 29, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 29, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
ddcc4 pushed a commit that referenced this pull request May 29, 2025
…oint equality (#18215)

For a long time, `opentrons.types.Point` has overridden its `==`
operator to return `True` if the two points are *numerically
approximately* equal to each other, instead of *actually* equal.

This was introduced in commit d13ed34
of PR #5583, possibly for the benefit of some calibration unit tests?

I personally find this very surprising. If I do `a == b`, I strongly
expect that to mean actual equality—if I wanted approximation, I would
have used `isclose()`. In other words, I expect `point_a == point_b` to
behave exactly like `(point_a.x == point_b.x) and (point_a.y ==
point_b.y) and (point_a.z == point_b.z)`.

Also, it breaks [the rule that objects that compare equal must have the
same hash
value](https://docs.python.org/3/reference/datamodel.html#object.__hash__).

```python
>>> a = Point()
>>> b = Point(z=1e-20)
>>> a == b
True
>>> hash(a)
3010437511937009226
>>> hash(b)
9180445109486892018
```

So this PR restores strict equality checking. The old behavior is
preserved as an explicit method, `point.elementwise_isclose(other)`, for
the benefit of the few tests that were implicitly relying on it.

(cherry picked from commit 4250aab)
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.

8 participants