Add DAG inference as a dicekit.learn submodule#16
Merged
Conversation
Introduce a Bayesian-network / DAG inference API (DAG, Node, Event, Evidence, Factor) in a new `dicekit.learn` submodule, queried via `p`. Core `p` becomes a `functools.singledispatch` generic that knows only about Dice; the DAG layer registers its own Node/Event handlers, so core stays unaware of the inference layer and there is no import cycle. Migrate the notebook build from nbs/build.py to `mobuild` (Makefile + dev dependency) and add a second export for nbs/learn.py -> dicekit/learn.py. Add tests/test_learn.py covering the submodule API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New feature release: adds the DAG inference submodule. Sync uv.lock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Removed per review: the symbol move is covered elsewhere. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a Bayesian-network / DAG inference API (
DAG,Node,Event,Evidence,Factor) in a newdicekit.learnsubmodule, queried throughp. Corepbecomes afunctools.singledispatchgeneric that only knows aboutDice; the DAG layer registers its ownNode/Eventhandlers, keeping core unaware of the inference layer with no import cycle. Migrates the notebook build fromnbs/build.pytomobuild(Makefile + dev dependency), adding a second export fornbs/learn.py→dicekit/learn.py. Addstests/test_learn.pycovering the submodule API; all 45 tests pass andbasedpyrightreports zero errors.🤖 Generated with Claude Code