%matplotlib inline
import pandas as pd
import socket
host = socket.getfqdn()
from core import load, zoom, calc, save,plots,monitor
Traceback (most recent call last): File "/ccc/cont003/home/ifremer/odakatin/monitor/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3427, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-1-bbe1350b4ea7>", line 6, in <module> from core import load, zoom, calc, save,plots,monitor File "/ccc/work/cont003/gen7420/odakatin/monitor-sedna/notebook/core/__init__.py", line 11, in <module> from . import calc File "/ccc/work/cont003/gen7420/odakatin/monitor-sedna/notebook/core/calc.py", line 253 ds['Mean Velocity']=data.vomecrty*data.mask}) ^ SyntaxError: invalid syntax
#reload funcs after updating ./core/*.py
import importlib
importlib.reload(load)
importlib.reload(zoom)
importlib.reload(calc)
importlib.reload(save)
importlib.reload(plots)
importlib.reload(monitor)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-1-58e6a07d215f> in <module> 1 #reload funcs after updating ./core/*.py 2 import importlib ----> 3 importlib.reload(load) 4 importlib.reload(zoom) 5 importlib.reload(calc) NameError: name 'load' is not defined
# 'month': = 'JOBID' almost month but not really,
# If you submit the job with job scheduler, above
#below are list of enviroment variable one can pass
#%env local='2"
# local : if True run dask local cluster, if not true, put number of workers
# setted in the 'local'
# if no 'local ' given, local will be setted automatically to 'True'
#%env ychunk='2'
#%env tchunk='2'
# controls chunk. 'False' sets no modification from original netcdf file's chunk.
# ychunk=10 will group the original netcdf file to 10 by 10
# tchunk=1 will chunk the time coordinate one by one
#%env control=Fluxnet
# name of control file to be used for computation/plots/save/
#%env file_exp=
# 'file_exp': Which 'experiment' name is it?
#. this corresopnds to intake catalog name without path and .yaml
#%env year=
# for Validation, this correspoinds to path/year/month 's year
# for monitoring, this corresponids to 'date' having * means do all files in the monitoring directory
# setting it as *0[0-9] &*1[0-9]& *[2-3][0-9], the job can be separated in three lots.
#%env month=
# for monitoring this corresponds to file path path-XIOS.{month}/
#
#%env save= proceed saving? True or False , Default is setted as True
#%env plot= proceed plotting? True or False , Default is setted as True
#%env calc= proceed computation? or just load computed result? True or False , Default is setted as True
#%env calc=True
%%time
# 'savefig': Do we save output in html? or not. keep it true.
savefig=True
client,cluster,control,catalog_url,month,year,daskreport,outputpath = load.set_control(host)
!mkdir -p $outputpath
!mkdir -p $daskreport
client
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <timed exec> in <module> NameError: name 'load' is not defined
df=load.controlfile(control)
#Take out 'later' tagged computations
#df=df[~df['Value'].str.contains('later')]
df
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-1-904c323d9316> in <module> ----> 1 df=load.controlfile(control) 2 #Take out 'later' tagged computations 3 #df=df[~df['Value'].str.contains('later')] 4 df NameError: name 'load' is not defined
Each computation consists of
%%time
import os
calcswitch=os.environ.get('calc', 'True')
print('calcswitch=',calcswitch)
data = load.datas(catalog_url,df.Inputs,month,year,daskreport) if calcswitch=='True' else 0
data
calcswitch= False CPU times: user 52 µs, sys: 21 µs, total: 73 µs Wall time: 62.9 µs
0
%%time
monitor.auto(df,data,savefig,daskreport,outputpath,file_exp='SEDNA'
)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <timed eval> in <module> NameError: name 'monitor' is not defined