Skip to content

Commit 2423329

Browse files
authored
Merge branch 'main' into copilot/fix-pyre-errors-in-balance-module
2 parents 433f0aa + 2e70c97 commit 2423329

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33

4+
# Auto-generated version file
5+
version.py
6+
47
# OSX
58
*.DS_Store
69

tests/test_balancedf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,13 @@ def test_BalanceDFWeights_design_effect(self) -> None:
474474
self.assertTrue(s.weights().design_effect(), 7 / 3)
475475

476476
def test_BalanceDFWeights_trim(self) -> None:
477+
np.random.seed(112358) # Fix seed for reproducibility
477478
s = Sample.from_frame(
478479
pd.DataFrame({"w": np.random.uniform(0, 1, 10000), "id": range(0, 10000)}),
479480
id_column="id",
480481
weight_column="w",
481482
)
482483
s.weights().trim(percentile=(0, 0.11), keep_sum_of_weights=False)
483-
print(s.weights().df)
484-
print(max(s.weights().df.iloc[:, 0]))
485484
self.assertTrue(max(s.weights().df.iloc[:, 0]) < 0.9)
486485

487486
def test_BalanceDFWeights_summary(self) -> None:

0 commit comments

Comments
 (0)