Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

aidanheerdegen
Copy link
Contributor

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
Copy link
Owner

aekiss commented Jul 5, 2023

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 aekiss merged commit c8801e7 into aekiss:master Jul 5, 2023
@aekiss
Copy link
Owner

aekiss commented Jul 5, 2023

made an issue for stats warnings #27

@aekiss aekiss mentioned this pull request Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Namelists incorrectly serialised
2 participants