To test the latest Josh features, create a JoshCLI with JarMode.DEV:
from joshpy.cli import JoshCLIfrom joshpy.jar import JarMode# Create CLI with development versioncli_dev = JoshCLI(josh_jar=JarMode.DEV)manager = ( SweepManager.builder(config) .with_registry(":memory:", experiment_name="dev_demo") .with_cli(cli_dev) .build())print(f"Using Josh version: {manager.cli.josh_jar}")manager.cleanup()manager.close()
Using Josh version: JarMode.DEV
Note
The development version contains the latest features but may be less stable than the production release. Use it when you want to try new Josh capabilities or help test upcoming features.
Using a Custom Build
For Josh team members testing local builds:
from pathlib import Pathfrom joshpy.cli import JoshCLI# Point to your custom buildcli_custom = JoshCLI(josh_jar=Path("path/to/your/joshsim-fat.jar"))manager = ( SweepManager.builder(config) .with_cli(cli_custom) .build())
This is primarily useful when developing Josh itself and testing changes through joshpy’s orchestration capabilities.
Switching Versions with JoshCLI
If you’re using JoshCLI directly (without SweepManager), the same patterns apply:
from pathlib import Pathfrom joshpy.cli import JoshCLI, ValidateConfigfrom joshpy.jar import JarMode# Stable version (default)cli = JoshCLI()print(f"Default: {cli.josh_jar}")# Development versioncli_dev = JoshCLI(josh_jar=JarMode.DEV)print(f"Development: {cli_dev.josh_jar}")# Verify it worksresult = cli.validate(ValidateConfig( script=Path("../../examples/tutorial_sweep.josh"),))print(f"Validation: {'passed'if result.success else'failed'}")
For strict environments where you want to fail fast if the version isn’t available:
from joshpy.cli import JoshCLIfrom joshpy.jar import JarMode# This will raise an error if the JAR isn't already downloadedcli = JoshCLI(josh_jar=JarMode.PROD, auto_download=False)
Summary
Default (Stable) is the right choice for most users - no configuration needed
Development version lets you test latest features, but may be less stable
Custom builds are for Josh team development workflows
joshpy automatically downloads the requested version if needed