feat: Add high-level programmatic Python API - #715
Conversation
1f4b2b1 to
6993493
Compare
|
Here is a quick summary of our implementation in this PR addressing #707: Implementation Overview
What Else Can Be Done (Proposed Enhancements)To fully align with the issue discussion on preventing reader/writer path drift:
Please let us know if you'd like us to add these properties to |
|
Hi @GiGiKoneti, thanks for the detailed summary! The implementation looks solid - the build_parser + run split with shared code path is exactly the right approach. A few thoughts:
LGTM overall. Happy to test if you need a second pair of eyes. |
4b19623 to
6993493
Compare
|
Hi @truongsontung, thanks for the review! I've just pushed a commit adding Regarding the |
|
Great work! The Run properties look clean. Your explanation of the KEYWORD_ONLY approach makes perfect sense given the argparse foundation. LGTM - ready for maintainer review. |
7e39e8e to
6ef73fe
Compare
|
Looks good! The convenience properties are clean and match the issue requirements. Nice implementation. |
Describe your changes
Implemented a high-level programmatic Python API that wraps the CLI scripts, resolving Issue #707.
neural_lam/api.pythat exposestrain(**kwargs),evaluate(**kwargs), andcreate_graph(**kwargs).build_parser()andrun()out ofmain()in bothtrain_model.pyandcreate_graph.py.weights_only=Trueunpickling errors by registering custom dataclasses andargparse.Namespaceto safe globals inneural_lam/config.py.inspect.Signatureinjection.tests/test_api.py.Issue Link
Closes #707
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee