I have a python code that is very intricate, it has manip
, read
, write
, plot
subfolders with their respective codes to do different tasks. The way is set up is that we have a "settings file" called IncludeFile.py
which is imported as IncF
in all the codes that require settings from it (basically all). At the very beginning of the code some of those variables are even rewritten with IncF.variable = some processing to original variable
.
The script is run in a server with SLURM and the way the code is set up now I can only leave one job in queue, and I need to wait until it starts running so I can send another one with different settings. This because if I change the IncludeFile.py
before it gets inside SLURM and starts running, I'd be rewriting the settings file and would end up with duplicate runs.
I am wondering if there is a way to make the IncludeFily.py
be easily swapped. Like maybe when running the code I could do something like this to specify which file to use
python main.py IncludeFile.py.job1
But I don't see how that can be possible. It would be very annoying to have to change the header of 20+ files to change which file gets imported as IncF
but that's the only way I can come up with fixing this issue. Is there a better way?
The whole point that I need is be able to leave a bunch of jobs in queue without them being duplicate runs as they would be now.