# Named method
def execute_ctrl(
self, x: float
) -> float: ...
|
[[comp.methods]]
name = "execute_ctrl"
arg_type = "float"
return_type = "float"
|
jm method comp execute_ctrl \
--arg-type \
float \
--return-type \
float
|
# Variable-length output
def execute(
self,
x: NDArray[np.complex64],
) -> NDArray[np.complex64]: ...
|
[[comp.methods]]
name = "execute"
variable_output = true
|
jm method comp execute \
--variable-output
|
# Dual output
def execute(
self,
x: NDArray[np.uint32],
) -> tuple[
NDArray[np.uint32],
NDArray[np.uint8],
]: ...
|
[[comp.methods]]
name = "execute"
return_type = "uint32_t[]"
variable_output = true
multi_output = ["uint8_t[]"]
|
jm method comp execute \
--return-type \
"uint32_t[]" \
--variable-output \
--multi-output \
"uint8_t[]"
|
# Struct-list return
def find_peaks(
self,
x: NDArray[np.float32],
) -> list[tuple[int, float]]: ...
|
[[comp.methods]]
name = "find_peaks"
arg_type = "float[]"
max_results = 64
[[comp.methods.result_fields]]
name = "index"
type = "size_t"
[[comp.methods.result_fields]]
name = "magnitude"
type = "float"
|
*TOML only* for field types.
Scaffold with `jm method`,
then edit `just-makeit.toml`
and run `jm apply`.
|
# Read-only property
@property
def length(self) -> int: ...
|
[[comp.properties]]
name = "length"
type = "int"
|
jm property comp length \
--type \
int
|
# Writable property
@property
def gain(self) -> float: ...
@gain.setter
def gain(
self, value: float
) -> None: ...
|
[[comp.properties]]
name = "gain"
type = "double"
writable = true
|
jm property comp gain \
--type \
double \
--writable
|
# Module-level function
def apply(
x: NDArray[np.float32],
scale: float,
) -> float: ...
|
[[module.dsp.functions]]
name = "apply"
return_type = "float"
[[module.dsp.functions.params]]
name = "x"
type = "float[]"
[[module.dsp.functions.params]]
name = "scale"
type = "float"
|
jm function apply \
--module dsp \
--param "x:float[]" \
--param "scale:float" \
--return-type \
float
|
# Inline function (header-only)
# same signature; compiler
# can inline at call sites
|
[[module.dsp.functions]]
name = "apply"
inline = true
|
jm function apply \
--module dsp \
--inline ...
|
# Function with array output
def magnitude_db(
x: NDArray[np.complex64],
floor: float,
) -> NDArray[np.float32]: ...
|
[[module.dsp.functions]]
name = "magnitude_db"
out_type = "float"
|
jm function magnitude_db \
--module dsp \
--param \
"x:float _Complex[]" \
--param "floor:float" \
--return-type void \
--out-type \
float
|
# Path + enum args; raises on failure
def write_header(
path: str | os.PathLike,
total: int,
sample_type: str = "cf32",
endian: str = "le",
fs: float = 1e6,
) -> None: ...
|
# just-makeit.toml — declare the enum first
[[enum]]
name = "stype"
values = ["cf32", "cf64", "ci32"]
[[module.io.functions]]
name = "write_header"
return_type = "int"
check_return = true
[[module.io.functions.params]]
name = "path"
type = "path"
[[module.io.functions.params]]
name = "total"
type = "size_t"
[[module.io.functions.params]]
name = "sample_type"
type = "int"
enum = "stype"
default = "cf32"
[[module.io.functions.params]]
name = "endian"
type = "int"
enum = "endian"
default = "le"
[[module.io.functions.params]]
name = "fs"
type = "double"
default = "1e6"
|
jm function write_header \
--module io \
--param path:path \
--param total:size_t \
--param \
sample_type:enum:stype=cf32 \
--param \
endian:enum:endian=le \
--param fs:double=1e6 \
--return-type int \
--check-return
|
# Output length from scalar param
def ciccompmf(
N: int,
R: int,
M: int,
) -> NDArray[np.float64]: ...
|
[[module.resample.functions]]
name = "ciccompmf"
out_type = "float64[M]"
|
*TOML only* — set `out_type`
to `"dtype[param]"` after
scaffolding, then run
`jm apply`.
|