branca icon indicating copy to clipboard operation
branca copied to clipboard

Add type hints

Open Conengmo opened this issue 1 year ago • 0 comments

  • [x] Add type hints to all modules in Branca.
  • [x] Make sure Mypy passes.

Contains some functional changes as well:

  • Alter _parse_hex to output RGBA floats directly. We only use that function inside of _parse_color, which needs RGBA floats as output.
  • No longer have bytes as accepted type for color strings. That's a remnant from the Python 2 times.
  • Merge duplicate code in Link, JavascriptLink and CssLink.

Do separately later:

  • make subclasses of Figure use the same types for width and height. Also a separate PR I think. Would be easiest to have _parse_size just return a single string.
  • simplify the _camelify function. Is it even needed?
  • remove get_templates

Conengmo avatar Oct 16 '23 14:10 Conengmo