Skip to content

add auto-initialization for python#101

Merged
marcelluethi merged 2 commits into
dimwit-dev:mainfrom
marcelluethi:auto-init-python
May 6, 2026
Merged

add auto-initialization for python#101
marcelluethi merged 2 commits into
dimwit-dev:mainfrom
marcelluethi:auto-init-python

Conversation

@marcelluethi
Copy link
Copy Markdown
Contributor

So far DimWit users have to set up the Python environment manually, which is cumbersome and requires careful setup of IDEs to make running programs/tests from the IDE possible.

As a possible solution it was proposed to create a sbt plugin, which uses uv sync to simplify the process. This has, however, the disadvantage that only users who use sbt can benefit from it. This PR takes the idea from the plugin, but integrates the initialization directly into dimwit. At the time when Jax is inititalized, a uv sync is run and the python path set up accordingly. If the user has uv installed, then running dimwit will not need any setup from the user side at all.

The mechanism has been tested on my local development machine (linux) and on docker. More testing is necessary and downsides of the automatic approach need to be evaluated. If proven robust enough, this solution might offer a user friendly way to use DimWit and lower the barrier for first time users.

Make use of uv to automatically initialize the python environment before any jax operation is accessed.
Expose a separate dimwit.setup() method to allow manual initialization in cases the user needs to access python libraries before jax.

Update build.sbt and docker files

Co-authored-by: Copilot <copilot@github.com>
@marcelluethi marcelluethi requested a review from benikm91 April 26, 2026 15:04
Copy link
Copy Markdown
Collaborator

@benikm91 benikm91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets try this :)

@marcelluethi marcelluethi marked this pull request as ready for review May 6, 2026 05:34
@marcelluethi marcelluethi merged commit ad32abf into dimwit-dev:main May 6, 2026
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