← Về thư mục
tests/experimental-design/test_scripts.py
- doe · function · L42-L47 — def doe()
- RatioTests · class · L50-L71 — class RatioTests(unittest.TestCase)
- test_no_ratio_means_one_of_each_arm · method · L51-L54 — def test_no_ratio_means_one_of_each_arm(self) -> None
- test_a_ratio_repeats_each_arm · method · L56-L60 — def test_a_ratio_repeats_each_arm(self) -> None
- test_a_mismatched_ratio_length_is_refused · method · L62-L64 — def test_a_mismatched_ratio_length_is_refused(self) -> None
- test_non_positive_ratio_entries_are_refused · method · L66-L71 — def test_non_positive_ratio_entries_are_refused(self) -> None: # A zero-weight arm would silently vanish from the allocation.
- SimpleRandomizationTests · class · L74-L104 — class SimpleRandomizationTests(unittest.TestCase)
- test_every_unit_is_assigned_exactly_once · method · L75-L79 — def test_every_unit_is_assigned_exactly_once(self) -> None
- test_the_same_seed_reproduces_the_same_allocation · method · L81-L84 — def test_the_same_seed_reproduces_the_same_allocation(self) -> None
- test_different_seeds_generally_differ · method · L86-L89 — def test_different_seeds_generally_differ(self) -> None
- test_an_allocation_ratio_shifts_the_expected_split · method · L91-L98 — def test_an_allocation_ratio_shifts_the_expected_split(self) -> None: # Simple randomisation only balances in expectation, so assert the # direction over a large sample rather than an exact count.
- test_three_arms_are_supported · method · L100-L104 — def test_three_arms_are_supported(self) -> None
- BlockRandomizationTests · class · L107-L144 — class BlockRandomizationTests(unittest.TestCase)
- test_each_complete_block_is_exactly_balanced · method · L108-L115 — def test_each_complete_block_is_exactly_balanced(self) -> None: # This is the entire point of permuted blocks: balance holds throughout # enrollment, not only at the end.
- test_the_allocation_ratio_holds_within_every_block · method · L117-L124 — def test_the_allocation_ratio_holds_within_every_block(self) -> None
- test_a_block_size_incompatible_with_the_ratio_is_refused · method · L126-L128 — def test_a_block_size_incompatible_with_the_ratio_is_refused(self) -> None
- test_the_default_block_size_is_valid_for_the_ratio · method · L130-L133 — def test_the_default_block_size_is_valid_for_the_ratio(self) -> None
- test_a_partial_final_block_is_truncated_not_padded · method · L135-L138 — def test_a_partial_final_block_is_truncated_not_padded(self) -> None
- test_the_same_seed_reproduces_the_same_blocks · method · L140-L144 — def test_the_same_seed_reproduces_the_same_blocks(self) -> None
- StratifiedTests · class · L147-L182 — class StratifiedTests(unittest.TestCase)
- test_every_stratum_is_balanced_independently · method · L148-L157 — def test_every_stratum_is_balanced_independently(self) -> None
- test_unit_ids_are_renumbered_across_the_whole_cohort · method · L159-L163 — def test_unit_ids_are_renumbered_across_the_whole_cohort(self) -> None
- test_a_label_sequence_is_accepted_as_well_as_a_count_map · method · L165-L173 — def test_a_label_sequence_is_accepted_as_well_as_a_count_map(self) -> None
- test_strata_are_seeded_apart_so_they_do_not_share_a_pattern · method · L175-L182 — def test_strata_are_seeded_apart_so_they_do_not_share_a_pattern(self) -> None: # Every stratum getting the same permutation would defeat stratification.
- ClusterTests · class · L185-L206 — class ClusterTests(unittest.TestCase)
- test_one_row_per_cluster_keyed_by_cluster_id · method · L186-L195 — def test_one_row_per_cluster_keyed_by_cluster_id(self) -> None
- test_an_integer_count_generates_cluster_labels · method · L197-L201 — def test_an_integer_count_generates_cluster_labels(self) -> None
- test_clusters_are_blocked_so_arms_stay_balanced · method · L203-L206 — def test_clusters_are_blocked_so_arms_stay_balanced(self) -> None
- RunOrderTests · class · L209-L232 — class RunOrderTests(unittest.TestCase)
- test_run_order_is_a_permutation_of_every_row · method · L210-L214 — def test_run_order_is_a_permutation_of_every_row(self) -> None
- test_rows_are_returned_sorted_by_run_order · method · L216-L219 — def test_rows_are_returned_sorted_by_run_order(self) -> None
- test_the_original_design_is_not_mutated · method · L221-L225 — def test_the_original_design_is_not_mutated(self) -> None
- test_randomising_actually_reorders_the_runs · method · L227-L232 — def test_randomising_actually_reorders_the_runs(self) -> None: # A systematic order confounds factors with drift, which is the whole # reason this function exists.
- BalanceReportTests · class · L235-L248 — class BalanceReportTests(unittest.TestCase)
- test_counts_are_reported_per_arm · method · L236-L238 — def test_counts_are_reported_per_arm(self) -> None
- test_grouping_produces_a_stratum_by_arm_table · method · L240-L248 — def test_grouping_produces_a_stratum_by_arm_table(self) -> None
- DesignMatrixTests · class · L251-L318 — class DesignMatrixTests(unittest.TestCase)
- test_full_factorial_covers_every_combination · method · L252-L258 — def test_full_factorial_covers_every_combination(self) -> None
- test_two_level_factorial_decodes_to_the_stated_low_and_high · method · L260-L266 — def test_two_level_factorial_decodes_to_the_stated_low_and_high(self) -> None
- test_a_generator_that_names_the_wrong_factor_count_is_refused · method · L268-L270 — def test_a_generator_that_names_the_wrong_factor_count_is_refused(self) -> None
- test_a_valid_fraction_halves_the_full_factorial · method · L272-L276 — def test_a_valid_fraction_halves_the_full_factorial(self) -> None
- test_plackett_burman_drops_the_dummy_columns · method · L278-L281 — def test_plackett_burman_drops_the_dummy_columns(self) -> None
- test_box_behnken_needs_three_factors · method · L283-L285 — def test_box_behnken_needs_three_factors(self) -> None
- test_box_behnken_avoids_the_extreme_corners · method · L287-L294 — def test_box_behnken_avoids_the_extreme_corners(self) -> None: # Never using the all-low / all-high corner is the design's reason for # existing -- those runs are the unsafe or infeasible ones.
- test_latin_hypercube_stays_inside_every_factor_range · method · L296-L300 — def test_latin_hypercube_stays_inside_every_factor_range(self) -> None
- test_latin_hypercube_is_reproducible_from_its_seed · method · L302-L307 — def test_latin_hypercube_is_reproducible_from_its_seed(self) -> None
- test_randomize_adds_a_run_order_column_and_sorts_by_it · method · L309-L313 — def test_randomize_adds_a_run_order_column_and_sorts_by_it(self) -> None
- test_not_randomizing_leaves_the_design_in_canonical_order · method · L315-L318 — def test_not_randomizing_leaves_the_design_in_canonical_order(self) -> None