[~] Refactor

This commit is contained in:
Siarhei Siniak 2021-07-20 10:44:14 +03:00
parent 14c1627e13
commit 8d2666bd63

@ -918,6 +918,7 @@ def kernel_13(
'/kaggle/working', '/kaggle/working',
'/kaggle/garbage' '/kaggle/garbage'
] ]
t3 = [ t3 = [
os.path.join( os.path.join(
o, o,
@ -925,11 +926,14 @@ def kernel_13(
) )
for o in t2 for o in t2
] ]
t4 = [ t4 = [
o o
for o in t3 for o in t3
if os.path.exists(o) if os.path.exists(o)
] ]
if not len(t4) > 0: if not len(t4) > 0:
t1 = pandas.concat( t1 = pandas.concat(
sum( sum(
@ -945,9 +949,13 @@ def kernel_13(
[] []
) )
).to_xarray() ).to_xarray()
t1.to_netcdf(t3[0]) t5 = t3[0]
t1.to_netcdf(t5)
del t1
else:
t5 = t4[0]
t1 = xarray.load_dataset(t4[0]) t1 = xarray.load_dataset(t5)
return dict( return dict(
t1=t1, t1=t1,