aekiss / run_summary

Summarise ACCESS-OM2 runs
Apache License 2.0
1 stars 1 forks source link

Fix serialisation of Namelist objects by converting to dict type #25

Closed aidanheerdegen closed 1 year ago

aidanheerdegen commented 1 year ago

Closes #24

If run with --no-stats option works fine with no errors:

$ python run_summary.py -d --no_stats /home/502/aph502/payu/access-om2/1deg_jra55_ryf
Generating run summary of /home/502/aph502/payu/access-om2/1deg_jra55_ryf...........
Writing run_summary_home_502_aph502_payu_access-om2_1deg_jra55_ryf.yaml

Writing run_summary_home_502_aph502_payu_access-om2_1deg_jra55_ryf.csv
Done.
$

If run without the option (so calculating stats) there are a bunch of warnings:

/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/lib/function_base.py:2853: RuntimeWarning: invalid value encountered in divide
  c /= stddev[:, None]
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/lib/function_base.py:2854: RuntimeWarning: invalid value encountered in divide
  c /= stddev[None, :]
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/core/_methods.py:164: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  arr = asanyarray(a)
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/lib/function_base.py:3700: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  a = np.asanyarray(a)
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/core/_methods.py:198: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  arr = asanyarray(a)
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/lib/function_base.py:2615: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  m = np.asarray(m)
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/lib/polynomial.py:629: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  x = NX.asarray(x) + 0.0
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3432: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/core/_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/core/_methods.py:265: RuntimeWarning: Degrees of freedom <= 0 for slice
  ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/core/_methods.py:223: RuntimeWarning: invalid value encountered in divide
  arrmean = um.true_divide(arrmean, div, out=arrmean, casting='unsafe',
/g/data3/hh5/public/apps/miniconda3/envs/analysis3-23.04/lib/python3.9/site-packages/numpy/core/_methods.py:257: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)

But the warnings are exactly the same without the code change, so I don't think it has created any new problems.

aekiss commented 1 year ago

Thanks @aidanheerdegen. Those warnings are unrelated and probably deserve another issue. Some of them are probably due to having to few items to calculate stats over.

aekiss commented 1 year ago

made an issue for stats warnings https://github.com/aekiss/run_summary/issues/27