MetOffice / MetOffice/CSET

Refactor plot.py

Open
#1,336 0 comments 0 reactions 0 assignees View on GitHub
cleanup
Dominant language
Python
Stars
33
Forks
19
Avg merge
1d 22h
Merged PRs (30d)
30

Description

### What problem does your feature request solve?

Every time I look at `src/CSET/operators/plot.py` I get a headache. It is by far the most complicated file we have, with a lot of stuff in it. Reviewing changes to it is painful and I'm not that confident in its testing due to all the conditional code.

This can be backed up empirically, as plot.py is our single most-changed file in CSET, with over three times the number of changes that the next most changed python file (read.py) has had. This indicates to me that we don't have it right yet.

### Describe the solution you'd like

We should refactor it somehow. TBD exactly how we can improve it, but I'm creating this issue to give some motivation to look into it.

### Describe alternatives you've considered

It does work currently, but I fear that further maintenance and improvements are going to become more difficult.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading src/CSET/operators/plot.py and reviewing its conditional paths and change history. Identify concrete responsibilities that could be separated and the tests covering them. Done would require an agreed refactoring plan and preserving current plotting behavior, but this issue does not define the target structure or acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.