TNO Intern

Commit 83911c67 authored by Arjo Segers's avatar Arjo Segers
Browse files

Fixed sorting of collections and processors for latests versions of pandas.

parent 700743b0
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@
# 2025-04, Arjo Segers
#   Changed imports for python packaging.
#
# 2026-03, Arjo Segers
#   Fixed sorting of collections and processors for latests versions of pandas.
#

########################################################################
###
@@ -267,8 +270,11 @@ class CSO_Inquire_Plot(utopya.UtopyaRc):

            # switch:
            if table_type == "S5p":
                # collections:
                collections = df["collection"].unique()
                # list of collections ;
                # newer pandas versions return a 'StringArray',
                # convert to numpy.array to ensure that "sort()" method is available:
                collections = numpy.array( df["collection"].unique() )
                # sort in-place:
                collections.sort()

                # adhoc: skip test collections "90", "91", ..
@@ -305,8 +311,10 @@ class CSO_Inquire_Plot(utopya.UtopyaRc):

            # endif # table type

            # procesors: '010101', ...
            procs = df["processor_version"].unique()
            # procesors: '010101', ... ;
            # convert to numpy.array to have "sort()" methode:
            procs = numpy.array( df["processor_version"].unique() )
            # sort in-place:
            procs.sort()
            # count:
            nproc = len(procs)