From 5c811280d746d5298a2ea8bcfe6e7ed875596ad8 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Tue, 7 Dec 2021 06:30:52 +0100 Subject: [PATCH] move everything into a submodule to avoid namespace collisions --- tools/__init__.py | 0 aoc.py => tools/aoc.py | 4 ++-- coordinate.py => tools/coordinate.py | 0 daemon.py => tools/daemon.py | 0 datafiles.py => tools/datafiles.py | 0 grid.py => tools/grid.py | 0 tools/int_seq.py | 5 +++++ irc.py => tools/irc.py | 0 schedule.py => tools/schedule.py | 0 setup.py => tools/setup.py | 0 simplesocket.py => tools/simplesocket.py | 0 tools.py => tools/tools.py | 0 12 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 tools/__init__.py rename aoc.py => tools/aoc.py (98%) rename coordinate.py => tools/coordinate.py (100%) rename daemon.py => tools/daemon.py (100%) rename datafiles.py => tools/datafiles.py (100%) rename grid.py => tools/grid.py (100%) create mode 100644 tools/int_seq.py rename irc.py => tools/irc.py (100%) rename schedule.py => tools/schedule.py (100%) rename setup.py => tools/setup.py (100%) rename simplesocket.py => tools/simplesocket.py (100%) rename tools.py => tools/tools.py (100%) diff --git a/tools/__init__.py b/tools/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/aoc.py b/tools/aoc.py similarity index 98% rename from aoc.py rename to tools/aoc.py index b7236ca..7e21a9c 100644 --- a/aoc.py +++ b/tools/aoc.py @@ -1,8 +1,8 @@ import os -import tools from typing import List, Any, Type, Union +from .tools import get_script_dir -BASE_PATH = tools.get_script_dir() +BASE_PATH = get_script_dir() INPUTS_PATH = os.path.join(BASE_PATH, 'inputs') diff --git a/coordinate.py b/tools/coordinate.py similarity index 100% rename from coordinate.py rename to tools/coordinate.py diff --git a/daemon.py b/tools/daemon.py similarity index 100% rename from daemon.py rename to tools/daemon.py diff --git a/datafiles.py b/tools/datafiles.py similarity index 100% rename from datafiles.py rename to tools/datafiles.py diff --git a/grid.py b/tools/grid.py similarity index 100% rename from grid.py rename to tools/grid.py diff --git a/tools/int_seq.py b/tools/int_seq.py new file mode 100644 index 0000000..67dbd96 --- /dev/null +++ b/tools/int_seq.py @@ -0,0 +1,5 @@ +def triangular(n: int) -> int: + """ + 0, 1, 3, 6, 10, 15, ... + """ + return int(n * (n + 1) / 2) diff --git a/irc.py b/tools/irc.py similarity index 100% rename from irc.py rename to tools/irc.py diff --git a/schedule.py b/tools/schedule.py similarity index 100% rename from schedule.py rename to tools/schedule.py diff --git a/setup.py b/tools/setup.py similarity index 100% rename from setup.py rename to tools/setup.py diff --git a/simplesocket.py b/tools/simplesocket.py similarity index 100% rename from simplesocket.py rename to tools/simplesocket.py diff --git a/tools.py b/tools/tools.py similarity index 100% rename from tools.py rename to tools/tools.py