# How do I get a well coordinate ("A1" row col etc) from a resource?

**URL:** <https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-from-a-resource/95>\
**Category:** General\
**Created:** [December 6, 2024, 4:17pm UTC](https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-from-a-resource/95 "2024-12-06T16:17:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![willem](https://discuss.pylabrobot.org/letter_avatar_proxy/v4/letter/w/898d66/32.png) [@willem](https://discuss.pylabrobot.org/u/willem)\
**Post date:** [December 6, 2024, 4:17pm UTC](https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-from-a-resource/95/1 "2024-12-06T16:17:27Z")

</div>

I am looking at a backend implementation. The interface has

```auto
  async def aspirate(
    self,
    ops: List[Aspiration],
    use_channels: List[int],
    **backend_kwargs,
  ):
  .....
  .....

```

I need to get a well name (like “A1”).  
I can see that an `Aspiration` object has a `Container` resource. Can I safely assume that the resource in an `Aspiration` object always has `ordered_items` which are either str or `Well` type, containing the well name?

I assume here that `ordered_items` are the positions or `Wells`, and that `ordering` is something else, is that correct?

---

<div class="post-metadata">

**Author:** ![rickwierenga](https://discuss.pylabrobot.org/user_avatar/discuss.pylabrobot.org/rickwierenga/32/963_2.png) [@rickwierenga](https://discuss.pylabrobot.org/u/rickwierenga)\
**Post date:** [December 6, 2024, 5:52pm UTC](https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-from-a-resource/95/2 "2024-12-06T17:52:40Z")

</div>

you cannot assume that the container is always a well in a canonical plate, it may also be a trough, petri dish, etc. If the dc1 only supports plates, that’s fine for now, just raise an error when the container is not a Well. In the future, we can probably hack something together for the other containers.

there is no convenient api for getting the canonical index of a resource yet. i will add it. for now you can use this:

```python
plate = well.parent # well = op.resource
child_idx = plate.children.index(well)
plate._ordering[child_idx]

```

---

<div class="post-metadata">

**Author:** ![willem](https://discuss.pylabrobot.org/letter_avatar_proxy/v4/letter/w/898d66/32.png) [@willem](https://discuss.pylabrobot.org/u/willem)\
**Post date:** [December 9, 2024, 5:44pm UTC](https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-from-a-resource/95/3 "2024-12-09T17:44:39Z")

</div>

Thanks, I’ll give that a go.  
willem

---

<div class="post-metadata">

**Author:** ![rickwierenga](https://discuss.pylabrobot.org/user_avatar/discuss.pylabrobot.org/rickwierenga/32/963_2.png) [@rickwierenga](https://discuss.pylabrobot.org/u/rickwierenga)\
**Post date:** [December 9, 2024, 6:34pm UTC](https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-from-a-resource/95/4 "2024-12-09T18:34:04Z")

</div>

you can now use `{Well,TipSpot}.get_identifier`

> <https://github.com/PyLabRobot/pylabrobot/pull/327>
>
> https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-f…rom-a-resource/95

---

<div class="post-metadata">

**Author:** ![willem](https://discuss.pylabrobot.org/letter_avatar_proxy/v4/letter/w/898d66/32.png) [@willem](https://discuss.pylabrobot.org/u/willem)\
**Post date:** [December 10, 2024, 8:30am UTC](https://discuss.pylabrobot.org/t/how-do-i-get-a-well-coordinate-a1-row-col-etc-from-a-resource/95/5 "2024-12-10T08:30:00Z")

</div>

Fab, thanks very much - will give that a go, hopefully soon.
