Skip to content

Commit 832dec3

Browse files
ci: skip optional adapter examples in lean gate
1 parent ac00fe1 commit 832dec3

3 files changed

Lines changed: 18 additions & 15 deletions

File tree

scripts/check_example_execution.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def main(argv: Optional[List[str]] = None) -> int:
117117
first = str(e).splitlines()[0] if str(e) else ""
118118
failures.append(f"{name}: {type(e).__name__}: {first[:100]}")
119119

120-
if not args.quiet:
120+
should_print_failures = not args.quiet or (
121+
args.max_failures is not None and len(failures) > args.max_failures
122+
)
123+
if should_print_failures:
121124
for f in failures:
122125
print(f"FAIL {f}")
123126
print(f"ran_ok={ran} failed={len(failures)}")

src/statspai/fixest/wrapper.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def feols(
102102
>>> x1 = rng.normal(size=n)
103103
>>> y = 1.0 + 0.5 * x1 + 0.1 * firm + 0.2 * year + rng.normal(0, 0.5, n)
104104
>>> df = pd.DataFrame({"y": y, "x1": x1, "firm": firm, "year": year})
105-
>>> res = sp.feols("y ~ x1 | firm + year", data=df, vcov={"CRV1": "firm"})
106-
>>> "x1" in res.params.index
105+
>>> res = sp.feols("y ~ x1 | firm + year", data=df, vcov={"CRV1": "firm"}) # doctest: +SKIP
106+
>>> "x1" in res.params.index # doctest: +SKIP
107107
True
108108
109109
Multiple estimation (``csw0`` returns a list, one fit per FE set):
@@ -203,8 +203,8 @@ def fepois(
203203
>>> x1 = rng.normal(size=n)
204204
>>> mu = np.exp(0.3 + 0.5 * x1 + 0.1 * firm)
205205
>>> df = pd.DataFrame({"y": rng.poisson(mu), "x1": x1, "firm": firm})
206-
>>> res = sp.fepois("y ~ x1 | firm", data=df)
207-
>>> "x1" in res.params.index
206+
>>> res = sp.fepois("y ~ x1 | firm", data=df) # doctest: +SKIP
207+
>>> "x1" in res.params.index # doctest: +SKIP
208208
True
209209
"""
210210
pf = _check_pyfixest()
@@ -278,8 +278,8 @@ def feglm(
278278
>>> p = 1.0 / (1.0 + np.exp(-(0.2 + 0.8 * x1)))
279279
>>> y = (rng.random(n) < p).astype(int)
280280
>>> df = pd.DataFrame({"y": y, "x1": x1, "firm": firm})
281-
>>> res = sp.feglm("y ~ x1 | firm", data=df, family="logit")
282-
>>> "x1" in res.params.index
281+
>>> res = sp.feglm("y ~ x1 | firm", data=df, family="logit") # doctest: +SKIP
282+
>>> "x1" in res.params.index # doctest: +SKIP
283283
True
284284
"""
285285
pf = _check_pyfixest()
@@ -341,9 +341,9 @@ def etable(
341341
With ``sp.feols`` fits (requires the ``fixest`` extra), pyfixest's
342342
native styled table is returned instead:
343343
344-
>>> f1 = sp.feols("wage ~ x1 | firm", data=df)
345-
>>> f2 = sp.feols("wage ~ x1 + x2 | firm", data=df)
346-
>>> tab = sp.etable(f1, f2)
344+
>>> f1 = sp.feols("wage ~ x1 | firm", data=df) # doctest: +SKIP
345+
>>> f2 = sp.feols("wage ~ x1 + x2 | firm", data=df) # doctest: +SKIP
346+
>>> tab = sp.etable(f1, f2) # doctest: +SKIP
347347
"""
348348
pf_fits = [
349349
getattr(r, "_pyfixest_fit") for r in results

src/statspai/output/_gt.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,18 @@ def to_gt(
237237
>>> x = rng.normal(0, 1, n)
238238
>>> data = pd.DataFrame({'y': 1.0 + 0.5 * x + rng.normal(0, 1, n), 'x': x})
239239
>>> rt = sp.regtable(sp.regress('y ~ x', data=data), title='Demo')
240-
>>> g = sp.gt(rt) # ready-to-render great_tables.GT
241-
>>> type(g).__name__
240+
>>> g = sp.gt(rt) # doctest: +SKIP
241+
>>> type(g).__name__ # doctest: +SKIP
242242
'GT'
243-
>>> bool('<table' in g.as_raw_html()) # HTML export / Quarto
243+
>>> bool('<table' in g.as_raw_html()) # doctest: +SKIP
244244
True
245245
>>> g.as_latex() # doctest: +SKIP
246246
247247
Plain DataFrame path — promote a column to row labels:
248248
249249
>>> df = pd.DataFrame({'var': ['x', 'y'], 'M1': ['0.5***', '0.3']})
250-
>>> g2 = sp.gt(df, rowname_col='var', title='Custom table')
251-
>>> type(g2).__name__
250+
>>> g2 = sp.gt(df, rowname_col='var', title='Custom table') # doctest: +SKIP
251+
>>> type(g2).__name__ # doctest: +SKIP
252252
'GT'
253253
254254
Raises

0 commit comments

Comments
 (0)