refactor files into proper submodules (not functional yet)
This commit is contained in:
parent
37f6f78333
commit
05e1822c3d
23 changed files with 34 additions and 45 deletions
0
hanabi/__init__.py
Normal file
0
hanabi/__init__.py
Normal file
|
@ -2,7 +2,7 @@ from typing import Optional, List
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
||||||
import constants
|
from hanabi import constants
|
||||||
|
|
||||||
|
|
||||||
class DeckCard:
|
class DeckCard:
|
|
@ -1,14 +1,13 @@
|
||||||
#! /usr/bin/python3
|
#! /usr/bin/python3
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
|
||||||
|
|
||||||
import verboselogs
|
import verboselogs
|
||||||
|
|
||||||
from check_game import check_game
|
from check_game import check_game
|
||||||
from download_data import detailed_export_game
|
from hanabi.live.download_data import detailed_export_game
|
||||||
from compress import link
|
from hanabi.live.compress import link
|
||||||
from log_setup import logger, logger_manager
|
from hanabi.log_setup import logger, logger_manager
|
||||||
|
|
||||||
"""
|
"""
|
||||||
init db + populate tables
|
init db + populate tables
|
0
hanabi/live/__init__.py
Normal file
0
hanabi/live/__init__.py
Normal file
|
@ -2,11 +2,11 @@ import copy
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
from database import conn
|
from database import conn
|
||||||
from compress import decompress_deck, decompress_actions, link
|
from hanabi.live.compress import decompress_deck, decompress_actions, link
|
||||||
from hanabi import GameState
|
from hanabi import GameState
|
||||||
from hanab_live import HanabLiveInstance, HanabLiveGameState
|
from hanabi.live.hanab_live import HanabLiveInstance, HanabLiveGameState
|
||||||
from sat import solve_sat
|
from sat import solve_sat
|
||||||
from log_setup import logger
|
from hanabi.log_setup import logger
|
||||||
|
|
||||||
|
|
||||||
# returns minimal number T of turns (from game) after which instance was infeasible
|
# returns minimal number T of turns (from game) after which instance was infeasible
|
|
@ -3,13 +3,13 @@ from typing import Dict, Optional
|
||||||
|
|
||||||
import psycopg2.errors
|
import psycopg2.errors
|
||||||
|
|
||||||
from site_api import get, api, replay
|
from hanabi.live.site_api import get, api
|
||||||
from database.database import Game, store, load, commit, conn, cur
|
from hanabi.database.database import conn, cur
|
||||||
from compress import compress_deck, compress_actions, DeckCard, Action, InvalidFormatError
|
from hanabi.live.compress import compress_deck, compress_actions, DeckCard, Action, InvalidFormatError
|
||||||
from variants import variant_id, variant_name
|
from hanabi.live.variants import variant_id, variant_name
|
||||||
from hanab_live import HanabLiveInstance, HanabLiveGameState
|
from hanab_live import HanabLiveInstance, HanabLiveGameState
|
||||||
|
|
||||||
from log_setup import logger
|
from hanabi.log_setup import logger
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
|
@ -1,8 +1,8 @@
|
||||||
from typing import List, Optional
|
from typing import List
|
||||||
|
|
||||||
import hanabi
|
import hanabi
|
||||||
import constants
|
from hanabi import constants
|
||||||
from variants import Variant
|
from hanabi.live.variants import Variant
|
||||||
|
|
||||||
|
|
||||||
class HanabLiveInstance(hanabi.HanabiInstance):
|
class HanabLiveInstance(hanabi.HanabiInstance):
|
|
@ -5,17 +5,17 @@ import concurrent.futures
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from sat import solve_sat
|
from sat import solve_sat
|
||||||
from database.database import conn, cur
|
from hanabi.database.database import conn, cur
|
||||||
from download_data import detailed_export_game
|
from hanabi.live.download_data import detailed_export_game
|
||||||
from alive_progress import alive_bar
|
from alive_progress import alive_bar
|
||||||
from compress import decompress_deck, link
|
from hanabi.live.compress import decompress_deck, link
|
||||||
from hanabi import HanabiInstance
|
from hanabi import HanabiInstance
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
from time import perf_counter
|
from time import perf_counter
|
||||||
from greedy_solver import GameState, GreedyStrategy
|
from greedy_solver import GameState, GreedyStrategy
|
||||||
from log_setup import logger
|
from hanabi.log_setup import logger
|
||||||
from deck_analyzer import analyze, InfeasibilityReason
|
from deck_analyzer import analyze, InfeasibilityReason
|
||||||
from variants import Variant
|
from hanabi.live.variants import Variant
|
||||||
|
|
||||||
MAX_PROCESSES = 6
|
MAX_PROCESSES = 6
|
||||||
|
|
|
@ -2,7 +2,7 @@ import enum
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
from hanabi import DeckCard, ActionType
|
from hanabi import DeckCard, ActionType
|
||||||
|
|
||||||
from database.database import cur
|
from hanabi.database.database import cur
|
||||||
|
|
||||||
|
|
||||||
def variant_id(name) -> Optional[int]:
|
def variant_id(name) -> Optional[int]:
|
0
hanabi/solvers/__init__.py
Normal file
0
hanabi/solvers/__init__.py
Normal file
|
@ -1,11 +1,9 @@
|
||||||
from compress import DeckCard
|
from hanabi.live.compress import DeckCard
|
||||||
from typing import List
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from database import conn
|
from database import conn
|
||||||
from hanabi import HanabiInstance, pp_deck
|
from hanabi import HanabiInstance, pp_deck
|
||||||
from compress import decompress_deck
|
from hanabi.live.compress import decompress_deck
|
||||||
import constants
|
|
||||||
|
|
||||||
|
|
||||||
class InfeasibilityType(Enum):
|
class InfeasibilityType(Enum):
|
|
@ -2,13 +2,12 @@
|
||||||
import collections
|
import collections
|
||||||
import sys
|
import sys
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from log_setup import logger
|
from hanabi.log_setup import logger
|
||||||
from typing import Tuple, List, Optional
|
from typing import Optional
|
||||||
from time import sleep
|
|
||||||
|
|
||||||
from hanabi import DeckCard, Action, ActionType, GameState, HanabiInstance
|
from hanabi import DeckCard, GameState, HanabiInstance
|
||||||
from compress import link, decompress_deck
|
from hanabi.live.compress import link, decompress_deck
|
||||||
from database.database import conn
|
from hanabi.database.database import conn
|
||||||
|
|
||||||
|
|
||||||
class CardType(Enum):
|
class CardType(Enum):
|
|
@ -1,16 +1,13 @@
|
||||||
import copy
|
import copy
|
||||||
from pysmt.shortcuts import Symbol, Bool, Not, Implies, Iff, And, Or, AtMostOne, ExactlyOne, get_model, get_atoms, get_formula_size, get_unsat_core, Equals, GE, NotEquals, Int
|
from pysmt.shortcuts import Symbol, Bool, Not, Implies, Iff, And, Or, AtMostOne, get_model, Equals, GE, NotEquals, Int
|
||||||
from pysmt.typing import INT
|
from pysmt.typing import INT
|
||||||
from pysmt.rewritings import conjunctive_partition
|
from typing import Optional, Tuple
|
||||||
import json
|
|
||||||
from typing import List, Optional, Tuple
|
|
||||||
from concurrent.futures import ProcessPoolExecutor
|
|
||||||
|
|
||||||
from hanabi import DeckCard, Action, ActionType, GameState, HanabiInstance
|
from hanabi import DeckCard, GameState, HanabiInstance
|
||||||
from compress import link, decompress_deck
|
from hanabi.live.compress import link, decompress_deck
|
||||||
from greedy_solver import GreedyStrategy
|
from greedy_solver import GreedyStrategy
|
||||||
from constants import COLOR_INITIALS
|
from hanabi.constants import COLOR_INITIALS
|
||||||
from log_setup import logger
|
from hanabi.log_setup import logger
|
||||||
|
|
||||||
|
|
||||||
# literals to model game as sat instance to check for feasibility
|
# literals to model game as sat instance to check for feasibility
|
|
@ -1,4 +0,0 @@
|
||||||
from .logger_setup import LoggerManager
|
|
||||||
|
|
||||||
logger_manager = LoggerManager()
|
|
||||||
logger = logger_manager.get_logger()
|
|
Loading…
Reference in a new issue