RustBCA icon indicating copy to clipboard operation
RustBCA copied to clipboard

[feature] General python binding for rustbca

Open jguterl opened this issue 7 months ago • 1 comments
trafficstars

Add a binding to run rustbca directly from python: input: string ("0D", "1D"), pydict (toml-like dict) option: add a user-defined ouput paths to dump all the outputs return int flag

jguterl avatar Apr 17 '25 18:04 jguterl

I like this feature a lot; I would be tempted to break up the input arguments into the different sections currently in the .toml input files, more like this:

reflected, sputtered, stopped = rustbca(particle_params, material_params, geometry_type, geometry_params, options)

where each argument is its own dictionary to avoid nesting them, but could be convinced otherwise. Breaking up the output arguments would also clear up some confusion.

Trajectory tracking is probably inadvisable in this form - the standalone code streams trajectory data to disk, but I wouldn't want to do that for a Python function and for typical simulations trajectory data can be several gigabytes which I wouldn't want to store in memory either. Displacements might also require some special consideration. Otherwise I think all other features should be able to be included.

It'll take some work to build out the dictionary -> struct interface on the Rust side, since none of that infrastructure exists currently, but I'll put this at the top of my development priority list since it would be very useful.

drobnyjt avatar Apr 17 '25 22:04 drobnyjt