install:
- pip install flake8 mypy flameprof
+ pip install flake8 mypy flameprof build
.venv:
python -m venv .venv
python -m cProfile -o out.prof __main__.py
flameprof out.prof > prof.svg
+package:
+ python -m build --sdist mazegen
+
run:
clean:
profile:
python -m cProfile -o out.prof __main__.py
-.PHONY: install venv run clean lint lint-strict profile
+.PHONY: install venv run clean lint lint-strict profile package
-from amazeing.display.observer import MazeRegenerate, TTYTracker
-from amazeing.maze import (
+from mazegen.display.observer import MazeRegenerate, TTYTracker
+from mazegen.maze import (
Maze,
Pattern,
make_empty,
make_perfect,
make_empty,
)
-from amazeing.config.config_parser import Config
+from mazegen.config.config_parser import Config
import random
config = Config.parse(open("./example.conf").read())
from collections.abc import Callable
from typing import Any, Type, cast
-from amazeing.utils import IVec2
+from mazegen.utils import IVec2
from .parser_combinator import (
ParseResult,
Parser,
@staticmethod
def parse(s: str) -> "Config":
- from amazeing.maze import Pattern
+ from mazegen.maze import Pattern
fields = parser_complete(
fields_parser(
from abc import ABC, abstractmethod
from collections.abc import Callable
-from amazeing.utils import IVec2
+from mazegen.utils import IVec2
class BInt:
from sys import stderr
import time
-from amazeing.config.config_parser import Config
-from amazeing.display.tty import TTYBackend, TileCycle
-from amazeing.maze.dirty_tracker import DirtyTracker
-from amazeing.maze.maze import Maze
-from amazeing.maze.path import path_pixels, pathfind_astar
-from amazeing.utils.coords import Cardinal
+from mazegen.config.config_parser import Config
+from mazegen.display.tty import TTYBackend, TileCycle
+from mazegen.maze.dirty_tracker import DirtyTracker
+from mazegen.maze.maze import Maze
+from mazegen.maze.path import path_pixels, pathfind_astar
+from mazegen.utils.coords import Cardinal
class MazeRegenerate(Exception):
from abc import ABC, abstractmethod
from collections.abc import Callable, Generator, Iterable
from dataclasses import dataclass
-from amazeing.utils import BiMap
-from amazeing.config.config_parser import Color, Config, ColoredLine, ColorPair
-from amazeing.display.layout import (
+from mazegen.utils import BiMap
+from mazegen.config.config_parser import Color, Config, ColoredLine, ColorPair
+from mazegen.display.layout import (
BInt,
Box,
DBox,
layout_sort_chunked,
layout_split,
)
-from amazeing.utils import Rect, QuadTree, IVec2
+from mazegen.utils import Rect, QuadTree, IVec2
import curses
-from amazeing.utils.coords import Orientation
+from mazegen.utils.coords import Orientation
class BackendException(Exception):
-from amazeing.maze import Maze
-from amazeing.utils import WallCoord
+from mazegen.maze import Maze
+from mazegen.utils import WallCoord
class DirtyTracker:
-from amazeing.maze import Maze
-from amazeing.utils import WallCoord
+from mazegen.maze import Maze
+from mazegen.utils import WallCoord
import random
-from amazeing.maze import Maze
-from amazeing.utils import WallCoord
+from mazegen.maze import Maze
+from mazegen.utils import WallCoord
import random
-from amazeing.maze import PacmanTracker
+from mazegen.maze import PacmanTracker
def make_pacman(
-from amazeing.maze import Maze
+from mazegen.maze import Maze
import random
-from amazeing.maze import NetworkTracker
+from mazegen.maze import NetworkTracker
def make_perfect(
from typing import Callable, Generator, Iterable
-from amazeing.config.config_parser import Config
-from amazeing.utils import (
+from mazegen.config.config_parser import Config
+from mazegen.utils import (
CellCoord,
Orientation,
WallCoord,
-from amazeing.maze import Maze
-from amazeing.utils.coords import (
+from mazegen.maze import Maze
+from mazegen.utils.coords import (
Cardinal,
CellCoord,
split_wall_ccw,
split_wall_cw,
split_wall_opposite,
)
-from amazeing.utils import AVLTree, AVLLeaf, SplitWall, WallCoord
-from amazeing.utils.avl import BVHKey
-from amazeing.utils.quadtree import Rect
+from mazegen.utils import AVLTree, AVLLeaf, SplitWall, WallCoord
+from mazegen.utils.avl import BVHKey
+from mazegen.utils.quadtree import Rect
class DualForest:
from collections.abc import Iterable
-from amazeing.maze import Maze
-from amazeing.utils import Randset, WallCoord
+from mazegen.maze import Maze
+from mazegen.utils import Randset, WallCoord
class PacmanTracker:
from collections.abc import Generator
from dataclasses import dataclass
-from amazeing.maze.maze import Maze
-from amazeing.utils.coords import Cardinal, CellCoord
-from amazeing.utils.ivec2 import IVec2
+from mazegen.maze.maze import Maze
+from mazegen.utils.coords import Cardinal, CellCoord
+from mazegen.utils.ivec2 import IVec2
import heapq
from collections.abc import Iterable, Generator, Callable
-from amazeing.utils import IVec2, CellCoord
-from amazeing.maze import Maze
+from mazegen.utils import IVec2, CellCoord
+from mazegen.maze import Maze
class Pattern:
from typing import Self, cast
import textwrap
-from amazeing.utils.coords import CellCoord, SplitWall
-from amazeing.utils.ivec2 import IVec2
-from amazeing.utils.quadtree import Rect
+from mazegen.utils.coords import CellCoord, SplitWall
+from mazegen.utils.ivec2 import IVec2
+from mazegen.utils.quadtree import Rect
class Key(ABC):
-from amazeing.utils.avl import (
+from mazegen.utils.avl import (
Tree as AVLTree,
Leaf as AVLLeaf,
NoopKey as AVLNoopKey,
from enum import Enum, auto
from typing import Iterable, cast, overload
-from amazeing.utils.ivec2 import IVec2
+from mazegen.utils.ivec2 import IVec2
class Orientation(Enum):
from collections.abc import Callable, Generator
-from amazeing.utils.ivec2 import IVec2
+from mazegen.utils.ivec2 import IVec2
from functools import partial
from itertools import chain