logit-stream 0.3.0__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. {logit_stream-0.3.0 → logit_stream-0.3.1}/CHANGELOG.md +6 -0
  2. {logit_stream-0.3.0 → logit_stream-0.3.1}/CITATION.cff +2 -2
  3. {logit_stream-0.3.0 → logit_stream-0.3.1}/PKG-INFO +3 -6
  4. {logit_stream-0.3.0 → logit_stream-0.3.1}/README.md +1 -4
  5. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/__init__.py +1 -1
  6. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/_frontend.py +9 -10
  7. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream.egg-info/PKG-INFO +3 -6
  8. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream.egg-info/requires.txt +1 -1
  9. {logit_stream-0.3.0 → logit_stream-0.3.1}/pyproject.toml +2 -2
  10. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_multinomial.py +4 -2
  11. {logit_stream-0.3.0 → logit_stream-0.3.1}/LICENSE.md +0 -0
  12. {logit_stream-0.3.0 → logit_stream-0.3.1}/MANIFEST.in +0 -0
  13. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/_choice.py +0 -0
  14. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/_limits.py +0 -0
  15. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/api.py +0 -0
  16. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/__init__.py +0 -0
  17. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/_common.py +0 -0
  18. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/fe.py +0 -0
  19. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/meat.py +0 -0
  20. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/mixed.py +0 -0
  21. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/models.py +0 -0
  22. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/nested.py +0 -0
  23. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/random_effects.py +0 -0
  24. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/device/store.py +0 -0
  25. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/estimator.py +0 -0
  26. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/fe.py +0 -0
  27. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/mixed.py +0 -0
  28. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/models.py +0 -0
  29. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/multi_fe.py +0 -0
  30. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/nested.py +0 -0
  31. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/newton.py +0 -0
  32. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/optimize.py +0 -0
  33. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/profile.py +0 -0
  34. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/py.typed +0 -0
  35. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/random_effects/__init__.py +0 -0
  36. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/random_effects/fit.py +0 -0
  37. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/random_effects/linalg.py +0 -0
  38. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/random_effects/model.py +0 -0
  39. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/random_effects/sigma.py +0 -0
  40. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/results.py +0 -0
  41. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/simulate.py +0 -0
  42. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream/store.py +0 -0
  43. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream.egg-info/SOURCES.txt +0 -0
  44. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream.egg-info/dependency_links.txt +0 -0
  45. {logit_stream-0.3.0 → logit_stream-0.3.1}/logit_stream.egg-info/top_level.txt +0 -0
  46. {logit_stream-0.3.0 → logit_stream-0.3.1}/setup.cfg +0 -0
  47. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_api.py +0 -0
  48. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_cfelogit.py +0 -0
  49. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_clustering.py +0 -0
  50. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_conditional.py +0 -0
  51. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_device.py +0 -0
  52. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_firth_and_fit.py +0 -0
  53. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_fixed_effects.py +0 -0
  54. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_headroom.py +0 -0
  55. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_index_dtype.py +0 -0
  56. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_kernels.py +0 -0
  57. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_mixed.py +0 -0
  58. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_multi_fe.py +0 -0
  59. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_nested.py +0 -0
  60. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_offset_start.py +0 -0
  61. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_ordered.py +0 -0
  62. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_probit.py +0 -0
  63. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_profile.py +0 -0
  64. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_random.py +0 -0
  65. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_resources.py +0 -0
  66. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_simulate.py +0 -0
  67. {logit_stream-0.3.0 → logit_stream-0.3.1}/tests/test_weights_scale.py +0 -0
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+
5
+ - **Works with pyfixest 0.60 and 0.70.** Formulas are read through hdfe-stream's own formula
6
+ parser, so either pyfixest version can be installed.
7
+ - Requires hdfe-stream 0.10.0 or later.
8
+
3
9
  ## 0.3.0
4
10
 
5
11
  - **The conditional logit is 2.3-2.8 times faster.** Its log-likelihood, gradient and information
@@ -7,8 +7,8 @@ authors:
7
7
  - family-names: Tucker
8
8
  given-names: Lee
9
9
  email: lee.c.tucker@census.gov
