Bolt Compute
A beet plugin that allows to use expressions instead of inline number providers.
Installation
In a beet project, use uv add bolt_compute and add the module in the require phase in your beet config:
require:
- bolt
- bolt_compute # <-- Add this line
pipeline:
- mecha
Usage
Any place where the compute command/subcommand is used, you can use the bolt subcommand to use an expression instead of a number provider. For example, instead of:
compute default {type:"minecraft:sum",operands:[1,1]}
data modify storage namespace:path path set compute default {type:"minecraft:sum",operands:[1,1]}
You can use:
compute bolt (1 + 1)
data modify storage namespace:path path set compute bolt (1 + 1)
Literals values
Bolt compute supports the following literal values:
compute bolt (storage namespace:path path) # compute default {type:"minecraft:storage",storage:"namespace:path",path:"path"}
x = 1 # bolt variable assignment
compute bolt (x + 1) # compute default {type:"minecraft:sum",operands:[1,1]}
y = "namespace:path_to_number_provider"
compute bolt (y * y) # compute default {type:"minecraft:product",operands:["namespace:path_to_number_provider","namespace:path_to_number_provider"]}
Operators
+, -, *, are supported, as well as parentheses for grouping.
Functions
Built-in functions are supported, such as :
averageexpect a list using square brackets, e.g.average([1,2,3])binomialexpect N and P, can be expressions, e.g.binomial(10, 0.5)conditionalcurrently not implementedmaximumexpect a list using square brackets, e.g.maximum([1,2,3])minimumexpect a list using square brackets, e.g.minimum([1,2,3])uniformexpect two number providers, can be expressions, e.g.uniform(1, 10)sumexpect a list using square brackets, e.g.sum([1,2,3])productexpect a list using square brackets, e.g.product([1,2,3])
Multiline expressions
Expressions can be multiline, for example:
x = 1
y = 2
compute bolt (
x + y
)
Full example
x = "namespace:path_to_number_provider"
y = 256*256
data modify storage example:main result_bolt set compute bolt (
(storage example:main prod1)*(storage example:main prod2)*(storage example:main prod3)*2
*
2485*52+
maximum([0,1,(storage example:main prod2),1])+(143)-
(y*x) + x
)
More examples can be found in the examples folder.
Metadata
Release files for bolt_compute 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bolt_compute-0.0.3.tar.gz | 40.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bolt_compute-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.2 kB
Release files / bolt_compute-0.0.3.tar.gz
| Download URL | bolt_compute-0.0.3.tar.gz |
|---|---|
| Size | 40.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
962a7af28c7ab2a2e6ee1e896698b6953d24f3bb5fb6f8276c2437dac9c64f09
|
|
BLAKE2b-256 checksum How to use checksums |
6a912fa1e90fb7ff2d9590fe8599b4261cebd3a175f685ecbe6cdad9fd11a82b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bolt_compute-0.0.3-py3-none-any.whl
| Download URL | bolt_compute-0.0.3-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb5635b9ec243cde33291f9dbc0247a4a59819cd53c4436804549e9d9f7f73f7
|
|
BLAKE2b-256 checksum How to use checksums |
b83f238a33573d0ece50a96e20f4026435210b140148b5d85eb71a47ec64ca90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|