Skip to content

Commit 4799baf

Browse files
committed
3.12
1 parent aa3cd84 commit 4799baf

14 files changed

Lines changed: 16 additions & 38 deletions

docs/evaluate_budget_sensitivity.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
Key insight: Optimal methods should show larger gains with tighter budgets.
88
"""
99

10-
from __future__ import annotations
11-
1210
import sys
1311
from dataclasses import dataclass
1412
from pathlib import Path

docs/evaluate_random_vs_methods.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
- Computational time
1818
"""
1919

20-
from __future__ import annotations
21-
2220
import sys
2321
import time
2422
from dataclasses import dataclass

fewlab/balanced.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import cast
42

53
import numpy as np

fewlab/calibration.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
techniques for adjusting sampling weights to match known population totals.
66
"""
77

8-
from __future__ import annotations
9-
108
from collections.abc import Sequence
119

1210
import numpy as np
@@ -16,7 +14,7 @@
1614
from .utils import get_item_positions
1715

1816
# Type alias for item selection types (Python 3.12+)
19-
type ItemSelection = Sequence[str] | pd.Index
17+
ItemSelection = Sequence[str] | pd.Index
2018

2119

2220
def calibrate_weights(

fewlab/core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
from __future__ import annotations
2-
31
from dataclasses import dataclass
42
from typing import TYPE_CHECKING
53

64
import numpy as np
75
import pandas as pd
86

97
if TYPE_CHECKING:
10-
from .results import ProbabilityResult, SelectionResult
8+
pass
119

1210
from .constants import (
1311
CONDITION_THRESHOLD,
1412
PI_MIN_DEFAULT,
1513
SMALL_RIDGE,
1614
)
15+
from .results import ProbabilityResult, SelectionResult
1716

1817

1918
@dataclass(slots=True)

fewlab/design.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
influence computations and provides comprehensive diagnostics.
77
"""
88

9-
from __future__ import annotations
10-
119
from typing import TYPE_CHECKING, Any, Literal
1210

1311
import numpy as np
@@ -29,13 +27,15 @@
2927

3028
# Import result classes at the end to avoid circular imports
3129
if TYPE_CHECKING:
32-
from .results import (
33-
CoreTailResult,
34-
EstimationResult,
35-
ProbabilityResult,
36-
SamplingResult,
37-
SelectionResult,
38-
)
30+
pass
31+
32+
from .results import (
33+
CoreTailResult,
34+
EstimationResult,
35+
ProbabilityResult,
36+
SamplingResult,
37+
SelectionResult,
38+
)
3939

4040

4141
class Design:
@@ -58,6 +58,8 @@ class Design:
5858
20
5959
"""
6060

61+
_last_budget_violation: dict[str, Any] | None
62+
6163
def __init__(
6264
self,
6365
counts: pd.DataFrame,

fewlab/greedy.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
from __future__ import annotations
2-
31
from typing import TYPE_CHECKING
42

53
import numpy as np
64
import pandas as pd
75

86
if TYPE_CHECKING:
9-
from .results import SelectionResult
7+
pass
108

119
from .constants import SMALL_RIDGE
1210
from .core import _influence
11+
from .results import SelectionResult
1312
from .validation import (
1413
validate_budget,
1514
validate_counts_matrix,

fewlab/hybrid.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
deterministic high-influence selection with balanced probabilistic sampling.
66
"""
77

8-
from __future__ import annotations
9-
108
import numpy as np
119
import pandas as pd
1210

fewlab/results.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
and dict-based returns with direct attribute access for better API consistency.
66
"""
77

8-
from __future__ import annotations
9-
108
from dataclasses import dataclass
119
from typing import Any
1210

fewlab/rowse.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import warnings
42

53
import numpy as np

0 commit comments

Comments
 (0)