10
- version: 0.3.0
11
- date-released: 2026-11-05
10
+ version: 0.3.1
11
+ date-released: 2026-11-09
12
12
  license: MIT
13
13
  repository-code: "https://github.com/leetucker/logit-stream"
14
14
  url: "https://github.com/leetucker/logit-stream"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logit-stream
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Out-of-core logit models by streamed Newton: binary, multinomial, ordered and conditional logit, with absorbed fixed effects
5
5
  Author: Lee Tucker
6
6
  License-Expression: MIT
@@ -25,7 +25,7 @@ Classifier: Typing :: Typed
25
25
  Requires-Python: >=3.10
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE.md
28
- Requires-Dist: hdfe-stream[formula]>=0.9.0
28
+ Requires-Dist: hdfe-stream[formula]>=0.10.0
29
29
  Requires-Dist: stream-limits>=0.1.1
30
30
  Requires-Dist: polars!=1.41.*,>=1.37
31
31
  Requires-Dist: numpy>=1.24
@@ -109,10 +109,7 @@ data.
109
109
  pip install logit-stream
110
110
  ```
111
111
 
112
- Python 3.10 or later. On Python 3.15, pyfixest 0.60 (which hdfe-stream's
113
- formula extra brings in) has no wheels yet: it builds from source with a Rust
114
- toolchain and `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` set; everything else
115
- installs from wheels.
112
+ Python 3.10 or later.
116
113
 
117
114
  ## Benchmarks
118
115
 
@@ -52,10 +52,7 @@ data.
52
52
  pip install logit-stream
53
53
  ```
54
54
 
55
- Python 3.10 or later. On Python 3.15, pyfixest 0.60 (which hdfe-stream's
56
- formula extra brings in) has no wheels yet: it builds from source with a Rust
57
- toolchain and `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` set; everything else
58
- installs from wheels.
55
+ Python 3.10 or later.
59
56
 
60
57
  ## Benchmarks
61
58
 
@@ -62,7 +62,7 @@ def _version():
62
62
  from importlib.metadata import version
63
63
  return version("logit-stream")
64
64
  except Exception: # noqa: BLE001 -- not installed
65
- return "0.3.0"
65
+ return "0.3.1"
66
66
 
67
67
 
68
68
  __version__ = _version()
@@ -19,7 +19,7 @@ from hdfe_stream.core.formula import (
19
19
  categorical_vars,
20
20
  compile_design,
21
21
  numeric_expr,
22
- pyfixest_formula_api,
22
+ parse_formula,
23
23
  )
24
24
 
25
25
 
@@ -52,27 +52,26 @@ def _plan(fml: str, lf: pl.LazyFrame, intercept: bool, collect) -> list[_Spec]:
52
52
  categorical coding is still reduced rank, as with it.
53
53
  `collect(lf, what)` runs a query (so that the GPU engine applies).
