MathieuMoalic / amumax

fork of mumax3
Other
8 stars 1 forks source link

New Feature Request: Ability to run postprocessing scripts after simulation completion #56

Open kkingstoun opened 4 hours ago

kkingstoun commented 4 hours ago

I propose adding functionality to automatically trigger Python scripts for postprocessing directly after a simulation completes in amumax. This would streamline the simulation workflow, allowing users to automatically process data without needing to manually run additional scripts after each simulation.

We can add a new function to the mumax3 scripting API, called runPython(), that allows users to specify a Python script (and optionally, arguments) to be executed automatically once the mumax3 simulation is complete.

// Simulation setup
run(100e-9) // Run the simulation for 100ns

// Postprocessing step: Run Python script after simulation
runPython("postprocess.py", ["output_file.ovf"])
MathieuMoalic commented 2 hours ago

idk, I can do it but it will be a much worse version than just running as a bash command ... I can't think of a single advantage tbh

kkingstoun commented 1 hour ago

I would say it maight be useful solution, especially for simplifying the workflow when swapping simulations using templates. For instance, if we're using tools for swapping simulations, having everything inside the mumax script makes things easier, because everything will be contained in one place and visible in the log.

Right now, I do have bash script for this, but if this functionality were integrated into mumax itself, the process would be even more streamlined.