Skip to content

Commit

Permalink
Formatting, lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Panchenko committed May 27, 2024
1 parent 4944379 commit 53a6ca5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
5 changes: 2 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ accsr = "^0.4.7"
cryptography = "^42.0.7"
openai = "^1.30.1"
pandas = "^2.2.1"
pillow = "^10.3.0"
plotly = "^5.19.0"
selenium = "^4.21.0"
webdriver-manager = "^4.0.1"
pillow = "^10.3.0"

[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
black = { version = "^23.7.0", extras = ["jupyter"] }
cryptography = "^42.0.7"
docutils = "0.20.1"
jinja2 = "*"
jupyter = "^1.0.0"
Expand All @@ -51,7 +52,6 @@ sphinx-jupyterbook-latex = "^1.0.0"
sphinx-togglebutton = "^0.3.2"
sphinx-toolbox = "^3.5.0"
sphinxcontrib-bibtex = "*"
cryptography = "^42.0.7"

[tool.mypy]
allow_redefinition = true
Expand Down
13 changes: 10 additions & 3 deletions src/penpy/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
class BaseSVGRenderer(abc.ABC):
@abc.abstractmethod
def render(
self, svg: str | PathLike, width: int | None = None, height: int | None = None
self,
svg: str | PathLike,
width: int | None = None,
height: int | None = None,
) -> Image.Image:
pass

Expand Down Expand Up @@ -59,7 +62,8 @@ def __init__(self, wait_time: float | None = None):
@classmethod
@contextmanager
def create_renderer(
cls, **kwargs: Unpack[ChromeSVGRendererParams]
cls,
**kwargs: Unpack[ChromeSVGRendererParams],
) -> Generator[Self, None, None]:
"""create_renderer() is the recommended way to instantiate a ChromeSVGRenderer in ensure proper teardown."""
renderer = None
Expand Down Expand Up @@ -94,7 +98,10 @@ def _render_svg(self, svg_path: str) -> Image.Image:
return Image.open(buffer)

def render(
self, svg: str | PathLike, width: int | None = None, height: int | None = None
self,
svg: str | PathLike,
width: int | None = None,
height: int | None = None,
) -> Image.Image:
if width or height:
raise NotImplementedError(
Expand Down

0 comments on commit 53a6ca5

Please sign in to comment.