Unlike the old code, this is doing `str(field.stash)` and the lookup twice. How about:
```python
subthingy = STASH_TRANS.get(str(field.stash), None)
if subthingy is None:
    subgrid = None
    warnings.warn('The STASH code {0} was not found...
else:
    subgrid = subthingy.grid_code
    if subgrid not in HANDLED_GRIDS:
        warnings.warn('The stash code {} is on a grid...
```