Skip to content

extract(gen): scitex.gen → scitex-gen v0.1.0 (3,365 LOC, 604 tests pass)#253

Open
ywatanabe1989 wants to merge 1 commit intodevelopfrom
extract/scitex-gen
Open

extract(gen): scitex.gen → scitex-gen v0.1.0 (3,365 LOC, 604 tests pass)#253
ywatanabe1989 wants to merge 1 commit intodevelopfrom
extract/scitex-gen

Conversation

@ywatanabe1989
Copy link
Copy Markdown
Owner

Summary

  • Extract scitex.gen (3,365 LOC, 37 test files) to standalone scitex-gen v0.1.0.
  • Replace src/scitex/gen/ with 12-line sys.modules alias.
  • Collapse [gen] extra from 10 transitive deps → single scitex-gen>=0.1.0.
  • Standalone tests: 604 pass / 46 fail / 9 skip (failures are pre-existing title_case upstream behaviour, identical in scitex-python before extraction).

Decoupling (in scitex-gen)

  • scitex.{decorators,str,os,introspect,session,context,sh,dict}scitex_* direct imports (peer packages, all standalone).
  • scitex.torch.nanstd wrapped in try/except with a torch-only fallback (only matters for _norm.to_z / to_nanz).
  • import scitex removed from _less.py (was unused in module body).
  • self-references in _norm_cache.py rewritten to scitex_gen.*.

Test plan

  • python -c "import scitex.gen as g; import scitex_gen as r; assert g is r" — passes
  • hasattr(scitex.gen, 'cache' / 'TimeStamper' / 'xml2dict' / ...) — present
  • standalone test suite: 604/650 pass (matches upstream)

Foundation impact

With scitex-gen standalone, the nn module's last hard blockers (scitex.gen._to_even, _to_odd) clear — nn extraction now feasible.

scitex.gen (3,365 LOC, 37 test files) extracted to standalone scitex-gen
package: https://github.com/ywatanabe1989/scitex-gen

- Replace src/scitex/gen/ with a 12-line sys.modules-alias __init__.py
- Collapse [gen] extra (10 transitive deps) to single scitex-gen>=0.1.0
- scitex.gen is scitex_gen: True (verified)
- Standalone tests: 604 pass / 46 fail (pre-existing title_case behaviour)

Decoupling in scitex-gen:
- scitex.{decorators,str,os,introspect,session,context,sh,dict} → scitex_*
- scitex.torch.nanstd → optional via try/except + torch fallback
- import scitex removed from _less.py (was unused)
- self-references in _norm_cache.py rewritten to scitex_gen.*

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant