Skip to content

Use folder for each task#41

Draft
dhruvdcoder wants to merge 4 commits into
mainfrom
docs-for-creating-new-task
Draft

Use folder for each task#41
dhruvdcoder wants to merge 4 commits into
mainfrom
docs-for-creating-new-task

Conversation

@dhruvdcoder
Copy link
Copy Markdown
Owner

@dhruvdcoder dhruvdcoder commented May 13, 2026

Summary

Task code under xlm.tasks is reorganized so each task has its own package directory (src/xlm/tasks/<name>/__init__.py). Public Hydra dotted paths stay the same (for example xlm.tasks.owt.preprocess_fn, xlm.tasks.safe_molgen.DeNovoEval), so existing YAML configs under src/xlm/configs/lightning_train/ do not need bulk updates.

This PR also adds contributor-facing documentation for wiring new tasks and fixes a few stale molgen references in docs and examples.

Details

  • Layout: Former flat modules (cfg.py, owt.py, …) are renamed into subpackages with __init__.py. safe_molgen now contains the lazy facade, _safe_molgen_impl.py, and zinc_len.pkl; the lazy import targets xlm.tasks.safe_molgen._safe_molgen_impl.
  • xlm.tasks package marker: src/xlm/tasks/__init__.py documents that this file is not a barrel export of every task symbol.
  • Packaging: setup.py package_data path for the pickle is corrected to tasks/safe_molgen/zinc_len.pkl (relative to the xlm package).
  • Configs: xlm-models/mlm/configs/experiment/safe_mlm.yaml length_ref_file updated to src/xlm/tasks/safe_molgen/zinc_len.pkl.
  • Docs: New docs/guide/adding-a-task.md and a link from docs/index.md.
  • Wiki: wiki/eval.md examples updated from xlm.tasks.molgen / “molgen” wording to safe_molgen / SAFE molecular generation where appropriate.
  • Small fix: composite_eval docstring example now references xlm.tasks.safe_molgen.DeNovoEval.

Backward compatibility

  • Python / Hydra: import xlm.tasks.<name> and _target_: xlm.tasks.<name>.<callable> behavior is preserved for unchanged symbol names.
  • Filesystem: Anything that referenced src/xlm/tasks/zinc_len.pkl should use src/xlm/tasks/safe_molgen/zinc_len.pkl (updated in-repo for safe_mlm).

Verification

  • Import smoke for task subpackages and ZINC_LENGTH_REF_FILE resolution.
  • hydra.utils.get_method("xlm.tasks.owt.preprocess_fn") succeeds.
  • Targeted pytest (for example datamodule / utils tests) as run locally before opening the PR.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 33.49%. Comparing base (94fb33c) to head (2a95c6e).

Files with missing lines Patch % Lines
src/xlm/tasks/safe_molgen/__init__.py 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   34.27%   33.49%   -0.79%     
==========================================
  Files         120      120              
  Lines       10698    10698              
  Branches     1400     1400              
==========================================
- Hits         3667     3583      -84     
- Misses       6890     6976      +86     
+ Partials      141      139       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants