---
# System prepended metadata

title: GT4Py Cleanup
tags: [cycle 15]

---

# GT4Py Cleanup


###### tags: `cycle 15`

- Shaped by: Rico, Enrique
- Appetite: 6 weeks, 2 or 3 developers
- Developers: at least one involved in the previous cycle cleanup (Rico, Enrique, Hannes, Till)

## Problem

We have a number of (sometimes partially) shaped small projects left over from last cycle: [here](https://hackmd.io/46Oa6MspRoSTiFozHzun5A). They need to be organized, prioritized and some of them could be implemented already.

The original guiding goals were:

- Reduce technical debt to be able to introduce more features in the future
- Improve diagnostics for users
- Reduce surprises in partially implemented features
- Develop/improve guidelines for development and especially testing

## Appetite

There should be enough people in the Project to be able to continuously review each other's shaping efforts (min 3). 

The amount of people and time will determine how many projects can be shaped and implemented.

## Solution

### Shaping Track [1/3 Appetite]

A structured workshop (prepared by @ricoh) with at least 3 devs should be prepared to find consensus on how each of these small projects rates in terms of promising to fullfill the original goals. This should lead to a clear priority list. Not everyone participating here must be in the project, however, if they aren't their time spent here must be accounted for in their respective projects. Let's assume about half a day of time commitment.

![](https://hackmd.io/_uploads/Sk86vOjNn.png)

Next, the top N projects (N depending on the appetite and team size) have to be shaped to the point where they could be pitched next cycle if we do not get to them now. This is to avoid this list of projects effectively turning into an indefinite backlog.

The shaped project should specifically address how the goals (see above) are to be achieved. This is to avoid the ["grab bag" problem](https://basecamp.com/shapeup/1.2-chapter-03#watch-out-for-grab-bags).

The shaped projects will fall into three categories:

- batchable: small and downhill-only.
- standalone projects: some uncertainties, potentially some exploration required but gains perhaps warrant a project in the future.
- time-boxed exploration: for projects where we expect huge improvements but there are too many uncertainties

Batchable projects must be shaped into one or more [small-batch](https://basecamp.com/shapeup/2.2-chapter-08#team-and-project-sizes) projects.

### Implementation [2/3 Appetite]

At least one small-batch project (a batch of small projects) should have come out of the shaping track. The rest of the time (4 weeks given an appetite of 6) will be spent on implementing one of these.

If it becomes apparent that some of the small projects in the batch will not be doable in this time, the team should consider rebalancing the other shaped small-batch projects in time before the end of the cycle.

## Rabbit holes

It is easy to get lost in discussions about the particulars of a small proposed project and lose sight of the bigger context. Return to the goals outlined above and cut any discussion that does not revolve around achieving them.

## No-gos

Any project not on the [list](https://hackmd.io/46Oa6MspRoSTiFozHzun5A) from last cycle should not be considered for inclusion and instead be shaped for a future cycle.

## Progress

### Outcome of Prioritization workshop

Numbers in brackets next to each goal are weightings. Each cell contains an estimation (per workshop participant) for how much the project in the given row would contribute towards the goal in the given column.

Project Idea | Reduce Surprises for Devs [1] | Guidelines / Coherence [1] | User Experience [2] | Technical Debt [3]
--- | --- | --- | --- | ---
FOAST lowering tests | [0, 0, 2] | [2, 2, 1] | [0, 0, 0] | [1, 1, 1]
   Exceptions | [1, 0, 2] | [1, 1, 2] | [2, 3, 3] | [2, 2, 1]
Toolchain config flags | [2, 2, 1] | [1, 1, 2] | [1, 2, 2] | [3, 2, 1]
Fieldview feature testutils II | [2, 2, 0] | [2, 2, 3] | [0, 0, 2] | [3, 2, 1]
ITIR conventions | [1, 1, 0] | [2, 3, 2] | [0, 0, 0] | [2, 2, 1]
Test convention compliance | [2, 1, 2] | [2, 3, 3] | [0, 0, 0] | [1, 0, 1]
Lint the tests | [1, 3, 0] | [2, 2, 3] | [0, 0, 0] | [1, 1, 2]
Transform tests | [1, 1, 1] | [0, 2, 1] | [0, 0, 0] | [1, 1, 1]
ITIR map_ tests | [2, 2, 2] | [2, 1, 0] | [1, 0, 0] | [3, 3, 3]
Public imports | [2, 1, 2] | [2, 2, 2] | [3, 3, 3] | [1, 1, 1]

From this we arrived at two very similar rankings by averaging the scores in each cell and taking a weighted sum of each row.

Using arithmetic mean for cell scores we get:

Project | Total score (arithmetic mean)
--- | ---
Public imports                 | 12.6667
Exceptions                     | 12.6667
~~ITIR map_ tests~~ (skipped)  | 12.6667
Toolchain config flags         | 12.3333
Fieldview feature testutils II | 11
ITIR conventions               |  8
Lint the tests                 |  7.66667
Test convention compliance     |  6.33333
FOAST lowering tests           |  5.33333
Transform tests                |  5

And using geometric mean we get:

Project | Total score (geometric mean)
--- | ---
Public imports                 | 12.5874
Toolchain config flags         | 11.4735
Exceptions                     | 11.2636
~~ITIR map_ tests~~ (skipped)  | 11
Fieldview feature testutils II |  7.74079
ITIR conventions               |  7.05163
Lint the tests                 |  6.06919
FOAST lowering tests           |  4.5874
Test convention compliance     |  4.20814
Transform tests                |  4

It was decided that we should aim for shaping the top four minimum. @tehrengruber suggested that the [ITIR map_ tests](https://hackmd.io/46Oa6MspRoSTiFozHzun5A?view#itir-frontend-tests-implementation-WIP) Project would profit from being shaped in the next cooldown instead, by someone very familiar with that part of the ITIR. Therefore and since it would not fit into a small batch anyway it was excluded from the shaping track of this project and replaced by [Fieldview feature testutils II](https://hackmd.io/46Oa6MspRoSTiFozHzun5A?view#backend-parametrization-iteration-2-discussion-✔-implementation-TODO).

While shaping "Toolchain config flags", a separate project idea emerged, which is to support robust and user-configurable logging throughout the toolchain. This was inserted as the fifth priority for shaping.

### Shaping Track (started 2023-05-17)

- [x] Public imports
    - [original idea description](https://hackmd.io/46Oa6MspRoSTiFozHzun5A?view#Public-API-tasks)
    - [shaped project](https://hackmd.io/sw-N-AV7SVOc6258-63VYg?view)
- [x] Exceptions
    - [original idea description](https://hackmd.io/46Oa6MspRoSTiFozHzun5A?view#exceptions-hierarchy)
    - [shaped project](https://hackmd.io/9_3Jha4MTGiGpHKAp3zb3g)
- [x] Toolchain config flags
    - [original idea description](https://hackmd.io/46Oa6MspRoSTiFozHzun5A?view#toolchain-customization-preliminar-work-PR1224)
    - [shaped project](https://hackmd.io/2l_ut1O-Q3ilK1IZboSryA?both)
- [x] Fieldview feature testutils II
    - [original idea description](https://hackmd.io/46Oa6MspRoSTiFozHzun5A?view#backend-parametrization-iteration-2-discussion-✔-implementation-TODO)
    - [shaped project](https://hackmd.io/mGSFRpRYQ5qgfZRScqTtJA)
- [ ] Toolchain logging
    - [original idea description](https://hackmd.io/46Oa6MspRoSTiFozHzun5A?view#toolchain-customization-preliminar-work-PR1224)
    - [shaped project]()

### Implementation Track (started 2023-05-31)

- [x] Public imports: @ricoh 
    - PR: https://github.com/GridTools/gt4py/pull/1263
- [x] Exceptions: @petiaccja 
- [x] Fieldview feature testutils II: @nfarabullini 