Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build := uv build
publish := uv publish --username=__token__ --keyring-provider=subprocess
python := $(run) python
ruff := $(run) ruff
lint := $(ruff) check --select I
lint := $(ruff) check
fmt := $(ruff) format
mypy := $(run) mypy
mkdocs := $(run) mkdocs
Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,26 @@ explicit = true
venvPath="."
venv=".venv"
exclude=[".venv"]

[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]
ignore = [
# I think try...expect...pass reads far better.
"SIM105",
]

[tool.ruff.lint.pycodestyle]
max-line-length = 120
6 changes: 3 additions & 3 deletions src/complexitty/data/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

##############################################################################
# Python imports.
from collections.abc import Iterator
from contextlib import contextmanager
from dataclasses import asdict, dataclass, field
from functools import lru_cache
from functools import cache
from json import dumps, loads
from pathlib import Path
from typing import Iterator

##############################################################################
# Local imports.
Expand Down Expand Up @@ -54,7 +54,7 @@ def save_configuration(configuration: Configuration) -> Configuration:


##############################################################################
@lru_cache(maxsize=None)
@cache
def load_configuration() -> Configuration:
"""Load the configuration.

Expand Down
5 changes: 3 additions & 2 deletions src/complexitty/mandelbrot/colouring.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

##############################################################################
# Python imports.
from collections.abc import Callable
from functools import lru_cache
from typing import Callable, Final, TypeAlias
from typing import Final, TypeAlias

##############################################################################
# Textual imports.
Expand Down Expand Up @@ -51,7 +52,7 @@ def default_map(value: int, max_iteration: int) -> Color:


##############################################################################
@lru_cache()
@lru_cache
def blue_brown_map(value: int, _: int) -> Color:
"""Calculate a colour for an escape value.

Expand Down
6 changes: 4 additions & 2 deletions src/complexitty/screens/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def _update_situation(self, message: Mandelbrot.Plotted) -> None:
else 0
)
message.mandelbrot.border_title = (
f"X: {message.mandelbrot.x_position:.{x_precision + 2}f} | Y: {message.mandelbrot.y_position:.{y_precision + 2}f} "
f"X: {message.mandelbrot.x_position:.{x_precision + 2}f} | "
f"Y: {message.mandelbrot.y_position:.{y_precision + 2}f} "
f"| Zoom: {message.mandelbrot.zoom:.4f}"
)
message.mandelbrot.border_subtitle = (
Expand Down Expand Up @@ -315,7 +316,8 @@ async def action_go_to_command(self) -> None:
)
else:
self.notify(
"Please provide both the [i]x[/] and [i]y[/] coordinates separated by a comma or space. For example:\n\n"
"Please provide both the [i]x[/] and [i]y[/] coordinates "
"separated by a comma or space. For example:\n\n"
"[i]0.1, 0.1[/]\n\nor:\n\n"
"[i]0.1 0.1[/]",
title="Invalid location input",
Expand Down