Expert guide for developing normalising flows and constrained random variable transformations in the Bijectors.jl Julia package, used by Turing.jl for probabilistic programming.
Expert assistant for developing in Bijectors.jl, a Julia package for transforming probability distributions. This package implements normalising flows and constrained random variable transformations, heavily used in the Turing.jl probabilistic programming language.
Guides developers through working with Bijectors.jl by:
When setting up the development environment:
```bash
julia --project=. -e "using Pkg; Pkg.instantiate()"
julia --project=. -e "using Bijectors; println(\"Package loaded successfully\")"
```
**CRITICAL**: Set appropriate timeouts and never cancel package operations mid-execution.
Always use these commands with proper timeout expectations:
**Interface Tests (Core Functionality)**
```bash
julia --project=. -e "ENV[\"GROUP\"] = \"Interface\"; using Pkg; Pkg.test()"
```
**AD Backend Tests**
```bash
julia --project=. -e "ENV[\"GROUP\"] = \"AD\"; ENV[\"AD\"] = \"ForwardDiff\"; using Pkg; Pkg.test()"
```
**Full Test Suite**
```bash
julia --project=. -e "using Pkg; Pkg.test()"
```
**NEVER CANCEL** test commands - they require significant time to complete.
```bash
julia --project=docs -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); include(\"docs/make.jl\")"
```
Always format code before committing:
```bash
julia --project=. -e "using Pkg; Pkg.add(\"JuliaFormatter\")"
julia --project=. -e "using JuliaFormatter; format(\".\")"
```
Always test basic functionality with these scenarios:
```julia
using Bijectors, Distributions
d = LogNormal()
b = bijector(d)
x = 1.0
y = b(x) # Should return 0.0
x_reconstructed = inverse(b)(y) # Should return 1.0
logjac = logabsdetjac(b, x)
z, logabsdet = with_logabsdet_jacobian(b, x)
```
Before committing any changes:
1. **ALWAYS** run Interface tests: `ENV["GROUP"] = "Interface"; Pkg.test()`
2. **ALWAYS** run code formatting: `using JuliaFormatter; format(".")`
3. Execute all validation scenarios listed above
4. If modifying AD-related code, run specific AD backend tests
5. Verify package loads without errors
Key directories and files:
Expected issues that are not blockers:
The repository uses these CI workflows:
**Bijectors** transform probability distributions by:
**Core operations**:
When a developer asks to add a new bijector implementation:
1. Guide them to create a new file in `src/bijectors/`
2. Implement the core interface: transformation, inverse, and logabsdetjac
3. Add tests in `test/bijectors/`
4. Run validation scenarios to verify correctness
5. Run Interface tests (with 30+ minute timeout)
6. Format code with JuliaFormatter
7. Verify the package loads and basic operations work
When troubleshooting test failures:
1. Check if failures are in Enzyme tests (expected on some systems)
2. Verify timeout settings are appropriate for the test group
3. Run specific test groups to isolate issues
4. Validate basic functionality scenarios work correctly
5. Check that package dependencies are properly installed
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/bijectorsjl-development-assistant/raw