Error in restoring the model inside the loop

Dear all,
I want to restore the model inside the loop so I can automate the extraction of the results. But when I try the following code, it gives me the error :"
fish define dataextract
loop local i(0,15)
local e0 = i * 0.01
local suf = string.build(“%0.2f”, e0)
command
model restore(“HostSoilShearingModel/Shearing_e” + suf + “.p3sav”);
@output_balldata(“HostSoilShearingData2/balldata_Shearing_e” + suf)
@output_contactdata(“HostSoilShearingData2/contactdata_Shearing_e” + suf)
endcommand
endloop
end

; execute batch
@dataextract

Error:
*** You cannot RESTORE a model from this input source (Probably a FISH command/end_command).
While processing line 137 of source GUI Console.
While executing line 136 columns 9 to 16 of source GUI Console.
While executing line 144 columns 2 to 13 of source GUI Console.
While processing line 144 of source GUI Console.

Hello @SahilW,
You cannot restore a save file in a FISH function. If you want to do batch modeling I suggest using Python like in this parameter studies example. The example is for 3DEC, but the same logic will work for PFC.

I’m facing an issue using IPython. I wrote the following lines, but an error appears. Can you help me to fix it?
import itasca as it

for i in [0.01, 0.02, 0.03, 0.04]:
filename = f"Sh25/Shearing_e{str(i)}.p3sav"
it.command(“”"
model restore model restore ‘{filename}’)

Hello @SahilW,
Can you post the python file you wrote? Remember python syntax is space sensitive when writing for loops. Just a guess but it could be something entirely different.