11"""
2- Examples for running INP files using ``Run``.
2+ Example running INP files using ``Run``.
33"""
44
55import pathlib
99
1010# Creating ``Run`` subclass.
1111class MyRun (pymcnp .cli .Run ):
12- def prehook_file (self , path ):
13- print (f'Calling ``prehook_file`` { path } ' )
12+ def prehook_file (self , path , index ):
13+ print (f'Calling ``prehook_file`` { path } { index } ' )
1414
15- def posthook_file (self , path ):
16- print (f'Calling ``posthook_file`` { path } ' )
15+ def posthook_file (self , path , index ):
16+ print (f'Calling ``posthook_file`` { path } { index } ' )
1717
1818 def prehook_batch (self , path ):
1919 print (f'Calling ``prehook_batch`` { path } ' )
@@ -23,9 +23,12 @@ def posthook_batch(self, path):
2323
2424
2525# Reading INP.
26- inp0 = pymcnp .Inp .from_file (pathlib .Path (__file__ ).parent / 'files' / 'inp' / 'F1F8.i' )
27- inp1 = pymcnp .Inp .from_file (pathlib .Path (__file__ ).parent / 'files' / 'inp' / 'F1F8.i' )
28- inp2 = pymcnp .Inp .from_file (pathlib .Path (__file__ ).parent / 'files' / 'inp' / 'F1.i' )
26+ path0 = pathlib .Path (__file__ ).parent / 'files' / 'inp' / 'F1F8.i'
27+ path1 = pathlib .Path (__file__ ).parent / 'files' / 'inp' / 'F1F8.i'
28+ path2 = pathlib .Path (__file__ ).parent / 'files' / 'inp' / 'F1.i'
29+ inp0 = pymcnp .Inp .from_file (path0 )
30+ inp1 = pymcnp .Inp .from_file (path1 )
31+ inp2 = pymcnp .Inp .from_file (path2 )
2932
3033# Running.
3134runner = MyRun ([inp0 , inp1 , inp2 ], command = 'echo' )
0 commit comments