54
54
  """
55
- Formula, _ = pyfixest_formula_api()
56
55
  schema = lf.collect_schema()
57
- specs = Formula.parse(fml)
56
+ specs = parse_formula(fml)
58
57
  cats = set()
59
58
  for s in specs:
60
- if s.first_stage is not None:
61
- raise ValueError(f"{s.formula}: IV formulas are not available for logit models")
62
- cats |= categorical_vars(s.second_stage.split("~", 1)[1], schema)
59
+ if s.iv is not None:
60
+ raise ValueError(f"{s.key}: IV formulas are not available for logit models")
61
+ cats |= categorical_vars(s.rhs, schema)
63
62
  levels = {}
64
63
  for v in sorted(cats):
65
64
  u = collect(lf.select(pl.col(v).drop_nulls().unique().sort()), f"levels of {v}")
66
65
  levels[v] = u[v].to_list()
67
66
  out = []
68
67
  for s in specs:
69
- dep, rhs = (t.strip() for t in s.second_stage.split("~", 1))
70
- fe = tuple(parse_fe(s.fixed_effects))
68
+ dep, rhs = s.dep, s.rhs
69
+ fe = tuple(parse_fe(s.fe))
71
70
  for d in fe:
72
71
  if "[" in d:
73
- raise ValueError(f"{s.formula}: varying slopes are not available for logit models")
72
+ raise ValueError(f"{s.key}: varying slopes are not available for logit models")
74
73
  _, cols = compile_design(dep, rhs, schema, levels, intercept=intercept and not fe)
75
74
  if not intercept:
76
75
  cols = [(nm, ex) for nm, ex in cols if nm != "Intercept"]
77
- out.append(_Spec(fml=s.formula, depvar=dep, y=_outcome_expr(dep, schema), x=cols, fe=fe))
76
+ out.append(_Spec(fml=s.key, depvar=dep, y=_outcome_expr(dep, schema), x=cols, fe=fe))
78
77
  return out
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logit-stream
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Out-of-core logit models by streamed Newton: binary, multinomial, ordered and conditional logit, with absorbed fixed effects
5
5
  Author: Lee Tucker
6
6
  License-Expression: MIT
@@ -25,7 +25,7 @@ Classifier: Typing :: Typed
25
25
  Requires-Python: >=3.10
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE.md
28
- Requires-Dist: hdfe-stream[formula]>=0.9.0
28
+ Requires-Dist: hdfe-stream[formula]>=0.10.0
29
29
  Requires-Dist: stream-limits>=0.1.1
30
30
  Requires-Dist: polars!=1.41.*,>=1.37
31
31
  Requires-Dist: numpy>=1.24
@@ -109,10 +109,7 @@ data.
109
109
  pip install logit-stream
110
110
  ```
111
111
 
112
- Python 3.10 or later. On Python 3.15, pyfixest 0.60 (which hdfe-stream's
113
- formula extra brings in) has no wheels yet: it builds from source with a Rust
114
- toolchain and `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` set; everything else
115
- installs from wheels.
112
+ Python 3.10 or later.
116
113
 
117
114
  ## Benchmarks
118
115
 
@@ -1,4 +1,4 @@
1
- hdfe-stream[formula]>=0.9.0
1
+ hdfe-stream[formula]>=0.10.0
2
2
  stream-limits>=0.1.1
3
3
  polars!=1.41.*,>=1.37
4
4
  numpy>=1.24
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "logit-stream"
7
- version = "0.3.0"
7
+ version = "0.3.1"
8
8
  description = "Out-of-core logit models by streamed Newton: binary, multinomial, ordered and conditional logit, with absorbed fixed effects"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -30,7 +30,7 @@ requires-python = ">=3.10"
30
30
  dependencies = [
31
31
  # the streaming engine, the result base classes and the formula front end;
32
32
  # binary logit is hdfe-stream's feglm_stream
33
- "hdfe-stream[formula]>=0.9.0", # 0.9.0: lower-memory Parquet batch reads (iter_groups)
33
+ "hdfe-stream[formula]>=0.10.0", # 0.10.0: pyfixest 0.70 support, parse_formula
34
34
  "stream-limits>=0.1.1", # thread and memory limits for jobs on a scheduler (0.1.1: Windows memory)
35
35
  "polars>=1.37,!=1.41.*",
36
36
  "numpy>=1.24",
@@ -216,9 +216,11 @@ def test_reports(fit):
216
216
  def test_multiple_estimation(mnl_data):
217
217
  r = mlogit_stream("y ~ csw(x1, x2)", mnl_data, verbose=False)
218
218
  assert isinstance(r, LogitMulti) and len(r) == 2
219
- assert [m.fml for m in r] == ["y ~ x1", "y ~ x1 + x2"]
219
+ # pyfixest 0.70 spells the intercept out ("y ~ 1 + x1"); 0.60 does not.
220
+ names = [m.fml for m in r]
221
+ assert [n.replace("~ 1 + ", "~ ") for n in names] == ["y ~ x1", "y ~ x1 + x2"]
220
222
  assert r.tidy().columns[0] == "fml"
221
- assert set(r.summary_dict()) == {"y ~ x1", "y ~ x1 + x2"}
223
+ assert set(r.summary_dict()) == set(names)
222
224
 
223
225
 
224
226
  def test_no_intercept(mnl_data):
File without changes
File without changes
File without changes