Skip to content

Commit

Permalink
flake8 and black.
Browse files Browse the repository at this point in the history
  • Loading branch information
mshukuno committed Mar 8, 2024
1 parent ce66464 commit ff47aa2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
15 changes: 7 additions & 8 deletions popsborder/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ def main():
)
basic = parser.add_argument_group("Simulation parameters (required)")
basic.add_argument(
"--num-consignments", type=int, required=True,
help="Number of consignments"
"--num-consignments", type=int, required=True, help="Number of consignments"
)
basic.add_argument(
"--config-file", type=str, required=True,
help="Path to configuration file"
"--config-file", type=str, required=True, help="Path to configuration file"
)
optional = parser.add_argument_group("Running simulations (optional)")
optional.add_argument(
Expand All @@ -92,8 +90,7 @@ def main():
)
output_group = parser.add_argument_group("Output (optional)")
output_group.add_argument(
"--output-file", type=str, required=False,
help="Path to output F280 csv file"
"--output-file", type=str, required=False, help="Path to output F280 csv file"
)
pretty_choices = (
("boxes", "Show boxes with individual items (default)"),
Expand All @@ -106,8 +103,10 @@ def main():
const="boxes", # default behavior for pretty
nargs="?", # value is optional
choices=[i[0] for i in pretty_choices],
help=("Show pretty unicode output for each consignment\n"
+ "\n".join(["\n ".join(i) for i in pretty_choices])),
help=(
"Show pretty unicode output for each consignment\n"
+ "\n".join(["\n ".join(i) for i in pretty_choices])
),
)
output_group.add_argument(
"-v",
Expand Down
8 changes: 5 additions & 3 deletions popsborder/contamination.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ def choose_strata_for_clusters(num_units, cluster_width, num_clusters):
# Make sure there are enough strata for the number of clusters needed.
if num_strata < num_clusters:
raise ValueError(
("Cannot avoid overlapping clusters. Increase "
"contaminated_units_per_cluster or decrease cluster_item_width (if using "
"item contamination_unit)")
(
"Cannot avoid overlapping clusters. Increase "
"contaminated_units_per_cluster or decrease cluster_item_width (if "
"using item contamination_unit)"
)
)
# If all strata are needed, all strata are selected for clusters
if num_clusters == num_strata:
Expand Down
4 changes: 2 additions & 2 deletions popsborder/inspections.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def inspect(config, consignment, n_units_to_inspect, detailed):
inspect_per_box = sample_remainder
# In each box, loop through first n items (n = inspect_per_box)
for item_in_box_index, item in enumerate(
(consignment.boxes[box_index]).items[0:inspect_per_box]
(consignment.boxes[box_index]).items[0:inspect_per_box]
):
if detailed:
item_index = consignment.item_in_box_to_item_index(
Expand Down Expand Up @@ -553,7 +553,7 @@ def inspect(config, consignment, n_units_to_inspect, detailed):
ret.boxes_opened_detection += 1
# In each box, loop through first n items (n = inspect_per_box)
for item_in_box_index, item in enumerate(
(consignment.boxes[box_index]).items[0:inspect_per_box]
(consignment.boxes[box_index]).items[0:inspect_per_box]
):
if detailed:
item_index = consignment.item_in_box_to_item_index(
Expand Down

0 comments on commit ff47aa2

Please sign in to comment.