From 9cfed0f8397165e8ca95e75b07f472b88d6fe716 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Tue, 3 Aug 2021 12:53:25 -0500 Subject: [PATCH] Specify interface and author for each module Spelling out what is public in each module helps to futureproof the project, and allows the main script to import the relevant names without contravening best practices. Buyer was missing from the main script's interface, despite being used to call Solve. This has been fixed. --- Bone Market Solver.py | 2 +- data/adjustments.py | 3 +++ data/appendages.py | 3 +++ data/buyers.py | 3 +++ data/costs.py | 3 +++ data/declarations.py | 3 +++ data/embellishments.py | 3 +++ data/skulls.py | 3 +++ data/torsos.py | 3 +++ objects/action.py | 3 +++ 10 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Bone Market Solver.py b/Bone Market Solver.py index 1e5a834..9ff4bff 100644 --- a/Bone Market Solver.py +++ b/Bone Market Solver.py @@ -1,6 +1,6 @@ """Use constraint programming to devise the optimal skeleton at the Bone Market in Fallen London.""" -__all__ = ['Declaration', 'DiplomatFascination', 'Fluctuation', 'OccasionalBuyer', 'Solve'] +__all__ = ['Buyer', 'Declaration', 'DiplomatFascination', 'Fluctuation', 'OccasionalBuyer', 'Solve'] __author__ = "Jeremy Saklad" import argparse diff --git a/data/adjustments.py b/data/adjustments.py index 6337820..a184a44 100644 --- a/data/adjustments.py +++ b/data/adjustments.py @@ -1,3 +1,6 @@ +__all__ = ['Adjustment'] +__author__ = "Jeremy Saklad" + from enum import Enum from data.costs import Cost diff --git a/data/appendages.py b/data/appendages.py index 9455060..55d2be0 100644 --- a/data/appendages.py +++ b/data/appendages.py @@ -1,3 +1,6 @@ +__all__ = ['Appendage'] +__author__ = "Jeremy Saklad" + from enum import Enum from data.costs import Cost diff --git a/data/buyers.py b/data/buyers.py index b166c4e..1bef732 100644 --- a/data/buyers.py +++ b/data/buyers.py @@ -1,3 +1,6 @@ +__all__ = ['Buyer'] +__author__ = "Jeremy Saklad" + from enum import Enum from data.costs import Cost diff --git a/data/costs.py b/data/costs.py index 381bbc4..dee0348 100644 --- a/data/costs.py +++ b/data/costs.py @@ -1,3 +1,6 @@ +__all__ = ['Cost'] +__author__ = "Jeremy Saklad" + from enum import Enum from ortools.sat.python import cp_model diff --git a/data/declarations.py b/data/declarations.py index 12ccbf0..7b09a19 100644 --- a/data/declarations.py +++ b/data/declarations.py @@ -1,3 +1,6 @@ +__all__ = ['Declaration'] +__author__ = "Jeremy Saklad" + from enum import Enum from data.costs import Cost diff --git a/data/embellishments.py b/data/embellishments.py index 02538af..b66d4f1 100644 --- a/data/embellishments.py +++ b/data/embellishments.py @@ -1,3 +1,6 @@ +__all__ = ['Embellishment'] +__author__ = "Jeremy Saklad" + from enum import Enum from data.costs import Cost diff --git a/data/skulls.py b/data/skulls.py index d383a05..86e5802 100644 --- a/data/skulls.py +++ b/data/skulls.py @@ -1,3 +1,6 @@ +__all__ = ['Skull'] +__author__ = "Jeremy Saklad" + from enum import Enum from data.costs import Cost diff --git a/data/torsos.py b/data/torsos.py index b014178..0004933 100644 --- a/data/torsos.py +++ b/data/torsos.py @@ -1,3 +1,6 @@ +__all__ = ['Torso'] +__author__ = "Jeremy Saklad" + from enum import Enum from data.costs import Cost diff --git a/objects/action.py b/objects/action.py index a7b6e41..4dfda9d 100644 --- a/objects/action.py +++ b/objects/action.py @@ -1,3 +1,6 @@ +__all__ = ['Action'] +__author__ = "Jeremy Saklad" + class Action: """An action that affects a skeleton's qualities."""