Clean up API

Open
#22 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by inventorying the public names shown in cssgen.borders.OpiBorderRenderer and cssgen.render.get_opi_renderer(), including renderer classes and add_renderer(). Decide which class, method, module, and package renames are in scope, then trace their references. Done means the chosen API is consistently renamed without leaving the documented repetition or ambiguous naming behind.

Written by the indexing model from the issue text.

Description

The API contains a lot of repetition of words:
e.g. in cssgen.borders.OpiBorderRenderer
self._text_renderer = text_renderer
self._text_renderer.render(...)
and in cssgen.render.get_opi_renderer()
tr = OpiTextRenderer()
wr = OpiWidgetRenderer(tr)
cr = colors.OpiColorRenderer()
wr.add_renderer('background_color', cr)
This makes the API unnecessarily verbose.

The class, module and package names are not always self explanatory.

Renaming some classes, methods and package could simplify this, e.g. <renderer>.add_renderer() to <renderer>.add() and make it simpler to understand.

Dominant language
Python
Stars
0
Forks
5
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiamondLightSource/cssgen

All issues in DiamondLightSource/cssgen

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.