Python 3.12 FutureWarnings #3185
|
EMC's original testing showed that the upgrade from Python 3.10 to Python 3.12 resulted in a lot of “FutureWarnings,” which are identified during NCO and EIB EE2 Reviews. Here is an example from /gpfs/f6/drsa-precip3/world-shared/Shannon.Shields/verif_global_standalone_newss_202307_anom/tmp/verif_global.875900/batch_jobs/verif_global_grid2grid_step2.out on GaeaC6: This example is from the EMC_verif-global spack-stack 1.9.3 package (which uses Python 3.11), but this exact same FutureWarning also occurs in EVS when trying to use Python 3.12. In both verification packages, this FutureWarning pops up in the plotting step associated with the respective util.py script (verif_global_util.py for EMC_verif-global and subseasonal_util.py for subseasonal EVS). Please note that this FutureWarning is not isolated to the EVS subseasonal component, and occurs in other components of EVS. |
Replies: 3 comments 5 replies
|
Hi @ShannonShields-NOAA, it looks like this warning is occurring because the value from the Since the values in the MET stat output can be type I think you should be able remove this warning by adding the Change this: to this: |
|
@ShannonShields-NOAA, we chatted about this discussion during a METplus project meeting today. @georgemccabe pointed out that the you're assuming all the For example, the I'll also note that many of the Tropical Cyclone line types written by TC-Pairs also contain strings. So, if you're reading MPR or ORANK |
|
Just wanted to provide an update on this discussion. For EVS subseasonal component, adding the following lines to the top (import section) of subseasonal_plots.py and subseasonal_util.py resolved the FutureWarnings seen in the log files: |
Hi @ShannonShields-NOAA, it looks like this warning is occurring because the value from the
VERSIONcolumn, e.g.V12.0.1, is being added to themodel_num_dfDataFrame, which has been initialized withnp.nan, so it assumes that all of the values set are of dtypefloat64.Since the values in the MET stat output can be type
strorfloat64, you will need to create themodel_num_dfDataFrame to allow other dtypes.I think you should be able remove this warning by adding the
dtype=objectargument to the function call on lines 4902-4903:Change this:
t…