diff --git a/versions/master/html/CIME_api/CIME.BuildTools.html b/versions/master/html/CIME_api/CIME.BuildTools.html index 58c98756ffa..2ad8d99cb9c 100644 --- a/versions/master/html/CIME_api/CIME.BuildTools.html +++ b/versions/master/html/CIME_api/CIME.BuildTools.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,12 +138,12 @@
    -

    CIME.BuildTools package

    +

    CIME.BuildTools package

    -

    Submodules

    +

    Submodules

    -

    CIME.BuildTools.configure module

    +

    CIME.BuildTools.configure module

    This script writes CIME build information to a directory.

    The pieces of information that will be written include:

      @@ -157,27 +158,27 @@

      Submodules
      -class CIME.BuildTools.configure.FakeCase(compiler, mpilib, debug, comp_interface, threading=False)[source]
      +class CIME.BuildTools.configure.FakeCase(compiler, mpilib, debug, comp_interface, threading=False)[source]

      Bases: object

      -get_build_threaded()[source]
      +get_build_threaded()[source]
      -get_case_root()[source]
      +get_case_root()[source]

      Returns the root directory for this case.

      -get_value(attrib)[source]
      +get_value(attrib)[source]
      -set_value(attrib, value)[source]
      +set_value(attrib, value)[source]

      Sets a given variable value for the case

      @@ -185,7 +186,7 @@

      Submodules
      -CIME.BuildTools.configure.configure(machobj, output_dir, macros_format, compiler, mpilib, debug, comp_interface, sysos, unit_testing=False, noenv=False, threaded=False, extra_machines_dir=None)[source]
      +CIME.BuildTools.configure.configure(machobj, output_dir, macros_format, compiler, mpilib, debug, comp_interface, sysos, unit_testing=False, noenv=False, threaded=False, extra_machines_dir=None)[source]

      Add Macros, Depends, and env_mach_specific files to a directory.

      Arguments: machobj - Machines argument for this machine. @@ -209,20 +210,20 @@

      Submodules
      -CIME.BuildTools.configure.copy_depends_files(machine_name, machines_dir, output_dir, compiler)[source]
      +CIME.BuildTools.configure.copy_depends_files(machine_name, machines_dir, output_dir, compiler)[source]

      Copy any system or compiler Depends files if they do not exist in the output directory If there is a match for Depends.machine_name.compiler copy that and ignore the others

      -CIME.BuildTools.configure.generate_env_mach_specific(output_dir, machobj, compiler, mpilib, debug, comp_interface, sysos, unit_testing, threaded, noenv=False)[source]
      +CIME.BuildTools.configure.generate_env_mach_specific(output_dir, machobj, compiler, mpilib, debug, comp_interface, sysos, unit_testing, threaded, noenv=False)[source]

      env_mach_specific generation.

    -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.Servers.html b/versions/master/html/CIME_api/CIME.Servers.html index 794e5f602b1..8515adeff95 100644 --- a/versions/master/html/CIME_api/CIME.Servers.html +++ b/versions/master/html/CIME_api/CIME.Servers.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,36 +138,36 @@
    -

    CIME.Servers package

    +

    CIME.Servers package

    -

    Submodules

    +

    Submodules

    -

    CIME.Servers.ftp module

    +

    CIME.Servers.ftp module

    FTP Server class. Interact with a server using FTP protocol

    -class CIME.Servers.ftp.FTP(address, user='', passwd='', server=None)[source]
    +class CIME.Servers.ftp.FTP(address, user='', passwd='', server=None)[source]

    Bases: GenericServer

    -fileexists(rel_path)[source]
    +fileexists(rel_path)[source]

    Returns True if rel_path exists on server

    -classmethod ftp_login(address, user='', passwd='')[source]
    +classmethod ftp_login(address, user='', passwd='')[source]
    -getdirectory(rel_path, full_path)[source]
    +getdirectory(rel_path, full_path)[source]
    -getfile(rel_path, full_path)[source]
    +getfile(rel_path, full_path)[source]

    Get file from rel_path on server and place in location full_path on client fail if full_path already exists on client, return True if successful

    @@ -175,23 +176,23 @@

    Submodules -

    CIME.Servers.generic_server module

    +

    CIME.Servers.generic_server module

    Generic Server class. There should be little or no functionality in this class, it serves only to make sure that specific server classes maintain a consistant argument list and functionality so that they are interchangable objects

    -class CIME.Servers.generic_server.GenericServer(host=' ', user=' ', passwd=' ', acct=' ', timeout=<object object>)[source]
    +class CIME.Servers.generic_server.GenericServer(host=' ', user=' ', passwd=' ', acct=' ', timeout=<object object>)[source]

    Bases: object

    -fileexists(rel_path)[source]
    +fileexists(rel_path)[source]

    Returns True if rel_path exists on server

    -getfile(rel_path, full_path)[source]
    +getfile(rel_path, full_path)[source]

    Get file from rel_path on server and place in location full_path on client fail if full_path already exists on client, return True if successful

    @@ -200,26 +201,26 @@

    Submodules -

    CIME.Servers.gftp module

    +

    CIME.Servers.gftp module

    GridFTP Server class. Interact with a server using GridFTP protocol

    -class CIME.Servers.gftp.GridFTP(address, user='', passwd='')[source]
    +class CIME.Servers.gftp.GridFTP(address, user='', passwd='')[source]

    Bases: GenericServer

    -fileexists(rel_path)[source]
    +fileexists(rel_path)[source]

    Returns True if rel_path exists on server

    -getdirectory(rel_path, full_path)[source]
    +getdirectory(rel_path, full_path)[source]
    -getfile(rel_path, full_path)[source]
    +getfile(rel_path, full_path)[source]

    Get file from rel_path on server and place in location full_path on client fail if full_path already exists on client, return True if successful

    @@ -228,26 +229,26 @@

    Submodules -

    CIME.Servers.svn module

    +

    CIME.Servers.svn module

    SVN Server class. Interact with a server using SVN protocol

    -class CIME.Servers.svn.SVN(address, user='', passwd='')[source]
    +class CIME.Servers.svn.SVN(address, user='', passwd='')[source]

    Bases: GenericServer

    -fileexists(rel_path)[source]
    +fileexists(rel_path)[source]

    Returns True if rel_path exists on server

    -getdirectory(rel_path, full_path)[source]
    +getdirectory(rel_path, full_path)[source]
    -getfile(rel_path, full_path)[source]
    +getfile(rel_path, full_path)[source]

    Get file from rel_path on server and place in location full_path on client fail if full_path already exists on client, return True if successful

    @@ -256,40 +257,40 @@

    Submodules -

    CIME.Servers.wget module

    +

    CIME.Servers.wget module

    WGET Server class. Interact with a server using WGET protocol

    -class CIME.Servers.wget.WGET(address, user='', passwd='')[source]
    +class CIME.Servers.wget.WGET(address, user='', passwd='')[source]

    Bases: GenericServer

    -fileexists(rel_path)[source]
    +fileexists(rel_path)[source]

    Returns True if rel_path exists on server

    -getdirectory(rel_path, full_path)[source]
    +getdirectory(rel_path, full_path)[source]
    -getfile(rel_path, full_path)[source]
    +getfile(rel_path, full_path)[source]

    Get file from rel_path on server and place in location full_path on client fail if full_path already exists on client, return True if successful

    -classmethod wget_login(address, user='', passwd='')[source]
    +classmethod wget_login(address, user='', passwd='')[source]
    -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.SystemTests.html b/versions/master/html/CIME_api/CIME.SystemTests.html index 1b061538294..1009e0277f3 100644 --- a/versions/master/html/CIME_api/CIME.SystemTests.html +++ b/versions/master/html/CIME_api/CIME.SystemTests.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,9 +138,9 @@
    -

    CIME.SystemTests package

    +

    CIME.SystemTests package

    -

    Subpackages

    +

    Subpackages

    -

    CIME.SystemTests.dae module

    +

    CIME.SystemTests.dae module

    Implementation of the CIME data assimilation test: Compares standard run with run broken into two data assimilation cycles. Runs a simple DA script on each cycle which performs checks but does not change any model state (restart files). Compares answers of two runs.

    -class CIME.SystemTests.dae.DAE(case, **kwargs)[source]
    +class CIME.SystemTests.dae.DAE(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    Implementation of the CIME data assimilation test: Compares standard run with a run broken into two data assimilation cycles. @@ -175,7 +176,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    Runs both phases of the two-phase test and compares their results If success_change is True, success requires some files to be different

    @@ -184,15 +185,15 @@

    Submodules -

    CIME.SystemTests.eri module

    +

    CIME.SystemTests.eri module

    CIME ERI test This class inherits from SystemTestsCommon

    -class CIME.SystemTests.eri.ERI(case, **kwargs)[source]
    +class CIME.SystemTests.eri.ERI(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -202,16 +203,16 @@

    Submodules -

    CIME.SystemTests.erio module

    +

    CIME.SystemTests.erio module

    ERIO tests restart with different PIO methods

    This class inherits from SystemTestsCommon

    -class CIME.SystemTests.erio.ERIO(case, **kwargs)[source]
    +class CIME.SystemTests.erio.ERIO(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -221,7 +222,7 @@

    Submodules -

    CIME.SystemTests.erp module

    +

    CIME.SystemTests.erp module

    CIME ERP test. This class inherits from RestartTest

    This is a pes counts hybrid (open-MP/MPI) restart bfb test from startup. This is just like an ERS test but the pe-counts/threading @@ -230,43 +231,43 @@

    Submodules
    -class CIME.SystemTests.erp.ERP(case, **kwargs)[source]
    +class CIME.SystemTests.erp.ERP(case, **kwargs)[source]

    Bases: RestartTest

    -

    CIME.SystemTests.err module

    +

    CIME.SystemTests.err module

    CIME ERR test This class inherits from ERS ERR tests short term archiving and restart capabilities

    -class CIME.SystemTests.err.ERR(case, **kwargs)[source]
    +class CIME.SystemTests.err.ERR(case, **kwargs)[source]

    Bases: RestartTest

    -

    CIME.SystemTests.erri module

    +

    CIME.SystemTests.erri module

    CIME ERRI test This class inherits from ERR ERRI tests short term archiving and restart capabilities with “incomplete” (unzipped) log files

    -class CIME.SystemTests.erri.ERRI(case, **kwargs)[source]
    +class CIME.SystemTests.erri.ERRI(case, **kwargs)[source]

    Bases: ERR

    -

    CIME.SystemTests.ers module

    +

    CIME.SystemTests.ers module

    CIME restart test This class inherits from SystemTestsCommon

    -class CIME.SystemTests.ers.ERS(case, **kwargs)[source]
    +class CIME.SystemTests.ers.ERS(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -276,15 +277,15 @@

    Submodules -

    CIME.SystemTests.ers2 module

    +

    CIME.SystemTests.ers2 module

    CIME restart test 2 This class inherits from SystemTestsCommon

    -class CIME.SystemTests.ers2.ERS2(case, **kwargs)[source]
    +class CIME.SystemTests.ers2.ERS2(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -294,16 +295,16 @@

    Submodules -

    CIME.SystemTests.ert module

    +

    CIME.SystemTests.ert module

    CIME production restart test This class inherits from SystemTestsCommon Exact restart from startup, default 2 month + 1 month

    -class CIME.SystemTests.ert.ERT(case, **kwargs)[source]
    +class CIME.SystemTests.ert.ERT(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -313,16 +314,16 @@

    Submodules -

    CIME.SystemTests.funit module

    +

    CIME.SystemTests.funit module

    CIME FUNIT test. This class inherits from SystemTestsCommon. It runs the fortran unit tests; grid and compset are ignored.

    -class CIME.SystemTests.funit.FUNIT(case, **kwargs)[source]
    +class CIME.SystemTests.funit.FUNIT(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -331,13 +332,13 @@

    Submodules
    -get_test_spec_dir()[source]
    +get_test_spec_dir()[source]

    Override this to change what gets tested.

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -347,24 +348,24 @@

    Submodules -

    CIME.SystemTests.homme module

    +

    CIME.SystemTests.homme module

    -class CIME.SystemTests.homme.HOMME(case, **kwargs)[source]
    +class CIME.SystemTests.homme.HOMME(case, **kwargs)[source]

    Bases: HommeBase

    -

    CIME.SystemTests.hommebaseclass module

    +

    CIME.SystemTests.hommebaseclass module

    CIME HOMME test. This class inherits from SystemTestsCommon

    -class CIME.SystemTests.hommebaseclass.HommeBase(case, **kwargs)[source]
    +class CIME.SystemTests.hommebaseclass.HommeBase(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -373,7 +374,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -383,24 +384,24 @@

    Submodules -

    CIME.SystemTests.hommebfb module

    +

    CIME.SystemTests.hommebfb module

    -class CIME.SystemTests.hommebfb.HOMMEBFB(case, **kwargs)[source]
    +class CIME.SystemTests.hommebfb.HOMMEBFB(case, **kwargs)[source]

    Bases: HommeBase

    -

    CIME.SystemTests.icp module

    +

    CIME.SystemTests.icp module

    CIME ICP test This class inherits from SystemTestsCommon

    -class CIME.SystemTests.icp.ICP(case, **kwargs)[source]
    +class CIME.SystemTests.icp.ICP(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -409,7 +410,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -419,7 +420,7 @@

    Submodules -

    CIME.SystemTests.irt module

    +

    CIME.SystemTests.irt module

    Implementation of the CIME IRT. (Interim Restart Test) This test the model’s restart capability as well as the short term archiver’s interim restart capability

      @@ -432,23 +433,23 @@

      Submodules
      -class CIME.SystemTests.irt.IRT(case, **kwargs)[source]
      +class CIME.SystemTests.irt.IRT(case, **kwargs)[source]

      Bases: RestartTest

    -

    CIME.SystemTests.ldsta module

    +

    CIME.SystemTests.ldsta module

    CIME last date short term archiver test. This class inherits from SystemTestsCommon It does a run without restarting, then runs the archiver with various last-date parameters The test verifies the archive directory contains the expected files

    -class CIME.SystemTests.ldsta.LDSTA(case, **kwargs)[source]
    +class CIME.SystemTests.ldsta.LDSTA(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -458,7 +459,7 @@

    Submodules -

    CIME.SystemTests.mcc module

    +

    CIME.SystemTests.mcc module

    Implemetation of CIME MCC test: Compares ensemble methods

    This does two runs: In the first we run a three member ensemble using the

    MULTI_DRIVER capability, then we run a second single instance case and compare

    @@ -466,24 +467,24 @@

    Submodules
    -class CIME.SystemTests.mcc.MCC(case, **kwargs)[source]
    +class CIME.SystemTests.mcc.MCC(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.mvk module

    +

    CIME.SystemTests.mvk module

    Multivariate test for climate reproducibility using the Kolmogrov-Smirnov (K-S) test and based on The CESM/E3SM model’s multi-instance capability is used to conduct an ensemble of simulations starting from different initial conditions.

    This class inherits from SystemTestsCommon.

    -class CIME.SystemTests.mvk.MVK(case, **kwargs)[source]
    +class CIME.SystemTests.mvk.MVK(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -494,7 +495,7 @@

    Submodules -

    CIME.SystemTests.nck module

    +

    CIME.SystemTests.nck module

    Implementation of the CIME NCK test: Tests multi-instance

    This does two runs: In the first, we use one instance per component; in the second, we use two instances per components. NTASKS are changed in each run so @@ -502,13 +503,13 @@

    Submodules
    -class CIME.SystemTests.nck.NCK(case, **kwargs)[source]
    +class CIME.SystemTests.nck.NCK(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.ncr module

    +

    CIME.SystemTests.ncr module

    Implementation of the CIME NCR test. This class inherits from SystemTestsCommon

    Build two exectuables for this test: The first runs two instances for each component with the same total number of tasks, @@ -517,21 +518,21 @@

    Submodules
    -class CIME.SystemTests.ncr.NCR(case, **kwargs)[source]
    +class CIME.SystemTests.ncr.NCR(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.nodefail module

    +

    CIME.SystemTests.nodefail module

    CIME restart upon failed node test.

    -class CIME.SystemTests.nodefail.NODEFAIL(case, **kwargs)[source]
    +class CIME.SystemTests.nodefail.NODEFAIL(case, **kwargs)[source]

    Bases: ERS

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -541,20 +542,20 @@

    Submodules -

    CIME.SystemTests.pea module

    +

    CIME.SystemTests.pea module

    Implementation of the CIME PEA test.

    Builds runs and compares a single processor mpi model to a model built using mpi-serial (1) do a run with default mpi library (suffix base) (2) do a run with mpi-serial (suffix mpi-serial)

    -class CIME.SystemTests.pea.PEA(case, **kwargs)[source]
    +class CIME.SystemTests.pea.PEA(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.pem module

    +

    CIME.SystemTests.pem module

    Implementation of the CIME PEM test: Tests bfb with different MPI processor counts

    This is just like running a smoke test twice - but the pe-counts @@ -563,35 +564,35 @@

    Submodules
    -class CIME.SystemTests.pem.PEM(case, **kwargs)[source]
    +class CIME.SystemTests.pem.PEM(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.pet module

    +

    CIME.SystemTests.pet module

    Implementation of the CIME PET test. This class inherits from SystemTestsCommon

    This is an openmp test to determine that changing thread counts does not change answers. (1) do an initial run where all components are threaded by default (suffix: base) (2) do another initial run with nthrds=1 for all components (suffix: single_thread)

    -class CIME.SystemTests.pet.PET(case, **kwargs)[source]
    +class CIME.SystemTests.pet.PET(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.pfs module

    +

    CIME.SystemTests.pfs module

    CIME performance test This class inherits from SystemTestsCommon

    20 days performance test, no restart files written

    -class CIME.SystemTests.pfs.PFS(case, **kwargs)[source]
    +class CIME.SystemTests.pfs.PFS(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -601,18 +602,18 @@

    Submodules -

    CIME.SystemTests.pgn module

    +

    CIME.SystemTests.pgn module

    Perturbation Growth New (PGN) - The CESM/ACME model’s multi-instance capability is used to conduct an ensemble of simulations starting from different initial conditions.

    This class inherits from SystemTestsCommon.

    -class CIME.SystemTests.pgn.PGN(case, **kwargs)[source]
    +class CIME.SystemTests.pgn.PGN(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -621,13 +622,13 @@

    Submodules
    -get_var_list()[source]
    +get_var_list()[source]

    Get variable list for pergro specific output vars

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -637,7 +638,7 @@

    Submodules -

    CIME.SystemTests.pre module

    +

    CIME.SystemTests.pre module

    Implementation of the CIME pause/resume test: Tests having driver ‘pause’ (write cpl restart file) and ‘resume’ (read cpl restart file) possibly changing the restart file. Compared to non-pause/resume run. @@ -645,7 +646,7 @@

    Submodules
    -class CIME.SystemTests.pre.PRE(case, **kwargs)[source]
    +class CIME.SystemTests.pre.PRE(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    Implementation of the CIME pause/resume test: Tests having driver ‘pause’ (write cpl and/or other restart file(s)) and ‘resume’ @@ -653,7 +654,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    Runs both phases of the two-phase test and compares their results If success_change is True, success requires some files to be different

    @@ -662,28 +663,28 @@

    Submodules -

    CIME.SystemTests.rep module

    +

    CIME.SystemTests.rep module

    Implementation of the CIME REP test

    This test verifies that two identical runs give bit-for-bit results

    -class CIME.SystemTests.rep.REP(case, **kwargs)[source]
    +class CIME.SystemTests.rep.REP(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.restart_tests module

    +

    CIME.SystemTests.restart_tests module

    Abstract class for restart tests

    -class CIME.SystemTests.restart_tests.RestartTest(case, separate_builds, run_two_suffix='restart', run_one_description='initial', run_two_description='restart', multisubmit=False, **kwargs)[source]
    +class CIME.SystemTests.restart_tests.RestartTest(case, separate_builds, run_two_suffix='restart', run_one_description='initial', run_two_description='restart', multisubmit=False, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.reuseinitfiles module

    +

    CIME.SystemTests.reuseinitfiles module

    Implementation of the CIME REUSEINITFILES test

    This test does two runs:

      @@ -695,38 +696,38 @@

      Submodules
      -class CIME.SystemTests.reuseinitfiles.REUSEINITFILES(case, **kwargs)[source]
      +class CIME.SystemTests.reuseinitfiles.REUSEINITFILES(case, **kwargs)[source]

      Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.seq module

    +

    CIME.SystemTests.seq module

    sequencing bfb test (10 day seq,conc tests)

    -class CIME.SystemTests.seq.SEQ(case, **kwargs)[source]
    +class CIME.SystemTests.seq.SEQ(case, **kwargs)[source]

    Bases: SystemTestsCompareTwo

    -

    CIME.SystemTests.sms module

    +

    CIME.SystemTests.sms module

    CIME smoke test This class inherits from SystemTestsCommon It does a startup run with restarts off and optionally compares to or generates baselines

    -class CIME.SystemTests.sms.SMS(case, **kwargs)[source]
    +class CIME.SystemTests.sms.SMS(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -

    CIME.SystemTests.system_tests_common module

    +

    CIME.SystemTests.system_tests_common module

    Base class for CIME system tests

    -class CIME.SystemTests.system_tests_common.FakeTest(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.FakeTest(case, expected=None, **kwargs)[source]

    Bases: SystemTestsCommon

    Inheriters of the FakeTest Class are intended to test the code.

    All members of the FakeTest Class must @@ -734,7 +735,7 @@

    Submodules
    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -743,7 +744,7 @@

    Submodules
    -run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]
    +run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]

    Perform an individual run. Raises an EXCEPTION on fail.

    keep_init_generated_files: If False (the default), we remove the init_generated_files subdirectory of the run directory before running the case. @@ -755,11 +756,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.SystemTestsCommon(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.SystemTestsCommon(case, expected=None, **kwargs)[source]

    Bases: object

    -build(sharedlib_only=False, model_only=False, ninja=False, dry_run=False, separate_builds=False, skip_submit=False)[source]
    +build(sharedlib_only=False, model_only=False, ninja=False, dry_run=False, separate_builds=False, skip_submit=False)[source]

    Do NOT override this method, this method is the framework that controls the build phase. build_phase is the extension point that subclasses should use.

    @@ -767,13 +768,13 @@

    Submodules
    -build_indv(sharedlib_only=False, model_only=False)[source]
    +build_indv(sharedlib_only=False, model_only=False)[source]

    Perform an individual build

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -782,25 +783,25 @@

    Submodules
    -clean_build(comps=None)[source]
    +clean_build(comps=None)[source]

    -compare_env_run(expected=None)[source]
    +compare_env_run(expected=None)[source]

    Compare env_run file to original and warn about differences

    -run(skip_pnl=False)[source]
    +run(skip_pnl=False)[source]

    Do NOT override this method, this method is the framework that controls the run phase. run_phase is the extension point that subclasses should use.

    -run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]
    +run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]

    Perform an individual run. Raises an EXCEPTION on fail.

    keep_init_generated_files: If False (the default), we remove the init_generated_files subdirectory of the run directory before running the case. @@ -810,7 +811,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -820,11 +821,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTBUILDFAIL(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTBUILDFAIL(case, expected=None, **kwargs)[source]

    Bases: TESTRUNPASS

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -835,17 +836,17 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTBUILDFAILEXC(case, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTBUILDFAILEXC(case, **kwargs)[source]

    Bases: FakeTest

    -class CIME.SystemTests.system_tests_common.TESTMEMLEAKFAIL(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTMEMLEAKFAIL(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -856,11 +857,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTMEMLEAKPASS(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTMEMLEAKPASS(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -871,7 +872,7 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTRUNDIFF(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNDIFF(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    You can generate a diff with this test as follows: 1) Run the test and generate a baseline @@ -882,7 +883,7 @@

    Submodules
    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -893,17 +894,17 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTRUNDIFFRESUBMIT(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNDIFFRESUBMIT(case, expected=None, **kwargs)[source]

    Bases: TESTRUNDIFF

    -class CIME.SystemTests.system_tests_common.TESTRUNFAIL(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNFAIL(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -914,11 +915,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTRUNFAILEXC(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNFAILEXC(case, expected=None, **kwargs)[source]

    Bases: TESTRUNPASS

    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -928,7 +929,7 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTRUNFAILRESET(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNFAILRESET(case, expected=None, **kwargs)[source]

    Bases: TESTRUNFAIL

    This fake test can fail for two reasons: 1. As in the TESTRUNFAIL test: If the environment variable TESTRUNFAIL_PASS is not set @@ -940,7 +941,7 @@

    Submodules
    -run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]
    +run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]

    Perform an individual run. Raises an EXCEPTION on fail.

    keep_init_generated_files: If False (the default), we remove the init_generated_files subdirectory of the run directory before running the case. @@ -952,11 +953,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTRUNPASS(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNPASS(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -967,11 +968,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTRUNSLOWPASS(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNSLOWPASS(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -982,17 +983,17 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTRUNSTARCFAIL(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNSTARCFAIL(case, expected=None, **kwargs)[source]

    Bases: TESTRUNPASS

    -class CIME.SystemTests.system_tests_common.TESTRUNUSERXMLCHANGE(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTRUNUSERXMLCHANGE(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -1001,7 +1002,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -1011,11 +1012,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_common.TESTTESTDIFF(case, expected=None, **kwargs)[source]
    +class CIME.SystemTests.system_tests_common.TESTTESTDIFF(case, expected=None, **kwargs)[source]

    Bases: FakeTest

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -1024,7 +1025,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -1034,7 +1035,7 @@

    Submodules
    -CIME.SystemTests.system_tests_common.fix_single_exe_case(case)[source]
    +CIME.SystemTests.system_tests_common.fix_single_exe_case(case)[source]

    Fixes cases created with –single-exe.

    When tests are created using –single-exe, the test_scheduler will set BUILD_COMPLETE to True, but some tests require calls to case.case_setup @@ -1048,7 +1049,7 @@

    Submodules
    -CIME.SystemTests.system_tests_common.is_single_exe_case(case)[source]
    +CIME.SystemTests.system_tests_common.is_single_exe_case(case)[source]

    Determines if the case was created with the –single-exe option.

    If CASEROOT is not part of EXEROOT and the TEST variable is True, then its safe to assume the case was created with ./create_test @@ -1059,9 +1060,14 @@

    Submodules +
    +CIME.SystemTests.system_tests_common.perf_check_for_memory_leak(case, tolerance)[source]
    +

    +

    -

    CIME.SystemTests.system_tests_compare_n module

    +

    CIME.SystemTests.system_tests_compare_n module

    Base class for CIME system tests that involve doing multiple runs and comparing the base run (index=0) with the subsequent runs (indices=1..N-1).

    NOTE: Below is the flow of a multisubmit test. @@ -1101,11 +1107,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_compare_n.SystemTestsCompareN(case, N=2, separate_builds=False, run_suffixes=None, run_descriptions=None, multisubmit=False, ignore_fieldlist_diffs=False, dry_run=False, **kwargs)[source]
    +class CIME.SystemTests.system_tests_compare_n.SystemTestsCompareN(case, N=2, separate_builds=False, run_suffixes=None, run_descriptions=None, multisubmit=False, ignore_fieldlist_diffs=False, dry_run=False, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -1114,7 +1120,7 @@

    Submodules
    -run_phase(success_change=False)[source]
    +run_phase(success_change=False)[source]

    Runs all phases of the N-phase test and compares base results with subsequent ones If success_change is True, success requires some files to be different

    @@ -1123,7 +1129,7 @@

    Submodules -

    CIME.SystemTests.system_tests_compare_two module

    +

    CIME.SystemTests.system_tests_compare_two module

    Base class for CIME system tests that involve doing two runs and comparing their output.

    NOTE: Below is the flow of a multisubmit test. @@ -1165,11 +1171,11 @@

    Submodules
    -class CIME.SystemTests.system_tests_compare_two.SystemTestsCompareTwo(case, separate_builds=False, run_two_suffix='test', run_one_description='', run_two_description='', multisubmit=False, ignore_fieldlist_diffs=False, case_two_keep_init_generated_files=False, dry_run=False, **kwargs)[source]
    +class CIME.SystemTests.system_tests_compare_two.SystemTestsCompareTwo(case, separate_builds=False, run_two_suffix='test', run_one_description='', run_two_description='', multisubmit=False, ignore_fieldlist_diffs=False, case_two_keep_init_generated_files=False, dry_run=False, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -1178,7 +1184,7 @@

    Submodules
    -copy_case1_restarts_to_case2()[source]
    +copy_case1_restarts_to_case2()[source]

    Makes a copy (or symlink) of restart files and related files (necessary history files, rpointer files) from case1 to case2.

    This is not done automatically, but can be called by individual @@ -1188,7 +1194,7 @@

    Submodules
    -run_phase(success_change=False)[source]
    +run_phase(success_change=False)[source]

    Runs both phases of the two-phase test and compares their results If success_change is True, success requires some files to be different

    @@ -1197,7 +1203,7 @@

    Submodules -

    CIME.SystemTests.tsc module

    +

    CIME.SystemTests.tsc module

    Solution reproducibility test based on time-step convergence The CESM/ACME model’s multi-instance capability is used to conduct an ensemble @@ -1205,11 +1211,11 @@

    Submodules
    -class CIME.SystemTests.tsc.TSC(case, **kwargs)[source]
    +class CIME.SystemTests.tsc.TSC(case, **kwargs)[source]

    Bases: SystemTestsCommon

    -build_phase(sharedlib_only=False, model_only=False)[source]
    +build_phase(sharedlib_only=False, model_only=False)[source]

    This is the default build phase implementation, it just does an individual build. This is the subclass’ extension point if they need to define a custom build phase.

    @@ -1218,7 +1224,7 @@

    Submodules
    -run_phase()[source]
    +run_phase()[source]

    This is the default run phase implementation, it just does an individual run. This is the subclass’ extension point if they need to define a custom run phase.

    PLEASE THROW AN EXCEPTION ON FAIL

    @@ -1228,7 +1234,7 @@

    Submodules -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.SystemTests.test_utils.html b/versions/master/html/CIME_api/CIME.SystemTests.test_utils.html index 826f056d341..98b53b1bf3e 100644 --- a/versions/master/html/CIME_api/CIME.SystemTests.test_utils.html +++ b/versions/master/html/CIME_api/CIME.SystemTests.test_utils.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -138,16 +139,16 @@
    -

    CIME.SystemTests.test_utils package

    +

    CIME.SystemTests.test_utils package

    -

    Submodules

    +

    Submodules

    -

    CIME.SystemTests.test_utils.user_nl_utils module

    +

    CIME.SystemTests.test_utils.user_nl_utils module

    This module contains functions for working with user_nl files in system tests.

    -CIME.SystemTests.test_utils.user_nl_utils.append_to_user_nl_files(caseroot, component, contents)[source]
    +CIME.SystemTests.test_utils.user_nl_utils.append_to_user_nl_files(caseroot, component, contents)[source]

    Append the string(s) given by ‘contents’ to the end of each user_nl file for the given component (there may be multiple such user_nl files in the case of a multi-instance test).

    @@ -171,7 +172,7 @@

    Submodules -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.Tools.html b/versions/master/html/CIME_api/CIME.Tools.html index 706f867c0e0..a5fc65364ce 100644 --- a/versions/master/html/CIME_api/CIME.Tools.html +++ b/versions/master/html/CIME_api/CIME.Tools.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,46 +138,46 @@
    -

    CIME.Tools package

    +

    CIME.Tools package

    -

    Submodules

    +

    Submodules

    -

    CIME.Tools.generate_cylc_workflow module

    +

    CIME.Tools.generate_cylc_workflow module

    Generates a cylc workflow file for the case. See https://cylc.github.io for details about cylc

    -CIME.Tools.generate_cylc_workflow.cylc_batch_job_template(job, jobname, case, ensemble)[source]
    +CIME.Tools.generate_cylc_workflow.cylc_batch_job_template(job, jobname, case, ensemble)[source]
    -CIME.Tools.generate_cylc_workflow.cylc_get_case_path_string(case, ensemble)[source]
    +CIME.Tools.generate_cylc_workflow.cylc_get_case_path_string(case, ensemble)[source]
    -CIME.Tools.generate_cylc_workflow.cylc_get_ensemble_first_and_last(case, ensemble)[source]
    +CIME.Tools.generate_cylc_workflow.cylc_get_ensemble_first_and_last(case, ensemble)[source]
    -CIME.Tools.generate_cylc_workflow.cylc_script_job_template(job, case, ensemble)[source]
    +CIME.Tools.generate_cylc_workflow.cylc_script_job_template(job, case, ensemble)[source]
    -CIME.Tools.generate_cylc_workflow.parse_command_line(args, description)[source]
    +CIME.Tools.generate_cylc_workflow.parse_command_line(args, description)[source]
    -

    CIME.Tools.standard_script_setup module

    +

    CIME.Tools.standard_script_setup module

    Encapsulate the importing of python utils and logging setup, things that every script should do.

    -CIME.Tools.standard_script_setup.check_minimum_python_version(major, minor)[source]
    +CIME.Tools.standard_script_setup.check_minimum_python_version(major, minor)[source]

    Check your python version.

    >>> check_minimum_python_version(sys.version_info[0], sys.version_info[1])
     >>>
    @@ -186,21 +187,21 @@ 

    Submodules -

    CIME.Tools.testreporter module

    +

    CIME.Tools.testreporter module

    Simple script to populate CESM test database with test results.

    -CIME.Tools.testreporter.get_testreporter_xml(testroot, testid, tagname, testtype)[source]
    +CIME.Tools.testreporter.get_testreporter_xml(testroot, testid, tagname, testtype)[source]
    -CIME.Tools.testreporter.parse_command_line(args)[source]
    +CIME.Tools.testreporter.parse_command_line(args)[source]
    -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.XML.html b/versions/master/html/CIME_api/CIME.XML.html index d73bda2af51..3f2c69c1f92 100644 --- a/versions/master/html/CIME_api/CIME.XML.html +++ b/versions/master/html/CIME_api/CIME.XML.html @@ -12,16 +12,16 @@ - - - - - + + + + + - + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,72 +138,72 @@
    -

    CIME.XML package

    +

    CIME.XML package

    -

    Submodules

    +

    Submodules

    -

    CIME.XML.archive module

    +

    CIME.XML.archive module

    Interface to the archive.xml file. This class inherits from GenericXML.py

    -class CIME.XML.archive.Archive(infile=None, files=None)[source]
    +class CIME.XML.archive.Archive(infile=None, files=None)[source]

    Bases: ArchiveBase

    -get_all_config_archive_files(files)[source]
    +get_all_config_archive_files(files)[source]

    Returns the list of ARCHIVE_SPEC_FILES that exist on disk as defined in config_files.xml

    -setup(env_archive, components, files=None)[source]
    +setup(env_archive, components, files=None)[source]
    -

    CIME.XML.archive_base module

    +

    CIME.XML.archive_base module

    Base class for archive files. This class inherits from generic_xml.py

    -class CIME.XML.archive_base.ArchiveBase(infile=None, schema=None, root_name_override=None, root_attrib_override=None, read_only=True)[source]
    +class CIME.XML.archive_base.ArchiveBase(infile=None, schema=None, root_name_override=None, root_attrib_override=None, read_only=True)[source]

    Bases: GenericXML

    -exclude_testing(compname)[source]
    +exclude_testing(compname)[source]

    Checks if component should be excluded from testing.

    -get_all_hist_files(casename, model, from_dir, suffix='', ref_case=None)[source]
    +get_all_hist_files(casename, model, from_dir, suffix='', ref_case=None)[source]

    gets all history files in directory from_dir with suffix (if provided) ignores files with ref_case in the name if ref_case is provided

    -get_entry(compname)[source]
    +get_entry(compname)[source]

    Returns an xml node corresponding to compname in comp_archive_spec

    -get_entry_attributes(compname)[source]
    +get_entry_attributes(compname)[source]
    -get_entry_value(name, archive_entry)[source]
    +get_entry_value(name, archive_entry)[source]

    get the xml text associated with name under root archive_entry returns None if no entry is found, expects only one entry

    -get_hist_file_ext_regexes(archive_entry)[source]
    +get_hist_file_ext_regexes(archive_entry)[source]

    get the xml text associated with each of the hist_file_ext_regex entries based at root archive_entry (root is based on component name) returns a list of text entries or @@ -211,7 +212,7 @@

    Submodules
    -get_hist_file_extensions(archive_entry)[source]
    +get_hist_file_extensions(archive_entry)[source]

    get the xml text associated with each of the hist_file_extensions based at root archive_entry (root is based on component name) returns a list of text entries or @@ -220,13 +221,13 @@

    Submodules
    -get_latest_hist_files(casename, model, from_dir, suffix='', ref_case=None)[source]
    +get_latest_hist_files(casename, model, from_dir, suffix='', ref_case=None)[source]

    get the most recent history files in directory from_dir with suffix if provided

    -get_rest_file_extensions(archive_entry)[source]
    +get_rest_file_extensions(archive_entry)[source]

    get the xml text associated with each of the rest_file_extensions based at root archive_entry (root is based on component name) returns a list of text entries or @@ -237,42 +238,42 @@

    Submodules -

    CIME.XML.batch module

    +

    CIME.XML.batch module

    Interface to the config_batch.xml file. This class inherits from GenericXML.py

    The batch_system type=”foo” blocks define most things. Machine-specific overrides can be defined by providing a batch_system MACH=”mach” block.

    -class CIME.XML.batch.Batch(batch_system=None, machine=None, infile=None, files=None, extra_machines_dir=None)[source]
    +class CIME.XML.batch.Batch(batch_system=None, machine=None, infile=None, files=None, extra_machines_dir=None)[source]

    Bases: GenericXML

    -get_batch_jobs()[source]
    +get_batch_jobs()[source]

    Return a list of jobs with the first element the name of the case script and the second a dict of qualifiers for the job

    -get_batch_system()[source]
    +get_batch_system()[source]

    Return the name of the batch system

    -get_optional_batch_node(nodename, attributes=None)[source]
    +get_optional_batch_node(nodename, attributes=None)[source]

    Return data on a node for a batch system

    -get_value(name, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(name, attribute=None, resolved=True, subgroup=None)[source]

    Get Value of fields in the config_batch.xml file

    -set_batch_system(batch_system, machine=None)[source]
    +set_batch_system(batch_system, machine=None)[source]

    Sets the batch system block in the Batch object

    @@ -280,32 +281,32 @@

    Submodules -

    CIME.XML.component module

    +

    CIME.XML.component module

    Interface to the config_component.xml files. This class inherits from EntryID.py

    -class CIME.XML.component.Component(infile, comp_class)[source]
    +class CIME.XML.component.Component(infile, comp_class)[source]

    Bases: EntryID

    -get_description(compsetname)[source]
    +get_description(compsetname)[source]
    -get_forcing_description(compsetname)[source]
    +get_forcing_description(compsetname)[source]
    -get_valid_model_components()[source]
    +get_valid_model_components()[source]

    return a list of all possible valid generic (e.g. atm, clm, …) model components from the entries in the model CONFIG_CPL_FILE

    -get_value(name, attribute=None, resolved=False, subgroup=None)[source]
    +get_value(name, attribute=None, resolved=False, subgroup=None)[source]

    Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided and matches

    @@ -313,13 +314,13 @@

    Submodules
    -print_values()[source]
    +print_values()[source]

    print values for help and description in target config_component.xml file

    -return_values()[source]
    +return_values()[source]

    return a list of hashes from target config_component.xml file This routine is used by external tools in https://github.com/NCAR/CESM_xml2html

    @@ -328,58 +329,58 @@

    Submodules -

    CIME.XML.compsets module

    +

    CIME.XML.compsets module

    Common interface to XML files which follow the compsets format,

    -class CIME.XML.compsets.Compsets(infile=None, files=None)[source]
    +class CIME.XML.compsets.Compsets(infile=None, files=None)[source]

    Bases: GenericXML

    -get_compset_longnames()[source]
    +get_compset_longnames()[source]
    -get_compset_match(name)[source]
    +get_compset_match(name)[source]

    science support is used in cesm to determine if this compset and grid is scientifically supported. science_support is returned as an array of grids for this compset

    -get_compset_var_settings(compset, grid)[source]
    +get_compset_var_settings(compset, grid)[source]

    Variables can be set in config_compsets.xml in entry id settings with compset and grid attributes find and return id value pairs here

    -get_value(name, attribute=None, resolved=False, subgroup=None)[source]
    +get_value(name, attribute=None, resolved=False, subgroup=None)[source]

    get_value is expected to be defined by the derived classes, if you get here the value was not found in the class.

    -print_values(arg_help=True)[source]
    +print_values(arg_help=True)[source]
    -

    CIME.XML.entry_id module

    +

    CIME.XML.entry_id module

    Common interface to XML files which follow the entry id format, this is an abstract class and is expected to be used by other XML interface modules and not directly.

    -class CIME.XML.entry_id.EntryID(infile=None, schema=None, read_only=True)[source]
    +class CIME.XML.entry_id.EntryID(infile=None, schema=None, read_only=True)[source]

    Bases: GenericXML

    -add_elements_by_group(srcobj, attributes=None, infile=None)[source]
    +add_elements_by_group(srcobj, attributes=None, infile=None)[source]

    Add elements from srcobj to self under the appropriate group element, entries to be added must have a child element <file> with value “infile”

    @@ -387,74 +388,74 @@

    Submodules
    -check_if_comp_var(vid, attribute=None, node=None)[source]
    +check_if_comp_var(vid, attribute=None, node=None)[source]

    -cleanupnode(node)[source]
    +cleanupnode(node)[source]

    in env_base.py, not expected to get here

    -compare_xml(other, root=None, otherroot=None)[source]
    +compare_xml(other, root=None, otherroot=None)[source]
    -get_child_content(vid, childname)[source]
    +get_child_content(vid, childname)[source]
    -get_default_value(node, attributes=None)[source]
    +get_default_value(node, attributes=None)[source]

    Set the value of an entry to the default value for that entry

    -get_description(node)[source]
    +get_description(node)[source]
    -get_elements_from_child_content(childname, childcontent)[source]
    +get_elements_from_child_content(childname, childcontent)[source]
    -get_groups(node)[source]
    +get_groups(node)[source]
    -get_node_element_info(vid, element_name)[source]
    +get_node_element_info(vid, element_name)[source]
    -get_nodes_by_id(vid)[source]
    +get_nodes_by_id(vid)[source]
    -get_type_info(vid)[source]
    +get_type_info(vid)[source]
    -get_valid_value_string(node, value, vid=None, ignore_type=False)[source]
    +get_valid_value_string(node, value, vid=None, ignore_type=False)[source]
    -get_valid_values(vid)[source]
    +get_valid_values(vid)[source]
    -get_value(vid, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(vid, attribute=None, resolved=True, subgroup=None)[source]

    Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided and matches

    @@ -462,7 +463,7 @@

    Submodules
    -get_value_match(vid, attributes=None, exact_match=False, entry_node=None, replacement_for_none=None)[source]
    +get_value_match(vid, attributes=None, exact_match=False, entry_node=None, replacement_for_none=None)[source]

    Handle this case: <entry id …>

    @@ -483,7 +484,7 @@

    Submodules
    -get_values(vid, attribute=None, resolved=True, subgroup=None)[source]
    +get_values(vid, attribute=None, resolved=True, subgroup=None)[source]

    Same functionality as get_value but it returns a list, if the value in xml contains commas the list have multiple elements split on commas

    @@ -491,22 +492,22 @@

    Submodules
    -overwrite_existing_entries()[source]
    +overwrite_existing_entries()[source]

    -set_default_value(vid, val)[source]
    +set_default_value(vid, val)[source]
    -set_valid_values(vid, new_valid_values)[source]
    +set_valid_values(vid, new_valid_values)[source]
    -set_value(vid, value, subgroup=None, ignore_type=False)[source]
    +set_value(vid, value, subgroup=None, ignore_type=False)[source]

    Set the value of an entry-id field to value Returns the value or None if not found subgroup is ignored in the general routine and applied in specific methods

    @@ -516,61 +517,61 @@

    Submodules -

    CIME.XML.env_archive module

    +

    CIME.XML.env_archive module

    Interface to the env_archive.xml file. This class inherits from EnvBase

    -class CIME.XML.env_archive.EnvArchive(case_root=None, infile='env_archive.xml', read_only=False)[source]
    +class CIME.XML.env_archive.EnvArchive(case_root=None, infile='env_archive.xml', read_only=False)[source]

    Bases: ArchiveBase, EnvBase

    -get_entries()[source]
    +get_entries()[source]
    -get_entry_info(archive_entry)[source]
    +get_entry_info(archive_entry)[source]
    -get_rpointer_contents(archive_entry)[source]
    +get_rpointer_contents(archive_entry)[source]
    -get_type_info(vid)[source]
    +get_type_info(vid)[source]
    -

    CIME.XML.env_base module

    +

    CIME.XML.env_base module

    Base class for env files. This class inherits from EntryID.py

    -class CIME.XML.env_base.EnvBase(case_root, infile, schema=None, read_only=False)[source]
    +class CIME.XML.env_base.EnvBase(case_root, infile, schema=None, read_only=False)[source]

    Bases: EntryID

    -change_file(newfile, copy=False)[source]
    +change_file(newfile, copy=False)[source]
    -check_if_comp_var(vid, attribute=None, node=None)[source]
    +check_if_comp_var(vid, attribute=None, node=None)[source]
    -cleanupnode(node)[source]
    +cleanupnode(node)[source]

    Remove the <group>, <file>, <values> and <value> childnodes from node

    -get_children(name=None, attributes=None, root=None)[source]
    +get_children(name=None, attributes=None, root=None)[source]

    This is the critical function, its interface and performance are crucial.

    You can specify attributes={key:None} if you want to select children with the key attribute but you don’t care what its value is.

    @@ -578,12 +579,12 @@

    Submodules
    -get_nodes_by_id(varid)[source]
    +get_nodes_by_id(varid)[source]

    -get_value(vid, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(vid, attribute=None, resolved=True, subgroup=None)[source]

    Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided and matches

    @@ -591,17 +592,17 @@

    Submodules
    -scan_children(nodename, attributes=None, root=None)[source]
    +scan_children(nodename, attributes=None, root=None)[source]

    -set_components(components)[source]
    +set_components(components)[source]
    -set_value(vid, value, subgroup=None, ignore_type=False)[source]
    +set_value(vid, value, subgroup=None, ignore_type=False)[source]

    Set the value of an entry-id field to value Returns the value or None if not found subgroup is ignored in the general routine and applied in specific methods

    @@ -611,56 +612,56 @@

    Submodules -

    CIME.XML.env_batch module

    +

    CIME.XML.env_batch module

    Interface to the env_batch.xml file. This class inherits from EnvBase

    -class CIME.XML.env_batch.EnvBatch(case_root=None, infile='env_batch.xml', read_only=False)[source]
    +class CIME.XML.env_batch.EnvBatch(case_root=None, infile='env_batch.xml', read_only=False)[source]

    Bases: EnvBase

    -cancel_job(jobid)[source]
    +cancel_job(jobid)[source]
    -cleanupnode(node)[source]
    +cleanupnode(node)[source]

    Remove the <group>, <file>, <values> and <value> childnodes from node

    -compare_xml(other)[source]
    +compare_xml(other)[source]
    -create_job_groups(batch_jobs, is_test)[source]
    +create_job_groups(batch_jobs, is_test)[source]
    -get_all_queues(name=None)[source]
    +get_all_queues(name=None)[source]
    -get_batch_directives(case, job, overrides=None, output_format='default')[source]
    +get_batch_directives(case, job, overrides=None, output_format='default')[source]
    -get_batch_mail_type(mail_type)[source]
    +get_batch_mail_type(mail_type)[source]
    -get_batch_system_type()[source]
    +get_batch_system_type()[source]
    -get_children(name=None, attributes=None, root=None)[source]
    +get_children(name=None, attributes=None, root=None)[source]

    This is the critical function, its interface and performance are crucial.

    You can specify attributes={key:None} if you want to select children with the key attribute but you don’t care what its value is.

    @@ -668,97 +669,97 @@

    Submodules
    -get_default_queue()[source]
    +get_default_queue()[source]

    -get_job_id(output)[source]
    +get_job_id(output)[source]
    -get_job_overrides(job, case)[source]
    +get_job_overrides(job, case)[source]
    -get_jobs()[source]
    +get_jobs()[source]
    -get_queue_specs(qnode)[source]
    +get_queue_specs(qnode)[source]

    Get queue specifications from node.

    Returns (nodemin, nodemax, jobname, walltimemax, jobmin, jobmax, is_strict)

    -get_status(jobid)[source]
    +get_status(jobid)[source]
    -get_submit_args(case, job, resolve=True)[source]
    +get_submit_args(case, job, resolve=True)[source]

    return a list of touples (flag, name)

    -get_type_info(vid)[source]
    +get_type_info(vid)[source]
    -get_value(item, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(item, attribute=None, resolved=True, subgroup=None)[source]

    Must default subgroup to something in order to provide single return value

    -make_all_batch_files(case)[source]
    +make_all_batch_files(case)[source]
    -make_batch_script(input_template, job, case, outfile=None)[source]
    +make_batch_script(input_template, job, case, outfile=None)[source]
    -queue_meets_spec(queue, num_nodes, num_tasks, walltime=None, job=None)[source]
    +queue_meets_spec(queue, num_nodes, num_tasks, walltime=None, job=None)[source]
    -select_best_queue(num_nodes, num_tasks, name=None, walltime=None, job=None)[source]
    +select_best_queue(num_nodes, num_tasks, name=None, walltime=None, job=None)[source]
    -set_batch_system(batchobj, batch_system_type=None)[source]
    +set_batch_system(batchobj, batch_system_type=None)[source]
    -set_batch_system_type(batchtype)[source]
    +set_batch_system_type(batchtype)[source]
    -set_job_defaults(batch_jobs, case)[source]
    +set_job_defaults(batch_jobs, case)[source]
    -set_value(item, value, subgroup=None, ignore_type=False)[source]
    +set_value(item, value, subgroup=None, ignore_type=False)[source]

    Override the entry_id set_value function with some special cases for this class

    -submit_jobs(case, no_batch=False, job=None, user_prereq=None, skip_pnl=False, allow_fail=False, resubmit_immediate=False, mail_user=None, mail_type=None, batch_args=None, dry_run=False, workflow=True)[source]
    +submit_jobs(case, no_batch=False, job=None, user_prereq=None, skip_pnl=False, allow_fail=False, resubmit_immediate=False, mail_user=None, mail_type=None, batch_args=None, dry_run=False, workflow=True)[source]

    no_batch indicates that the jobs should be run directly rather that submitted to a queueing system job is the first job in the workflow sequence to start user_prereq is a batch system prerequisite as requested by the user @@ -773,17 +774,41 @@

    Submodules +
    +CIME.XML.env_batch.get_job_deps(dependency, depid, prev_job=None, user_prereq=None)[source]
    +

    Gather list of job batch ids that a job depends on.

    +
    +

    Parameters

    +
    +
    dependencystr

    List of dependent job names.

    +
    +
    depiddict

    Lookup where keys are job names and values are the batch id.

    +
    +
    user_prereqstr

    User requested dependency.

    +
    +
    +
    +
    +

    Returns

    +
    +
    list

    List of batch ids that job depends on.

    +
    +
    +
    +

    +
    -

    CIME.XML.env_build module

    +

    CIME.XML.env_build module

    Interface to the env_build.xml file. This class inherits from EnvBase

    -class CIME.XML.env_build.EnvBuild(case_root=None, infile='env_build.xml', components=None, read_only=False)[source]
    +class CIME.XML.env_build.EnvBuild(case_root=None, infile='env_build.xml', components=None, read_only=False)[source]

    Bases: EnvBase

    -set_value(vid, value, subgroup=None, ignore_type=False)[source]
    +set_value(vid, value, subgroup=None, ignore_type=False)[source]

    Set the value of an entry-id field to value Returns the value or None if not found subgroup is ignored in the general routine and applied in specific methods

    @@ -793,57 +818,57 @@

    Submodules -

    CIME.XML.env_case module

    +

    CIME.XML.env_case module

    Interface to the env_case.xml file. This class inherits from EnvBase

    -class CIME.XML.env_case.EnvCase(case_root=None, infile='env_case.xml', components=None, read_only=False)[source]
    +class CIME.XML.env_case.EnvCase(case_root=None, infile='env_case.xml', components=None, read_only=False)[source]

    Bases: EnvBase

    -

    CIME.XML.env_mach_pes module

    +

    CIME.XML.env_mach_pes module

    Interface to the env_mach_pes.xml file. This class inherits from EntryID

    -class CIME.XML.env_mach_pes.EnvMachPes(case_root=None, infile='env_mach_pes.xml', components=None, read_only=False, comp_interface='mct')[source]
    +class CIME.XML.env_mach_pes.EnvMachPes(case_root=None, infile='env_mach_pes.xml', components=None, read_only=False, comp_interface='mct')[source]

    Bases: EnvBase

    -add_comment(comment)[source]
    +add_comment(comment)[source]
    -get_max_thread_count(comp_classes)[source]
    +get_max_thread_count(comp_classes)[source]

    Find the maximum number of openmp threads for any component in the case

    -get_spare_nodes(num_nodes)[source]
    +get_spare_nodes(num_nodes)[source]
    -get_tasks_per_node(total_tasks, max_thread_count)[source]
    +get_tasks_per_node(total_tasks, max_thread_count)[source]
    -get_total_nodes(total_tasks, max_thread_count)[source]
    +get_total_nodes(total_tasks, max_thread_count)[source]

    Return (num_active_nodes, num_spare_nodes)

    -get_total_tasks(comp_classes, async_interface=False)[source]
    +get_total_tasks(comp_classes, async_interface=False)[source]
    -get_value(vid, attribute=None, resolved=True, subgroup=None, max_mpitasks_per_node=None, max_cputasks_per_gpu_node=None, ngpus_per_node=None)[source]
    +get_value(vid, attribute=None, resolved=True, subgroup=None, max_mpitasks_per_node=None, max_cputasks_per_gpu_node=None, ngpus_per_node=None)[source]

    Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided and matches

    @@ -851,7 +876,7 @@

    Submodules
    -set_value(vid, value, subgroup=None, ignore_type=False)[source]
    +set_value(vid, value, subgroup=None, ignore_type=False)[source]

    Set the value of an entry-id field to value Returns the value or None if not found subgroup is ignored in the general routine and applied in specific methods

    @@ -861,15 +886,15 @@

    Submodules -

    CIME.XML.env_mach_specific module

    +

    CIME.XML.env_mach_specific module

    Interface to the env_mach_specific.xml file. This class inherits from EnvBase

    -class CIME.XML.env_mach_specific.EnvMachSpecific(caseroot=None, infile='env_mach_specific.xml', components=None, unit_testing=False, read_only=False, standalone_configure=False, comp_interface=None)[source]
    +class CIME.XML.env_mach_specific.EnvMachSpecific(caseroot=None, infile='env_mach_specific.xml', components=None, unit_testing=False, read_only=False, standalone_configure=False, comp_interface=None)[source]

    Bases: EnvBase

    -allow_error()[source]
    +allow_error()[source]

    Return True if stderr output from module commands should be assumed to be an error. Default False. This is necessary since implementations of environment modules are highlty variable and some systems produce @@ -878,60 +903,60 @@

    Submodules
    -get_aprun_args(case, attribs, job, overrides=None)[source]
    +get_aprun_args(case, attribs, job, overrides=None)[source]

    -get_aprun_mode(attribs)[source]
    +get_aprun_mode(attribs)[source]
    -get_module_system_cmd_path(lang)[source]
    +get_module_system_cmd_path(lang)[source]
    -get_module_system_init_path(lang)[source]
    +get_module_system_init_path(lang)[source]
    -get_module_system_type()[source]
    +get_module_system_type()[source]

    Return the module system used on this machine

    -get_mpirun(case, attribs, job, exe_only=False, overrides=None)[source]
    +get_mpirun(case, attribs, job, exe_only=False, overrides=None)[source]

    Find best match, return (executable, {arg_name : text})

    -get_overrides_nodes(case)[source]
    +get_overrides_nodes(case)[source]
    -get_type_info(vid)[source]
    +get_type_info(vid)[source]
    -list_modules()[source]
    +list_modules()[source]
    -load_env(case, force_method=None, job=None, verbose=False)[source]
    +load_env(case, force_method=None, job=None, verbose=False)[source]

    Should only be called by case.load_env

    -make_env_mach_specific_file(shell, case, output_dir='')[source]
    +make_env_mach_specific_file(shell, case, output_dir='')[source]

    Writes .env_mach_specific.sh or .env_mach_specific.csh

    Args: shell: string - ‘sh’ or ‘csh’ @@ -941,14 +966,14 @@

    Submodules
    -populate(machobj, attributes=None)[source]
    +populate(machobj, attributes=None)[source]

    Add entries to the file using information from a Machines object. mpilib must match attributes if set

    -save_all_env_info(filename)[source]
    +save_all_env_info(filename)[source]

    Get a string representation of all current environment info and save it to file.

    @@ -957,15 +982,15 @@

    Submodules -

    CIME.XML.env_run module

    +

    CIME.XML.env_run module

    Interface to the env_run.xml file. This class inherits from EnvBase

    -class CIME.XML.env_run.EnvRun(case_root=None, infile='env_run.xml', components=None, read_only=False)[source]
    +class CIME.XML.env_run.EnvRun(case_root=None, infile='env_run.xml', components=None, read_only=False)[source]

    Bases: EnvBase

    -get_value(vid, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(vid, attribute=None, resolved=True, subgroup=None)[source]

    Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided and matches. Special case for pio variables when PIO_ASYNC_INTERFACE is True.

    @@ -973,7 +998,7 @@

    Submodules
    -set_value(vid, value, subgroup=None, ignore_type=False)[source]
    +set_value(vid, value, subgroup=None, ignore_type=False)[source]

    Set the value of an entry-id field to value Returns the value or None if not found subgroup is ignored in the general routine and applied in specific methods

    @@ -983,41 +1008,41 @@

    Submodules -

    CIME.XML.env_test module

    +

    CIME.XML.env_test module

    Interface to the env_test.xml file. This class inherits from EnvBase

    -class CIME.XML.env_test.EnvTest(case_root=None, infile='env_test.xml', components=None, read_only=False)[source]
    +class CIME.XML.env_test.EnvTest(case_root=None, infile='env_test.xml', components=None, read_only=False)[source]

    Bases: EnvBase

    -add_test(testnode)[source]
    +add_test(testnode)[source]
    -cleanupnode(node)[source]
    +cleanupnode(node)[source]

    keep the values component set

    -get_settings_for_phase(name, cnt)[source]
    +get_settings_for_phase(name, cnt)[source]
    -get_step_phase_cnt(step)[source]
    +get_step_phase_cnt(step)[source]
    -get_test_parameter(name)[source]
    +get_test_parameter(name)[source]
    -get_value(vid, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(vid, attribute=None, resolved=True, subgroup=None)[source]

    Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided and matches

    @@ -1025,12 +1050,12 @@

    Submodules
    -run_phase_get_clone_name(phase)[source]
    +run_phase_get_clone_name(phase)[source]

    -set_initial_values(case)[source]
    +set_initial_values(case)[source]

    The values to initialize a test are defined in env_test.xml copy them to the appropriate case env files to initialize a test ignore fields set in the BUILD and RUN clauses, they are set in @@ -1039,14 +1064,14 @@

    Submodules
    -set_test_parameter(name, value)[source]
    +set_test_parameter(name, value)[source]

    If a node already exists update the value otherwise create a node and initialize it to value

    -set_value(vid, value, subgroup=None, ignore_type=False)[source]
    +set_value(vid, value, subgroup=None, ignore_type=False)[source]

    check if vid is in test section of file

    @@ -1054,20 +1079,20 @@

    Submodules -

    CIME.XML.env_workflow module

    +

    CIME.XML.env_workflow module

    Interface to the env_workflow.xml file. This class inherits from EnvBase

    -class CIME.XML.env_workflow.EnvWorkflow(case_root=None, infile='env_workflow.xml', read_only=False)[source]
    +class CIME.XML.env_workflow.EnvWorkflow(case_root=None, infile='env_workflow.xml', read_only=False)[source]

    Bases: EnvBase

    -create_job_groups(batch_jobs, is_test)[source]
    +create_job_groups(batch_jobs, is_test)[source]
    -get_children(name=None, attributes=None, root=None)[source]
    +get_children(name=None, attributes=None, root=None)[source]

    This is the critical function, its interface and performance are crucial.

    You can specify attributes={key:None} if you want to select children with the key attribute but you don’t care what its value is.

    @@ -1075,28 +1100,28 @@

    Submodules
    -get_job_specs(case, job)[source]
    +get_job_specs(case, job)[source]

    -get_jobs()[source]
    +get_jobs()[source]
    -get_type_info(vid)[source]
    +get_type_info(vid)[source]
    -get_value(item, attribute=None, resolved=True, subgroup='PRIMARY')[source]
    +get_value(item, attribute=None, resolved=True, subgroup='PRIMARY')[source]

    Must default subgroup to something in order to provide single return value

    -set_value(item, value, subgroup=None, ignore_type=False)[source]
    +set_value(item, value, subgroup=None, ignore_type=False)[source]

    Override the entry_id set_value function with some special cases for this class

    @@ -1104,7 +1129,7 @@

    Submodules -

    CIME.XML.expected_fails_file module

    +

    CIME.XML.expected_fails_file module

    Interface to an expected failure xml file

    Here is an example:

    <?xml version= “1.0”?>

    @@ -1163,11 +1188,11 @@

    Submodules
    -class CIME.XML.expected_fails_file.ExpectedFailsFile(infile)[source]
    +class CIME.XML.expected_fails_file.ExpectedFailsFile(infile)[source]

    Bases: GenericXML

    -get_expected_fails()[source]
    +get_expected_fails()[source]

    Returns a dictionary of ExpectedFails objects, where the keys are test names

    @@ -1175,25 +1200,25 @@

    Submodules -

    CIME.XML.files module

    +

    CIME.XML.files module

    Interface to the config_files.xml file. This class inherits from EntryID.py

    -class CIME.XML.files.Files(comp_interface=None)[source]
    +class CIME.XML.files.Files(comp_interface=None)[source]

    Bases: EntryID

    -get_components(nodename)[source]
    +get_components(nodename)[source]
    -get_schema(nodename, attributes=None)[source]
    +get_schema(nodename, attributes=None)[source]
    -get_value(vid, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(vid, attribute=None, resolved=True, subgroup=None)[source]

    Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided and matches

    @@ -1201,7 +1226,7 @@

    Submodules
    -set_value(vid, value, subgroup=None, ignore_type=False)[source]
    +set_value(vid, value, subgroup=None, ignore_type=False)[source]

    Set the value of an entry-id field to value Returns the value or None if not found subgroup is ignored in the general routine and applied in specific methods

    @@ -1211,32 +1236,32 @@

    Submodules -

    CIME.XML.generic_xml module

    +

    CIME.XML.generic_xml module

    Common interface to XML files, this is an abstract class and is expected to be used by other XML interface modules and not directly.

    -class CIME.XML.generic_xml.GenericXML(infile=None, schema=None, root_name_override=None, root_attrib_override=None, read_only=True)[source]
    +class CIME.XML.generic_xml.GenericXML(infile=None, schema=None, root_name_override=None, root_attrib_override=None, read_only=True)[source]

    Bases: object

    -class CacheEntry(tree, root, modtime)
    +class CacheEntry(tree, root, modtime)

    Bases: tuple

    -modtime
    +modtime

    Alias for field number 2

    -root
    +root

    Alias for field number 1

    -tree
    +tree

    Alias for field number 0

    @@ -1244,49 +1269,49 @@

    Submodules
    -DISABLE_CACHING = False
    +DISABLE_CACHING = False

    -add_child(node, root=None, position=None)[source]
    +add_child(node, root=None, position=None)[source]

    Add element node to self at root

    -attrib(node)[source]
    +attrib(node)[source]
    -change_file(newfile, copy=False)[source]
    +change_file(newfile, copy=False)[source]
    -check_timestamp()[source]
    +check_timestamp()[source]

    Returns True if timestamp matches what is expected

    -copy(node)[source]
    +copy(node)[source]
    -get(node, attrib_name, default=None)[source]
    +get(node, attrib_name, default=None)[source]
    -get_child(name=None, attributes=None, root=None, err_msg=None)[source]
    +get_child(name=None, attributes=None, root=None, err_msg=None)[source]
    -get_children(name=None, attributes=None, root=None)[source]
    +get_children(name=None, attributes=None, root=None)[source]

    This is the critical function, its interface and performance are crucial.

    You can specify attributes={key:None} if you want to select children with the key attribute but you don’t care what its value is.

    @@ -1294,27 +1319,27 @@

    Submodules
    -get_element_text(element_name, attributes=None, root=None)[source]
    +get_element_text(element_name, attributes=None, root=None)[source]

    -get_id()[source]
    +get_id()[source]
    -get_optional_child(name=None, attributes=None, root=None, err_msg=None)[source]
    +get_optional_child(name=None, attributes=None, root=None, err_msg=None)[source]
    -get_raw_record(root=None)[source]
    +get_raw_record(root=None)[source]
    -get_resolved_value(raw_value, allow_unresolved_envvars=False)[source]
    +get_resolved_value(raw_value, allow_unresolved_envvars=False)[source]

    A value in the xml file may contain references to other xml variables or to environment variables. These are refered to in the perl style with $name and $ENV{name}.

    @@ -1335,148 +1360,148 @@

    Submodules
    -get_value(item, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(item, attribute=None, resolved=True, subgroup=None)[source]

    get_value is expected to be defined by the derived classes, if you get here the value was not found in the class.

    -get_values(vid, attribute=None, resolved=True, subgroup=None)[source]
    +get_values(vid, attribute=None, resolved=True, subgroup=None)[source]
    -get_version()[source]
    +get_version()[source]
    -has(node, attrib_name)[source]
    +has(node, attrib_name)[source]
    -classmethod invalidate(filename)[source]
    +classmethod invalidate(filename)[source]
    -lock()[source]
    +lock()[source]

    A subclass is doing caching, we need to lock the tree structure in order to avoid invalidating cache.

    -make_child(name, attributes=None, root=None, text=None)[source]
    +make_child(name, attributes=None, root=None, text=None)[source]
    -make_child_comment(root=None, text=None)[source]
    +make_child_comment(root=None, text=None)[source]
    -name(node)[source]
    +name(node)[source]
    -pop(node, attrib_name)[source]
    +pop(node, attrib_name)[source]
    -read(infile, schema=None)[source]
    +read(infile, schema=None)[source]

    Read and parse an xml file into the object

    -read_fd(fd)[source]
    +read_fd(fd)[source]
    -remove_child(node, root=None)[source]
    +remove_child(node, root=None)[source]
    -scan_child(nodename, attributes=None, root=None)[source]
    +scan_child(nodename, attributes=None, root=None)[source]

    Get an xml element matching nodename with optional attributes.

    Error unless exactly one match.

    -scan_children(nodename, attributes=None, root=None)[source]
    +scan_children(nodename, attributes=None, root=None)[source]
    -scan_optional_child(nodename, attributes=None, root=None)[source]
    +scan_optional_child(nodename, attributes=None, root=None)[source]

    Get an xml element matching nodename with optional attributes.

    Return None if no match.

    -set(node, attrib_name, value)[source]
    +set(node, attrib_name, value)[source]
    -set_element_text(element_name, new_text, attributes=None, root=None)[source]
    +set_element_text(element_name, new_text, attributes=None, root=None)[source]
    -set_name(node, name)[source]
    +set_name(node, name)[source]
    -set_text(node, text)[source]
    +set_text(node, text)[source]
    -set_value(vid, value, subgroup=None, ignore_type=True)[source]
    +set_value(vid, value, subgroup=None, ignore_type=True)[source]

    ignore_type is not used in this flavor

    -text(node)[source]
    +text(node)[source]
    -to_string(node, method='xml', encoding='us-ascii')[source]
    +to_string(node, method='xml', encoding='us-ascii')[source]
    -unlock()[source]
    +unlock()[source]
    -validate_timestamp()[source]
    +validate_timestamp()[source]
    -validate_xml_file(filename, schema)[source]
    +validate_xml_file(filename, schema)[source]

    validate an XML file against a provided schema file using pylint

    -write(outfile=None, force_write=False)[source]
    +write(outfile=None, force_write=False)[source]

    Write an xml file from data in self

    @@ -1484,90 +1509,90 @@

    Submodules -

    CIME.XML.grids module

    +

    CIME.XML.grids module

    Common interface to XML files which follow the grids format, This is not an abstract class - but inherits from the abstact class GenericXML

    -class CIME.XML.grids.Grids(infile=None, files=None, comp_interface=None)[source]
    +class CIME.XML.grids.Grids(infile=None, files=None, comp_interface=None)[source]

    Bases: GenericXML

    -get_grid_info(name, compset, driver)[source]
    +get_grid_info(name, compset, driver)[source]

    Find the matching grid node

    Returns a dictionary containing relevant grid variables: domains, gridmaps, etc.

    -print_values(long_output=None)[source]
    +print_values(long_output=None)[source]

    -

    CIME.XML.headers module

    +

    CIME.XML.headers module

    Interface to the config_headers.xml file. This class inherits from EntryID.py

    -class CIME.XML.headers.Headers(infile=None)[source]
    +class CIME.XML.headers.Headers(infile=None)[source]

    Bases: GenericXML

    -get_header_node(fname)[source]
    +get_header_node(fname)[source]
    -

    CIME.XML.inputdata module

    +

    CIME.XML.inputdata module

    Interface to the config_inputdata.xml file. This class inherits from GenericXML.py

    -class CIME.XML.inputdata.Inputdata(infile=None, files=None)[source]
    +class CIME.XML.inputdata.Inputdata(infile=None, files=None)[source]

    Bases: GenericXML

    -get_next_server(attributes=None)[source]
    +get_next_server(attributes=None)[source]
    -

    CIME.XML.machines module

    +

    CIME.XML.machines module

    Interface to the config_machines.xml file. This class inherits from GenericXML.py

    -class CIME.XML.machines.Machines(infile=None, files=None, machine=None, extra_machines_dir=None)[source]
    +class CIME.XML.machines.Machines(infile=None, files=None, machine=None, extra_machines_dir=None)[source]

    Bases: GenericXML

    -get_child(name=None, attributes=None, root=None, err_msg=None)[source]
    +get_child(name=None, attributes=None, root=None, err_msg=None)[source]
    -get_default_MPIlib(attributes=None)[source]
    +get_default_MPIlib(attributes=None)[source]

    Get the MPILIB to use from the list of MPILIBS

    -get_default_compiler()[source]
    +get_default_compiler()[source]

    Get the compiler to use from the list of COMPILERS

    -get_extra_machines_dir()[source]
    +get_extra_machines_dir()[source]
    -get_field_from_list(listname, reqval=None, attributes=None)[source]
    +get_field_from_list(listname, reqval=None, attributes=None)[source]

    Some of the fields have lists of valid values in the xml, parse these lists and return the first value if reqval is not provided and reqval if it is a valid setting for the machine

    @@ -1575,85 +1600,85 @@

    Submodules
    -get_first_child_nodes(nodename)[source]
    +get_first_child_nodes(nodename)[source]

    Return the names of all the child nodes for the target machine

    -get_machine_name()[source]
    +get_machine_name()[source]

    Return the name of the machine

    -get_machines_dir()[source]
    +get_machines_dir()[source]

    Return the directory of the machines file

    -get_node_names()[source]
    +get_node_names()[source]

    Return the names of all the child nodes for the target machine

    -get_suffix(suffix_type)[source]
    +get_suffix(suffix_type)[source]
    -get_value(name, attributes=None, resolved=True, subgroup=None)[source]
    +get_value(name, attributes=None, resolved=True, subgroup=None)[source]

    Get Value of fields in the config_machines.xml file

    -has_batch_system()[source]
    +has_batch_system()[source]

    Return if this machine has a batch system

    -is_valid_MPIlib(mpilib, attributes=None)[source]
    +is_valid_MPIlib(mpilib, attributes=None)[source]

    Check the MPILIB is valid for the current machine

    -is_valid_compiler(compiler)[source]
    +is_valid_compiler(compiler)[source]

    Check the compiler is valid for the current machine

    -list_available_machines()[source]
    +list_available_machines()[source]

    Return a list of machines defined for a given CIME_MODEL

    -print_values()[source]
    +print_values()[source]
    -probe_machine_name(warn=True)[source]
    +probe_machine_name(warn=True)[source]

    Find a matching regular expression for hostname in the NODENAME_REGEX field in the file. First match wins.

    -return_values()[source]
    +return_values()[source]

    return a dictionary of machine info This routine is used by external tools in https://github.com/NCAR/CESM_xml2html

    -set_machine(machine)[source]
    +set_machine(machine)[source]

    Sets the machine block in the Machines object

    >>> machobj = Machines(machine="melvin")
     >>> machobj.get_machine_name()
    @@ -1668,7 +1693,7 @@ 

    Submodules
    -set_value(vid, value, subgroup=None, ignore_type=True)[source]
    +set_value(vid, value, subgroup=None, ignore_type=True)[source]

    ignore_type is not used in this flavor

    @@ -1676,32 +1701,32 @@

    Submodules -

    CIME.XML.namelist_definition module

    +

    CIME.XML.namelist_definition module

    Interface to namelist_definition.xml.

    This module contains only one class, NamelistDefinition, inheriting from EntryID.

    -class CIME.XML.namelist_definition.CaseInsensitiveDict(data)[source]
    +class CIME.XML.namelist_definition.CaseInsensitiveDict(data)[source]

    Bases: dict

    Basic case insensitive dict with strings only keys. From https://stackoverflow.com/a/27890005

    -get(k, default=None)[source]
    +get(k, default=None)[source]

    Return the value for key if key is in the dictionary, else default.

    -proxy = {}
    +proxy = {}
    -class CIME.XML.namelist_definition.NamelistDefinition(infile, files=None)[source]
    +class CIME.XML.namelist_definition.NamelistDefinition(infile, files=None)[source]

    Bases: EntryID

    Class representing variable definitions for a namelist. This class inherits from EntryID, and supports most inherited methods; @@ -1712,12 +1737,12 @@

    Submodules
    -add_attributes(attributes)[source]
    +add_attributes(attributes)[source]

    -dict_to_namelist(dict_, filename=None)[source]
    +dict_to_namelist(dict_, filename=None)[source]

    Converts a dictionary of name-value pairs to a Namelist.

    The input is assumed to be similar to the output of parse when groupless=True is set. This function uses the namelist definition file @@ -1729,13 +1754,13 @@

    Submodules
    -get_attributes()[source]
    +get_attributes()[source]

    Return this object’s attributes dictionary

    -get_default_value(item, attribute=None)[source]
    +get_default_value(item, attribute=None)[source]

    Return the default value for the variable named item.

    The return value is a list of strings corresponding to the comma-separated list of entries for the value (length 1 for scalars). If @@ -1744,32 +1769,32 @@

    Submodules
    -get_entry_nodes()[source]
    +get_entry_nodes()[source]

    -get_group(name)[source]
    +get_group(name)[source]
    -get_group_name(node=None)[source]
    +get_group_name(node=None)[source]
    -get_input_pathname(name)[source]
    +get_input_pathname(name)[source]
    -get_per_stream_entries()[source]
    +get_per_stream_entries()[source]
    -get_value_match(vid, attributes=None, exact_match=True, entry_node=None)[source]
    +get_value_match(vid, attributes=None, exact_match=True, entry_node=None)[source]

    Return the default value for the variable named vid.

    The return value is a list of strings corresponding to the comma-separated list of entries for the value (length 1 for scalars). If @@ -1778,7 +1803,7 @@

    Submodules
    -is_valid_value(name, value)[source]
    +is_valid_value(name, value)[source]

    Determine whether a value is valid for the named variable.

    The value argument must be a list of strings formatted as they would appear in the namelist (even for scalar variables, in which case the @@ -1787,30 +1812,30 @@

    Submodules
    -rename_group(oldgroup, newgroup)[source]
    +rename_group(oldgroup, newgroup)[source]

    -set_node_values(name, node)[source]
    +set_node_values(name, node)[source]
    -set_nodes(skip_groups=None)[source]
    +set_nodes(skip_groups=None)[source]

    populates the object data types for all nodes that are not part of the skip_groups array returns nodes that do not have attributes of skip_default_entry or per_stream_entry

    -set_value(vid, value, subgroup=None, ignore_type=True)[source]
    +set_value(vid, value, subgroup=None, ignore_type=True)[source]

    This function is not implemented.

    -split_type_string(name)[source]
    +split_type_string(name)[source]

    Split a ‘type’ attribute string into its component parts.

    The name argument is the variable name. This is used for error reporting purposes.

    @@ -1821,7 +1846,7 @@

    Submodules
    -validate(namelist, filename=None)[source]
    +validate(namelist, filename=None)[source]

    Validate a namelist object against this definition.

    The optional filename argument can be used to assist in error reporting when the namelist comes from a specific, known file.

    @@ -1831,54 +1856,54 @@

    Submodules -

    CIME.XML.pes module

    +

    CIME.XML.pes module

    Interface to the config_pes.xml file. This class inherits from GenericXML.py

    -class CIME.XML.pes.Pes(infile, files=None)[source]
    +class CIME.XML.pes.Pes(infile, files=None)[source]

    Bases: GenericXML

    -find_pes_layout(grid, compset, machine, pesize_opts='M', mpilib=None)[source]
    +find_pes_layout(grid, compset, machine, pesize_opts='M', mpilib=None)[source]

    -

    CIME.XML.pio module

    +

    CIME.XML.pio module

    Class for config_pio files . This class inherits from EntryID.py

    -class CIME.XML.pio.PIO(comp_classes, infile=None, files=None)[source]
    +class CIME.XML.pio.PIO(comp_classes, infile=None, files=None)[source]

    Bases: EntryID

    -check_if_comp_var(vid, attribute=None, node=None)[source]
    +check_if_comp_var(vid, attribute=None, node=None)[source]
    -get_defaults(grid=None, compset=None, mach=None, compiler=None, mpilib=None)[source]
    +get_defaults(grid=None, compset=None, mach=None, compiler=None, mpilib=None)[source]
    -

    CIME.XML.standard_module_setup module

    +

    CIME.XML.standard_module_setup module

    -

    CIME.XML.stream module

    +

    CIME.XML.stream module

    Interface to the streams.xml style files. This class inherits from GenericXML.py

    stream files predate cime and so do not conform to entry id format

    -class CIME.XML.stream.Stream(infile=None, files=None)[source]
    +class CIME.XML.stream.Stream(infile=None, files=None)[source]

    Bases: GenericXML

    -get_value(item, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(item, attribute=None, resolved=True, subgroup=None)[source]

    Get Value of fields in a stream.xml file

    @@ -1886,32 +1911,32 @@

    Submodules -

    CIME.XML.test_reporter module

    +

    CIME.XML.test_reporter module

    Interface to the testreporter xml. This class inherits from GenericXML.py

    -class CIME.XML.test_reporter.TestReporter[source]
    +class CIME.XML.test_reporter.TestReporter[source]

    Bases: GenericXML

    -add_result(test_name, test_status)[source]
    +add_result(test_name, test_status)[source]
    -push2testdb()[source]
    +push2testdb()[source]
    -setup_header(tagname, machine, compiler, mpilib, testroot, testtype, baseline)[source]
    +setup_header(tagname, machine, compiler, mpilib, testroot, testtype, baseline)[source]
    -

    CIME.XML.testlist module

    +

    CIME.XML.testlist module

    Interface to the config_files.xml file. This class inherits from generic_xml.py It supports version 2.0 of the testlist.xml file

    In version 2 of the file options can be specified to further refine a test or @@ -1954,31 +1979,31 @@

    Submodules
    -class CIME.XML.testlist.Testlist(infile, files=None)[source]
    +class CIME.XML.testlist.Testlist(infile, files=None)[source]

    Bases: GenericXML

    -get_tests(machine=None, category=None, compiler=None, compset=None, grid=None, supported_only=False)[source]
    +get_tests(machine=None, category=None, compiler=None, compset=None, grid=None, supported_only=False)[source]

    -

    CIME.XML.tests module

    +

    CIME.XML.tests module

    Interface to the config_tests.xml file. This class inherits from GenericEntry

    -class CIME.XML.tests.Tests(infile=None, files=None)[source]
    +class CIME.XML.tests.Tests(infile=None, files=None)[source]

    Bases: GenericXML

    -get_test_node(testname)[source]
    +get_test_node(testname)[source]
    -print_values(skip_infrastructure_tests=True)[source]
    +print_values(skip_infrastructure_tests=True)[source]

    Print each test type and its description.

    If skip_infrastructure_tests is True, then this does not write information for tests with the attribute @@ -1987,7 +2012,7 @@

    Submodules
    -support_single_exe(case)[source]
    +support_single_exe(case)[source]

    Checks if case supports –single-exe.

    Raises:

    Exception: If system test cannot be found. @@ -2000,40 +2025,40 @@

    Submodules -

    CIME.XML.testspec module

    +

    CIME.XML.testspec module

    Interface to the testspec.xml file. This class inherits from generic_xml.py

    -class CIME.XML.testspec.TestSpec(infile)[source]
    +class CIME.XML.testspec.TestSpec(infile)[source]

    Bases: GenericXML

    -add_test(compiler, mpilib, testname)[source]
    +add_test(compiler, mpilib, testname)[source]
    -set_header(testroot, machine, testid, baselinetag=None, baselineroot=None)[source]
    +set_header(testroot, machine, testid, baselinetag=None, baselineroot=None)[source]
    -update_test_status(testname, phase, status)[source]
    +update_test_status(testname, phase, status)[source]

    -

    CIME.XML.workflow module

    +

    CIME.XML.workflow module

    Interface to the config_workflow.xml file. This class inherits from GenericXML.py

    -class CIME.XML.workflow.Workflow(infile=None, files=None)[source]
    +class CIME.XML.workflow.Workflow(infile=None, files=None)[source]

    Bases: GenericXML

    -get_workflow_jobs(machine, workflowid='default')[source]
    +get_workflow_jobs(machine, workflowid='default')[source]

    Return a list of jobs with the first element the name of the script and the second a dict of qualifiers for the job

    @@ -2042,7 +2067,7 @@

    Submodules -

    Module contents

    +

    Module contents

    @@ -2051,7 +2076,7 @@

    Submodules - +


    diff --git a/versions/master/html/CIME_api/CIME.baselines.html b/versions/master/html/CIME_api/CIME.baselines.html new file mode 100644 index 00000000000..a7e277ca077 --- /dev/null +++ b/versions/master/html/CIME_api/CIME.baselines.html @@ -0,0 +1,402 @@ + + + + + + + CIME.baselines package — CIME master documentation + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    CIME.baselines package

    +
    +

    Submodules

    +
    +
    +

    CIME.baselines.performance module

    +
    +
    +CIME.baselines.performance.get_cpl_mem_usage(cpllog)[source]
    +

    Read memory usage from coupler log.

    +
    +

    Parameters

    +
    +
    cpllogstr

    Path to the coupler log.

    +
    +
    +
    +
    +

    Returns

    +
    +
    list

    Memory usage (data, highwater) as recorded by the coupler or empty list.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.get_cpl_throughput(cpllog)[source]
    +

    Reads throuhgput from coupler log.

    +
    +

    Parameters

    +
    +
    cpllogstr

    Path to the coupler log.

    +
    +
    +
    +
    +

    Returns

    +
    +
    int or None

    Throughput as recorded by the coupler or None

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.get_latest_cpl_logs(case)[source]
    +

    find and return the latest cpl log file in the run directory

    +
    + +
    +
    +CIME.baselines.performance.load_coupler_customization(case)[source]
    +

    Loads customizations from the coupler cime_config directory.

    +
    +

    Parameters

    +
    +
    caseCIME.case.case.Case

    Current case object.

    +
    +
    +
    +
    +

    Returns

    +
    +
    CIME.config.Config

    Runtime configuration.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.perf_compare_memory_baseline(case, baseline_dir=None)[source]
    +

    Compares model highwater memory usage.

    +
    +

    Parameters

    +
    +
    caseCIME.case.case.Case

    Current case object.

    +
    +
    baseline_dirstr

    Overrides the baseline directory.

    +
    +
    +
    +
    +

    Returns

    +
    +
    below_tolerancebool

    Whether the comparison was below the tolerance.

    +
    +
    commentstr

    Provides explanation from comparison.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.perf_compare_throughput_baseline(case, baseline_dir=None)[source]
    +

    Compares model throughput.

    +
    +

    Parameters

    +
    +
    caseCIME.case.case.Case

    Current case object.

    +
    +
    baseline_dirstr

    Overrides the baseline directory.

    +
    +
    +
    +
    +

    Returns

    +
    +
    below_tolerancebool

    Whether the comparison was below the tolerance.

    +
    +
    commentstr

    Provides explanation from comparison.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.perf_get_memory(case, config)[source]
    +

    Gets the model memory usage.

    +

    First attempts to use a coupler defined method to retrieve the +models memory usage. If this is not defined then the default +method of parsing the coupler log is used.

    +
    +

    Parameters

    +
    +
    caseCIME.case.case.Case

    Current case object.

    +
    +
    +
    +
    +

    Returns

    +
    +
    str or None

    Model memory usage.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.perf_get_throughput(case, config)[source]
    +

    Gets the model throughput.

    +

    First attempts to use a coupler define method to retrieve the +models throughput. If this is not defined then the default +method of parsing the coupler log is used.

    +
    +

    Parameters

    +
    +
    caseCIME.case.case.Case

    Current case object.

    +
    +
    +
    +
    +

    Returns

    +
    +
    str or None

    Model throughput.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.perf_write_baseline(case, basegen_dir, throughput=True, memory=True)[source]
    +

    Writes the baseline performance files.

    +
    +

    Parameters

    +
    +
    caseCIME.case.case.Case

    Current case object.

    +
    +
    basegen_dirstr

    Path to baseline directory.

    +
    +
    throughputbool

    If true, write throughput baseline.

    +
    +
    memorybool

    If true, write memory baseline.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.read_baseline_file(baseline_file)[source]
    +

    Reads value from baseline_file.

    +

    Strips comments and returns the raw content to be decoded.

    +
    +

    Parameters

    +
    +
    baseline_filestr

    Path to the baseline file.

    +
    +
    +
    +
    +

    Returns

    +
    +
    str

    Value stored in baseline file without comments.

    +
    +
    +
    +
    + +
    +
    +CIME.baselines.performance.write_baseline_file(baseline_file, value)[source]
    +

    Writes value to baseline_file.

    +
    +

    Parameters

    +
    +
    baseline_filestr

    Path to the baseline file.

    +
    +
    valuestr

    Value to write.

    +
    +
    +
    +
    + +
    +
    +

    Module contents

    +
    +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2017, U.S. National Science Foundation and U.S. Department of Energy.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + + + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/versions/master/html/CIME_api/CIME.build_scripts.html b/versions/master/html/CIME_api/CIME.build_scripts.html index 5cb136a265a..1d9ca146549 100644 --- a/versions/master/html/CIME_api/CIME.build_scripts.html +++ b/versions/master/html/CIME_api/CIME.build_scripts.html @@ -12,17 +12,17 @@ - - - - - + + + + + - + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,9 +138,9 @@
    -

    CIME.build_scripts package

    +

    CIME.build_scripts package

    -

    Module contents

    +

    Module contents

    @@ -147,7 +148,7 @@

    CIME.build_scripts package - +

    diff --git a/versions/master/html/CIME_api/CIME.case.html b/versions/master/html/CIME_api/CIME.case.html index 5886886780d..d91b421eec4 100644 --- a/versions/master/html/CIME_api/CIME.case.html +++ b/versions/master/html/CIME_api/CIME.case.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,18 +138,18 @@
    -

    CIME.case package

    +

    CIME.case package

    -

    Submodules

    +

    Submodules

    -

    CIME.case.case module

    +

    CIME.case.case module

    Wrapper around all env XML for a case.

    All interaction with and between the module files in XML/ takes place through the Case module.

    -class CIME.case.case.Case(case_root=None, read_only=True, record=False, non_local=False)[source]
    +class CIME.case.case.Case(case_root=None, read_only=True, record=False, non_local=False)[source]

    Bases: object

    https://github.com/ESMCI/cime/wiki/Developers-Introduction The Case class is the heart of the CIME Case Control system. All @@ -173,7 +174,7 @@

    Submodules
    -apply_user_mods(user_mods_dirs=None)[source]
    +apply_user_mods(user_mods_dirs=None)[source]

    User mods can be specified on the create_newcase command line (usually when called from create test) or they can be in the compset definition, or both.

    If user_mods_dirs is specified, it should be a list of paths giving the user mods @@ -182,7 +183,7 @@

    Submodules
    -archive_last_restarts(archive_restdir, rundir, last_date=None, link_to_restart_files=False)
    +archive_last_restarts(archive_restdir, rundir, last_date=None, link_to_restart_files=False)

    Convenience function for archiving just the last set of restart files to a given directory. This also saves files attached to the restart set, such as rpointer files and necessary history @@ -196,43 +197,43 @@

    Submodules
    -cancel_batch_jobs(jobids)[source]
    +cancel_batch_jobs(jobids)[source]

    -case_cmpgen_namelists(compare=False, generate=False, compare_name=None, generate_name=None, baseline_root=None, logfile_name='TestStatus.log')
    +case_cmpgen_namelists(compare=False, generate=False, compare_name=None, generate_name=None, baseline_root=None, logfile_name='TestStatus.log')
    -case_run(skip_pnl=False, set_continue_run=False, submit_resubmits=False)
    +case_run(skip_pnl=False, set_continue_run=False, submit_resubmits=False)
    -case_setup(clean=False, test_mode=False, reset=False, keep=None)
    +case_setup(clean=False, test_mode=False, reset=False, keep=None)
    -case_st_archive(last_date_str=None, archive_incomplete_logs=True, copy_only=False, resubmit=True)
    +case_st_archive(last_date_str=None, archive_incomplete_logs=True, copy_only=False, resubmit=True)

    Create archive object and perform short term archiving

    -case_test(testname=None, reset=False, skip_pnl=False)
    +case_test(testname=None, reset=False, skip_pnl=False)
    -check_DA_settings()
    +check_DA_settings()
    -check_all_input_data(protocol=None, address=None, input_data_root=None, data_list_dir='Buildconf', download=True, chksum=False)
    +check_all_input_data(protocol=None, address=None, input_data_root=None, data_list_dir='Buildconf', download=True, chksum=False)

    Read through all files of the form *.input_data_list in the data_list_dir directory. These files contain a list of input and boundary files needed by each model component. For each file in the list confirm that it is available in input_data_root and if not (optionally download it from a @@ -241,17 +242,17 @@

    Submodules
    -check_case(skip_pnl=False, chksum=False)
    +check_case(skip_pnl=False, chksum=False)

    -check_if_comp_var(vid)[source]
    +check_if_comp_var(vid)[source]
    -check_input_data(protocol='svn', address=None, input_data_root=None, data_list_dir='Buildconf', download=False, user=None, passwd=None, chksum=False, ic_filepath=None)
    +check_input_data(protocol='svn', address=None, input_data_root=None, data_list_dir='Buildconf', download=False, user=None, passwd=None, chksum=False, ic_filepath=None)

    For a given case check for the relevant input data as specified in data_list_dir/*.input_data_list in the directory input_data_root, if not found optionally download it using the servers specified in config_inputdata.xml. If a chksum file is available compute the chksum and compare it to that @@ -261,55 +262,55 @@

    Submodules
    -check_lockedfile(filebase)
    +check_lockedfile(filebase)

    -check_lockedfiles(skip=None)
    +check_lockedfiles(skip=None)

    Check that all lockedfiles match what’s in case

    If caseroot is not specified, it is set to the current working directory

    -check_pelayouts_require_rebuild(models)
    +check_pelayouts_require_rebuild(models)

    Create if we require a rebuild, expects cwd is caseroot

    -check_timestamps(short_name=None)[source]
    +check_timestamps(short_name=None)[source]
    -clean_up_lookups(allow_undefined=False)[source]
    +clean_up_lookups(allow_undefined=False)[source]
    -configure(compset_name, grid_name, machine_name=None, project=None, pecount=None, compiler=None, mpilib=None, pesfile=None, gridfile=None, multi_driver=False, ninst=1, test=False, walltime=None, queue=None, output_root=None, run_unsupported=False, answer=None, input_dir=None, driver=None, workflowid='default', non_local=False, extra_machines_dir=None, case_group=None, ngpus_per_node=0, gpu_type=None, gpu_offload=None)[source]
    +configure(compset_name, grid_name, machine_name=None, project=None, pecount=None, compiler=None, mpilib=None, pesfile=None, gridfile=None, multi_driver=False, ninst=1, test=False, walltime=None, queue=None, output_root=None, run_unsupported=False, answer=None, input_dir=None, driver=None, workflowid='default', non_local=False, extra_machines_dir=None, case_group=None, ngpus_per_node=0, gpu_type=None, gpu_offload=None)[source]
    -copy(newcasename, newcaseroot, newcimeroot=None, newsrcroot=None)[source]
    +copy(newcasename, newcaseroot, newcimeroot=None, newsrcroot=None)[source]
    -create(casename, srcroot, compset_name, grid_name, user_mods_dirs=None, machine_name=None, project=None, pecount=None, compiler=None, mpilib=None, pesfile=None, gridfile=None, multi_driver=False, ninst=1, test=False, walltime=None, queue=None, output_root=None, run_unsupported=False, answer=None, input_dir=None, driver=None, workflowid='default', non_local=False, extra_machines_dir=None, case_group=None, ngpus_per_node=0, gpu_type=None, gpu_offload=None)[source]
    +create(casename, srcroot, compset_name, grid_name, user_mods_dirs=None, machine_name=None, project=None, pecount=None, compiler=None, mpilib=None, pesfile=None, gridfile=None, multi_driver=False, ninst=1, test=False, walltime=None, queue=None, output_root=None, run_unsupported=False, answer=None, input_dir=None, driver=None, workflowid='default', non_local=False, extra_machines_dir=None, case_group=None, ngpus_per_node=0, gpu_type=None, gpu_offload=None)[source]
    -create_caseroot(clone=False)[source]
    +create_caseroot(clone=False)[source]
    -create_clone(newcaseroot, keepexe=False, mach_dir=None, project=None, cime_output_root=None, exeroot=None, rundir=None, user_mods_dirs=None)
    +create_clone(newcaseroot, keepexe=False, mach_dir=None, project=None, cime_output_root=None, exeroot=None, rundir=None, user_mods_dirs=None)

    Create a case clone

    If exeroot or rundir are provided (not None), sets these directories to the given paths; if not provided, uses default values for these @@ -318,212 +319,217 @@

    Submodules
    -create_dirs()
    +create_dirs()

    Make necessary directories for case

    -create_namelists(component=None)
    +create_namelists(component=None)

    Create component namelists

    -fix_sys_argv_quotes(cmd)[source]
    +fix_sys_argv_quotes(cmd)[source]

    Fixes removed quotes from argument list.

    Restores quotes to –val and KEY=VALUE from sys.argv.

    -flush(flushall=False)[source]
    +flush(flushall=False)[source] +
    + +
    +
    +get_baseline_dir()[source]
    -get_batch_jobs()[source]
    +get_batch_jobs()[source]
    -get_build_threaded()[source]
    +get_build_threaded()[source]

    Returns True if current settings require a threaded build/run.

    -get_case_root()[source]
    +get_case_root()[source]

    Returns the root directory for this case.

    -get_compset_components()[source]
    +get_compset_components()[source]
    -get_compset_var_settings(files)[source]
    +get_compset_var_settings(files)[source]
    -get_env(short_name, allow_missing=False)[source]
    +get_env(short_name, allow_missing=False)[source]
    -get_first_job()[source]
    +get_first_job()[source]
    -get_job_id(output)[source]
    +get_job_id(output)[source]
    -get_job_info()[source]
    +get_job_info()[source]

    Get information on batch jobs associated with this case

    -get_latest_cpl_log(coupler_log_path=None, cplname='cpl')[source]
    +get_latest_cpl_log(coupler_log_path=None, cplname='cpl')[source]

    find and return the latest cpl log file in the coupler_log_path directory

    -get_mpirun_cmd(job=None, allow_unresolved_envvars=True, overrides=None)[source]
    +get_mpirun_cmd(job=None, allow_unresolved_envvars=True, overrides=None)[source]
    -get_primary_component()[source]
    +get_primary_component()[source]
    -get_primary_job()[source]
    +get_primary_job()[source]
    -get_record_fields(variable, field)[source]
    +get_record_fields(variable, field)[source]

    get_record_fields gets individual requested field from an entry_id file this routine is used only by xmlquery

    -get_resolved_value(item, recurse=0, allow_unresolved_envvars=False)[source]
    +get_resolved_value(item, recurse=0, allow_unresolved_envvars=False)[source]
    -get_type_info(item)[source]
    +get_type_info(item)[source]
    -get_value(item, attribute=None, resolved=True, subgroup=None)[source]
    +get_value(item, attribute=None, resolved=True, subgroup=None)[source]
    -get_values(item, attribute=None, resolved=True, subgroup=None)[source]
    +get_values(item, attribute=None, resolved=True, subgroup=None)[source]
    -initialize_derived_attributes()[source]
    +initialize_derived_attributes()[source]

    These are derived variables which can be used in the config_* files for variable substitution using the {{ var }} syntax

    -is_save_timing_dir_project(project)[source]
    +is_save_timing_dir_project(project)[source]

    Check whether the project is permitted to archive performance data in the location specified for the current machine

    -load_env(reset=False, job=None, verbose=False)[source]
    +load_env(reset=False, job=None, verbose=False)[source]
    -new_hash()[source]
    +new_hash()[source]

    Creates a hash

    -preview_run(write, job)[source]
    +preview_run(write, job)[source]
    -read_xml()[source]
    +read_xml()[source]
    -record_cmd(cmd=None, init=False)[source]
    +record_cmd(cmd=None, init=False)[source]
    -report_job_status()[source]
    +report_job_status()[source]
    -restore_from_archive(rest_dir=None, dout_s_root=None, rundir=None, test=False)
    +restore_from_archive(rest_dir=None, dout_s_root=None, rundir=None, test=False)

    Take archived restart files and load them into current case. Use rest_dir if provided otherwise use most recent restore_from_archive is a member of Class Case

    -set_comp_classes(comp_classes)[source]
    +set_comp_classes(comp_classes)[source]
    -set_file(xmlfile)[source]
    +set_file(xmlfile)[source]

    force the case object to consider only xmlfile

    -set_initial_test_values()[source]
    +set_initial_test_values()[source]
    -set_lookup_value(item, value)[source]
    +set_lookup_value(item, value)[source]
    -set_model_version(model)[source]
    +set_model_version(model)[source]
    -set_valid_values(item, valid_values)[source]
    +set_valid_values(item, valid_values)[source]

    Update or create a valid_values entry for item and populate it

    -set_value(item, value, subgroup=None, ignore_type=False, allow_undefined=False, return_file=False)[source]
    +set_value(item, value, subgroup=None, ignore_type=False, allow_undefined=False, return_file=False)[source]

    If a file has been defined, and the variable is in the file, then that value will be set in the file object and the resovled value is returned unless return_file is True, in which case (resolved_value, filename) @@ -532,7 +538,7 @@

    Submodules
    -stage_refcase(input_data_root=None, data_list_dir=None)
    +stage_refcase(input_data_root=None, data_list_dir=None)

    Get a REFCASE for a hybrid or branch run This is the only case in which we are downloading an entire directory instead of a single file at a time.

    @@ -540,33 +546,33 @@

    Submodules
    -submit(job=None, no_batch=False, prereq=None, allow_fail=False, resubmit=False, resubmit_immediate=False, skip_pnl=False, mail_user=None, mail_type=None, batch_args=None, workflow=True, chksum=False)
    +submit(job=None, no_batch=False, prereq=None, allow_fail=False, resubmit=False, resubmit_immediate=False, skip_pnl=False, mail_user=None, mail_type=None, batch_args=None, workflow=True, chksum=False)

    -submit_jobs(no_batch=False, job=None, skip_pnl=None, prereq=None, allow_fail=False, resubmit_immediate=False, mail_user=None, mail_type=None, batch_args=None, dry_run=False, workflow=True)[source]
    +submit_jobs(no_batch=False, job=None, skip_pnl=None, prereq=None, allow_fail=False, resubmit_immediate=False, mail_user=None, mail_type=None, batch_args=None, dry_run=False, workflow=True)[source]
    -test_env_archive(testdir='env_archive_test')
    +test_env_archive(testdir='env_archive_test')
    -test_st_archive(testdir='st_archive_test')
    +test_st_archive(testdir='st_archive_test')
    -update_env(new_object, env_file, blow_away=False)[source]
    +update_env(new_object, env_file, blow_away=False)[source]

    Replace a case env object file

    -valid_compset(compset_name, compset_alias, files)[source]
    +valid_compset(compset_name, compset_alias, files)[source]

    Add stub models missing in <compset_name>, return full compset name. <files> is used to collect set of all supported components.

    @@ -575,11 +581,11 @@

    Submodules -

    CIME.case.case_clone module

    +

    CIME.case.case_clone module

    create_clone is a member of the Case class from file case.py

    -CIME.case.case_clone.create_clone(self, newcaseroot, keepexe=False, mach_dir=None, project=None, cime_output_root=None, exeroot=None, rundir=None, user_mods_dirs=None)[source]
    +CIME.case.case_clone.create_clone(self, newcaseroot, keepexe=False, mach_dir=None, project=None, cime_output_root=None, exeroot=None, rundir=None, user_mods_dirs=None)[source]

    Create a case clone

    If exeroot or rundir are provided (not None), sets these directories to the given paths; if not provided, uses default values for these @@ -588,43 +594,43 @@

    Submodules -

    CIME.case.case_cmpgen_namelists module

    +

    CIME.case.case_cmpgen_namelists module

    Library for case.cmpgen_namelists. case_cmpgen_namelists is a member of Class case from file case.py

    -CIME.case.case_cmpgen_namelists.case_cmpgen_namelists(self, compare=False, generate=False, compare_name=None, generate_name=None, baseline_root=None, logfile_name='TestStatus.log')[source]
    +CIME.case.case_cmpgen_namelists.case_cmpgen_namelists(self, compare=False, generate=False, compare_name=None, generate_name=None, baseline_root=None, logfile_name='TestStatus.log')[source]
    -

    CIME.case.case_run module

    +

    CIME.case.case_run module

    case_run is a member of Class Case ‘

    -CIME.case.case_run.case_run(self, skip_pnl=False, set_continue_run=False, submit_resubmits=False)[source]
    +CIME.case.case_run.case_run(self, skip_pnl=False, set_continue_run=False, submit_resubmits=False)[source]
    -

    CIME.case.case_setup module

    +

    CIME.case.case_setup module

    Library for case.setup. case_setup is a member of class Case from file case.py

    -CIME.case.case_setup.case_setup(self, clean=False, test_mode=False, reset=False, keep=None)[source]
    +CIME.case.case_setup.case_setup(self, clean=False, test_mode=False, reset=False, keep=None)[source]
    -

    CIME.case.case_st_archive module

    +

    CIME.case.case_st_archive module

    short term archiving case_st_archive, restore_from_archive, archive_last_restarts are members of class Case from file case.py

    -CIME.case.case_st_archive.archive_last_restarts(self, archive_restdir, rundir, last_date=None, link_to_restart_files=False)[source]
    +CIME.case.case_st_archive.archive_last_restarts(self, archive_restdir, rundir, last_date=None, link_to_restart_files=False)[source]

    Convenience function for archiving just the last set of restart files to a given directory. This also saves files attached to the restart set, such as rpointer files and necessary history @@ -638,73 +644,73 @@

    Submodules
    -CIME.case.case_st_archive.case_st_archive(self, last_date_str=None, archive_incomplete_logs=True, copy_only=False, resubmit=True)[source]
    +CIME.case.case_st_archive.case_st_archive(self, last_date_str=None, archive_incomplete_logs=True, copy_only=False, resubmit=True)[source]

    Create archive object and perform short term archiving

    -CIME.case.case_st_archive.get_histfiles_for_restarts(rundir, archive, archive_entry, restfile, testonly=False)[source]
    +CIME.case.case_st_archive.get_histfiles_for_restarts(rundir, archive, archive_entry, restfile, testonly=False)[source]

    query restart files to determine history files that are needed for restarts

    Not doc-testable due to filesystem dependence

    -CIME.case.case_st_archive.restore_from_archive(self, rest_dir=None, dout_s_root=None, rundir=None, test=False)[source]
    +CIME.case.case_st_archive.restore_from_archive(self, rest_dir=None, dout_s_root=None, rundir=None, test=False)[source]

    Take archived restart files and load them into current case. Use rest_dir if provided otherwise use most recent restore_from_archive is a member of Class Case

    -CIME.case.case_st_archive.test_env_archive(self, testdir='env_archive_test')[source]
    +CIME.case.case_st_archive.test_env_archive(self, testdir='env_archive_test')[source]
    -CIME.case.case_st_archive.test_st_archive(self, testdir='st_archive_test')[source]
    +CIME.case.case_st_archive.test_st_archive(self, testdir='st_archive_test')[source]
    -

    CIME.case.case_submit module

    +

    CIME.case.case_submit module

    case.submit - Submit a cesm workflow to the queueing system or run it if there is no queueing system. A cesm workflow may include multiple jobs. submit, check_case and check_da_settings are members of class Case in file case.py

    -CIME.case.case_submit.check_DA_settings(self)[source]
    +CIME.case.case_submit.check_DA_settings(self)[source]
    -CIME.case.case_submit.check_case(self, skip_pnl=False, chksum=False)[source]
    +CIME.case.case_submit.check_case(self, skip_pnl=False, chksum=False)[source]
    -CIME.case.case_submit.submit(self, job=None, no_batch=False, prereq=None, allow_fail=False, resubmit=False, resubmit_immediate=False, skip_pnl=False, mail_user=None, mail_type=None, batch_args=None, workflow=True, chksum=False)[source]
    +CIME.case.case_submit.submit(self, job=None, no_batch=False, prereq=None, allow_fail=False, resubmit=False, resubmit_immediate=False, skip_pnl=False, mail_user=None, mail_type=None, batch_args=None, workflow=True, chksum=False)[source]
    -

    CIME.case.case_test module

    +

    CIME.case.case_test module

    Run a testcase. case_test is a member of class Case from case.py

    -CIME.case.case_test.case_test(self, testname=None, reset=False, skip_pnl=False)[source]
    +CIME.case.case_test.case_test(self, testname=None, reset=False, skip_pnl=False)[source]
    -

    CIME.case.check_input_data module

    +

    CIME.case.check_input_data module

    API for checking input for testcase

    -CIME.case.check_input_data.check_all_input_data(self, protocol=None, address=None, input_data_root=None, data_list_dir='Buildconf', download=True, chksum=False)[source]
    +CIME.case.check_input_data.check_all_input_data(self, protocol=None, address=None, input_data_root=None, data_list_dir='Buildconf', download=True, chksum=False)[source]

    Read through all files of the form *.input_data_list in the data_list_dir directory. These files contain a list of input and boundary files needed by each model component. For each file in the list confirm that it is available in input_data_root and if not (optionally download it from a @@ -713,7 +719,7 @@

    Submodules
    -CIME.case.check_input_data.check_input_data(case, protocol='svn', address=None, input_data_root=None, data_list_dir='Buildconf', download=False, user=None, passwd=None, chksum=False, ic_filepath=None)[source]
    +CIME.case.check_input_data.check_input_data(case, protocol='svn', address=None, input_data_root=None, data_list_dir='Buildconf', download=False, user=None, passwd=None, chksum=False, ic_filepath=None)[source]

    For a given case check for the relevant input data as specified in data_list_dir/*.input_data_list in the directory input_data_root, if not found optionally download it using the servers specified in config_inputdata.xml. If a chksum file is available compute the chksum and compare it to that @@ -723,13 +729,13 @@

    Submodules
    -CIME.case.check_input_data.md5(fname)[source]
    +CIME.case.check_input_data.md5(fname)[source]

    performs an md5 sum one chunk at a time to avoid memory issues with large files.

    -CIME.case.check_input_data.stage_refcase(self, input_data_root=None, data_list_dir=None)[source]
    +CIME.case.check_input_data.stage_refcase(self, input_data_root=None, data_list_dir=None)[source]

    Get a REFCASE for a hybrid or branch run This is the only case in which we are downloading an entire directory instead of a single file at a time.

    @@ -737,55 +743,55 @@

    Submodules
    -CIME.case.check_input_data.verify_chksum(input_data_root, rundir, filename, isdirectory)[source]
    +CIME.case.check_input_data.verify_chksum(input_data_root, rundir, filename, isdirectory)[source]

    For file in filename perform a chksum and compare the result to that stored in the local checksumfile, if isdirectory chksum all files in the directory of form .

    -

    CIME.case.check_lockedfiles module

    +

    CIME.case.check_lockedfiles module

    API for checking locked files check_lockedfile, check_lockedfiles, check_pelayouts_require_rebuild are members of Class case.py from file case.py

    -CIME.case.check_lockedfiles.check_lockedfile(self, filebase)[source]
    +CIME.case.check_lockedfiles.check_lockedfile(self, filebase)[source]
    -CIME.case.check_lockedfiles.check_lockedfiles(self, skip=None)[source]
    +CIME.case.check_lockedfiles.check_lockedfiles(self, skip=None)[source]

    Check that all lockedfiles match what’s in case

    If caseroot is not specified, it is set to the current working directory

    -CIME.case.check_lockedfiles.check_pelayouts_require_rebuild(self, models)[source]
    +CIME.case.check_lockedfiles.check_pelayouts_require_rebuild(self, models)[source]

    Create if we require a rebuild, expects cwd is caseroot

    -

    CIME.case.preview_namelists module

    +

    CIME.case.preview_namelists module

    API for preview namelist create_dirs and create_namelists are members of Class case from file case.py

    -CIME.case.preview_namelists.create_dirs(self)[source]
    +CIME.case.preview_namelists.create_dirs(self)[source]

    Make necessary directories for case

    -CIME.case.preview_namelists.create_namelists(self, component=None)[source]
    +CIME.case.preview_namelists.create_namelists(self, component=None)[source]

    Create component namelists

    -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.data.config.html b/versions/master/html/CIME_api/CIME.data.config.html index 49ecef2c2b8..365d3a8cf96 100644 --- a/versions/master/html/CIME_api/CIME.data.config.html +++ b/versions/master/html/CIME_api/CIME.data.config.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -138,9 +139,9 @@
    -

    CIME.data.config package

    +

    CIME.data.config package

    -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.data.html b/versions/master/html/CIME_api/CIME.data.html index 4dd090ce4f9..d039358f46b 100644 --- a/versions/master/html/CIME_api/CIME.data.html +++ b/versions/master/html/CIME_api/CIME.data.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -137,9 +138,9 @@
    -

    CIME.data package

    +

    CIME.data package

    -

    Subpackages

    +

    Subpackages

    diff --git a/versions/master/html/CIME_api/CIME.data.templates.html b/versions/master/html/CIME_api/CIME.data.templates.html index ddf13aeac26..e55f7b4ea22 100644 --- a/versions/master/html/CIME_api/CIME.data.templates.html +++ b/versions/master/html/CIME_api/CIME.data.templates.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -138,9 +139,9 @@
    -

    CIME.data.templates package

    +

    CIME.data.templates package

    -

    Module contents

    +

    Module contents

    diff --git a/versions/master/html/CIME_api/CIME.html b/versions/master/html/CIME_api/CIME.html index 856416d43df..e4c96a804e4 100644 --- a/versions/master/html/CIME_api/CIME.html +++ b/versions/master/html/CIME_api/CIME.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
  • CIME.SystemTests package
  • CIME.Tools package
  • CIME.XML package
  • +
  • CIME.baselines package
  • CIME.build_scripts package
  • CIME.case package
  • CIME.data package
  • @@ -80,8 +81,10 @@
  • CIME.bless_test_results module
  • CIME.build module
      @@ -128,6 +131,7 @@
    • CIME.config module
    • CIME.cs_status module @@ -248,6 +253,7 @@
    • IndentFormatter
    • SharedArea
    • Timeout
    • +
    • add_flag_to_cmd()
    • add_mail_type_args()
    • analyze_build_log()
    • append_case_status()
    • @@ -399,9 +405,9 @@
      -

      CIME package

      +

      CIME package

      -

      Subpackages

      +

      Subpackages

    • CIME.XML.env_build module
    • +
    • CIME.baselines package +
    • CIME.build_scripts package @@ -1252,6 +1279,7 @@

      SubpackagesCase.create_namelists()

    • Case.fix_sys_argv_quotes()
    • Case.flush()
    • +
    • Case.get_baseline_dir()
    • Case.get_batch_jobs()
    • Case.get_build_threaded()
    • Case.get_case_root()
    • @@ -1698,6 +1726,47 @@

      SubpackagesCIME.tests.test_unit_baselines_performance module +
    • CIME.tests.test_unit_case module
    • -

      CIME.aprun module

      +

      CIME.aprun module

      Aprun is far too complex to handle purely through XML. We need python code to compute and assemble aprun commands.

      -CIME.aprun.get_aprun_cmd_for_case(case, run_exe, overrides=None, extra_args=None)[source]
      +CIME.aprun.get_aprun_cmd_for_case(case, run_exe, overrides=None, extra_args=None)[source]

      Given a case, construct and return the aprun command and optimized node count

      -

      CIME.bless_test_results module

      +

      CIME.bless_test_results module

      -CIME.bless_test_results.bless_history(test_name, case, baseline_name, baseline_root, report_only, force)[source]
      +CIME.bless_test_results.bless_history(test_name, case, baseline_name, baseline_root, report_only, force)[source] +
      + +
      +
      +CIME.bless_test_results.bless_memory(case, test_name, baseline_root, baseline_name, report_only, force)[source]
      -CIME.bless_test_results.bless_namelists(test_name, report_only, force, pesfile, baseline_name, baseline_root, new_test_root=None, new_test_id=None)[source]
      +CIME.bless_test_results.bless_namelists(test_name, report_only, force, pesfile, baseline_name, baseline_root, new_test_root=None, new_test_id=None)[source]
      -CIME.bless_test_results.bless_test_results(baseline_name, baseline_root, test_root, compiler, test_id=None, namelists_only=False, hist_only=False, report_only=False, force=False, pesfile=None, bless_tests=None, no_skip_pass=False, new_test_root=None, new_test_id=None)[source]
      +CIME.bless_test_results.bless_test_results(baseline_name, baseline_root, test_root, compiler, test_id=None, namelists_only=False, hist_only=False, tput_only=False, mem_only=False, report_only=False, force=False, pesfile=None, bless_tests=None, no_skip_pass=False, new_test_root=None, new_test_id=None, **_)[source] +
      + +
      +
      +CIME.bless_test_results.bless_throughput(case, test_name, baseline_root, baseline_name, report_only, force)[source]
      -

      CIME.build module

      +

      CIME.build module

      functions for building CIME models

      -class CIME.build.CmakeTmpBuildDir(macroloc=None, rootdir=None, tmpdir=None)[source]
      +class CIME.build.CmakeTmpBuildDir(macroloc=None, rootdir=None, tmpdir=None)[source]

      Bases: object

      Use to create a temporary cmake build dir for the purposes of querying Macros.

      -get_full_tmpdir()[source]
      +get_full_tmpdir()[source]
      -get_makefile_vars(case=None, comp=None, cmake_args=None)[source]
      +get_makefile_vars(case=None, comp=None, cmake_args=None)[source]

      Run cmake and process output to a list of variable settings

      case can be None if caller is providing their own cmake args

      @@ -2221,17 +2317,17 @@

      Submodules
      -CIME.build.case_build(caseroot, case, sharedlib_only=False, model_only=False, buildlist=None, save_build_provenance=True, separate_builds=False, ninja=False, dry_run=False)[source]
      +CIME.build.case_build(caseroot, case, sharedlib_only=False, model_only=False, buildlist=None, save_build_provenance=True, separate_builds=False, ninja=False, dry_run=False)[source]

      -CIME.build.clean(case, cleanlist=None, clean_all=False, clean_depends=None)[source]
      +CIME.build.clean(case, cleanlist=None, clean_all=False, clean_depends=None)[source]
      -CIME.build.generate_makefile_macro(case, caseroot)[source]
      +CIME.build.generate_makefile_macro(case, caseroot)[source]

      Generates a flat Makefile macro file based on the CMake cache system. This macro is only used by certain sharedlibs since components use CMake. Since indirection based on comp_name is allowed for sharedlibs, each sharedlib must generate @@ -2240,124 +2336,124 @@

      Submodules
      -CIME.build.get_standard_cmake_args(case, sharedpath)[source]
      +CIME.build.get_standard_cmake_args(case, sharedpath)[source]

      -CIME.build.get_standard_makefile_args(case, shared_lib=False)[source]
      +CIME.build.get_standard_makefile_args(case, shared_lib=False)[source]
      -CIME.build.post_build(case, logs, build_complete=False, save_build_provenance=True)[source]
      +CIME.build.post_build(case, logs, build_complete=False, save_build_provenance=True)[source]
      -CIME.build.uses_kokkos(case)[source]
      +CIME.build.uses_kokkos(case)[source]
      -CIME.build.xml_to_make_variable(case, varname, cmake=False)[source]
      +CIME.build.xml_to_make_variable(case, varname, cmake=False)[source]
      -

      CIME.buildlib module

      +

      CIME.buildlib module

      common utilities for buildlib

      -CIME.buildlib.build_cime_component_lib(case, compname, libroot, bldroot)[source]
      +CIME.buildlib.build_cime_component_lib(case, compname, libroot, bldroot)[source]
      -CIME.buildlib.parse_input(argv)[source]
      +CIME.buildlib.parse_input(argv)[source]
      -CIME.buildlib.run_gmake(case, compclass, compname, libroot, bldroot, libname='', user_cppdefs='')[source]
      +CIME.buildlib.run_gmake(case, compclass, compname, libroot, bldroot, libname='', user_cppdefs='')[source]
      -

      CIME.buildnml module

      +

      CIME.buildnml module

      common implementation for building namelist commands

      These are used by components/<model_type>/<component>/cime_config/buildnml

      -CIME.buildnml.build_xcpl_nml(case, caseroot, compname)[source]
      +CIME.buildnml.build_xcpl_nml(case, caseroot, compname)[source]
      -CIME.buildnml.copy_inputs_to_rundir(caseroot, compname, confdir, rundir, inst_string)[source]
      +CIME.buildnml.copy_inputs_to_rundir(caseroot, compname, confdir, rundir, inst_string)[source]
      -CIME.buildnml.create_namelist_infile(case, user_nl_file, namelist_infile, infile_text='')[source]
      +CIME.buildnml.create_namelist_infile(case, user_nl_file, namelist_infile, infile_text='')[source]
      -CIME.buildnml.parse_input(argv)[source]
      +CIME.buildnml.parse_input(argv)[source]
      -

      CIME.code_checker module

      +

      CIME.code_checker module

      Libraries for checking python code with pylint

      -CIME.code_checker.check_code(files, num_procs=10, interactive=False)[source]
      +CIME.code_checker.check_code(files, num_procs=10, interactive=False)[source]

      Check all python files in the given directory

      Returns True if all files had no problems

      -CIME.code_checker.get_all_checkable_files()[source]
      +CIME.code_checker.get_all_checkable_files()[source]
      -

      CIME.compare_namelists module

      +

      CIME.compare_namelists module

      -CIME.compare_namelists.compare_namelist_files(gold_file, compare_file, case=None)[source]
      +CIME.compare_namelists.compare_namelist_files(gold_file, compare_file, case=None)[source]

      Returns (is_match, comments)

      -CIME.compare_namelists.is_namelist_file(file_path)[source]
      +CIME.compare_namelists.is_namelist_file(file_path)[source]
      -

      CIME.compare_test_results module

      +

      CIME.compare_test_results module

      -CIME.compare_test_results.append_status_cprnc_log(msg, logfile_name, test_dir)[source]
      +CIME.compare_test_results.append_status_cprnc_log(msg, logfile_name, test_dir)[source]
      -CIME.compare_test_results.compare_history(case, baseline_name, baseline_root, log_id)[source]
      +CIME.compare_test_results.compare_history(case, baseline_name, baseline_root, log_id)[source]
      -CIME.compare_test_results.compare_namelists(case, baseline_name, baseline_root, logfile_name)[source]
      +CIME.compare_test_results.compare_namelists(case, baseline_name, baseline_root, logfile_name)[source]
      -CIME.compare_test_results.compare_test_results(baseline_name, baseline_root, test_root, compiler, test_id=None, compare_tests=None, namelists_only=False, hist_only=False)[source]
      +CIME.compare_test_results.compare_test_results(baseline_name, baseline_root, test_root, compiler, test_id=None, compare_tests=None, namelists_only=False, hist_only=False)[source]

      Compares with baselines for all matching tests

      Outputs results for each test to stdout (one line per test); possible status codes are: PASS, FAIL, SKIP. (A SKIP denotes a test that did not make it to @@ -2372,38 +2468,49 @@

      Submodules -

      CIME.config module

      +

      CIME.config module

      -class CIME.config.Config[source]
      +class CIME.config.Config[source] +

      Bases: ConfigBase

      +
      + +
      +
      +class CIME.config.ConfigBase[source]

      Bases: object

      -
      -classmethod instance()[source]
      +
      +classmethod instance()[source]

      Access singleton.

      Explicit way to access singleton, same as calling constructor.

      -
      -classmethod load(customize_path)[source]
      +
      +classmethod load(customize_path)[source]
      +
      + +
      +
      +property loaded
      -
      -print_rst_table()[source]
      +
      +print_rst_table()[source]
      -

      CIME.cs_status module

      +

      CIME.cs_status module

      Implementation of the cs.status script, which prints the status of all of the tests in one or more test suites

      -CIME.cs_status.cs_status(test_paths, summary=False, fails_only=False, count_fails_phase_list=None, check_throughput=False, check_memory=False, expected_fails_filepath=None, force_rebuild=False, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]
      +CIME.cs_status.cs_status(test_paths, summary=False, fails_only=False, count_fails_phase_list=None, check_throughput=False, check_memory=False, expected_fails_filepath=None, force_rebuild=False, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

      Print the test statuses of all tests in test_paths. The default is to print to stdout, but this can be overridden with the ‘out’ argument.

      @@ -2423,11 +2530,11 @@

      Submodules -

      CIME.cs_status_creator module

      +

      CIME.cs_status_creator module

      Creates a test suite-specific cs.status file from a template

      -CIME.cs_status_creator.create_cs_status(test_root, test_id, extra_args='', filename=None)[source]
      +CIME.cs_status_creator.create_cs_status(test_root, test_id, extra_args='', filename=None)[source]

      Create a test suite-specific cs.status file from the template

      Arguments: test_root (string): path to test root; the file will be put here. If

      @@ -2450,10 +2557,10 @@

      Submodules -

      CIME.date module

      +

      CIME.date module

      -class CIME.date.date(year=1, month=1, day=1, hour=0, minute=0, second=0)[source]
      +class CIME.date.date(year=1, month=1, day=1, hour=0, minute=0, second=0)[source]

      Bases: object

      Simple struct for holding dates and the time of day and performing comparisons

      Difference in Hour, Minute, or Second @@ -2566,54 +2673,54 @@

      Submodules
      -day()[source]
      +day()[source]

      -static hms_to_second(hour, minute, second)[source]
      +static hms_to_second(hour, minute, second)[source]
      -hour()[source]
      +hour()[source]
      -minute()[source]
      +minute()[source]
      -month()[source]
      +month()[source]
      -second()[source]
      +second()[source]
      -second_of_day()[source]
      +second_of_day()[source]
      -static second_to_hms(second)[source]
      +static second_to_hms(second)[source]
      -year()[source]
      +year()[source]
      -CIME.date.get_file_date(filename)[source]
      +CIME.date.get_file_date(filename)[source]

      Returns the date associated with the filename as a date object representing the correct date Formats supported: “%Y-%m-%d_%h.%M.%s @@ -2642,21 +2749,21 @@

      Submodules -

      CIME.expected_fails module

      +

      CIME.expected_fails module

      Contains the definition of a class to hold information on expected failures for a single test

      -class CIME.expected_fails.ExpectedFails[source]
      +class CIME.expected_fails.ExpectedFails[source]

      Bases: object

      -add_failure(phase, expected_status)[source]
      +add_failure(phase, expected_status)[source]

      Add an expected failure to the list

      -expected_fails_comment(phase, status)[source]
      +expected_fails_comment(phase, status)[source]

      Returns a string giving the expected fails comment for this phase and status

      @@ -2664,10 +2771,10 @@

      Submodules -

      CIME.get_tests module

      +

      CIME.get_tests module

      -CIME.get_tests.get_build_groups(tests)[source]
      +CIME.get_tests.get_build_groups(tests)[source]

      Given a list of tests, return a list of lists, with each list representing a group of tests that can share executables.

      >>> tests = ["SMS_P2.f19_g16_rx1.A.melvin_gnu", "SMS_P4.f19_g16_rx1.A.melvin_gnu", "SMS_P2.f19_g16_rx1.X.melvin_gnu", "SMS_P4.f19_g16_rx1.X.melvin_gnu", "TESTRUNSLOWPASS_P1.f19_g16_rx1.A.melvin_gnu", "TESTRUNSLOWPASS_P1.ne30_g16_rx1.A.melvin_gnu"]
      @@ -2679,7 +2786,7 @@ 

      Submodules
      -CIME.get_tests.get_full_test_names(testargs, machine, compiler)[source]
      +CIME.get_tests.get_full_test_names(testargs, machine, compiler)[source]

      Return full test names in the form: TESTCASE.GRID.COMPSET.MACHINE_COMPILER.TESTMODS Testmods are optional

      @@ -2708,7 +2815,7 @@

      Submodules +CIME.get_tests.get_recommended_test_time(test_full_name)[source]
      >>> get_recommended_test_time("ERS.f19_g16_rx1.A.melvin_gnu")
       '0:10:00'
       
      @@ -2725,24 +2832,24 @@

      Submodules
      -CIME.get_tests.get_test_data(suite)[source]
      -

      For a given suite, returns (inherit, time, share, tests)

      +CIME.get_tests.get_test_data(suite)[source] +

      For a given suite, returns (inherit, time, share, perf, tests)

      -CIME.get_tests.get_test_suite(suite, machine=None, compiler=None, skip_inherit=False, skip_tests=None)[source]
      +CIME.get_tests.get_test_suite(suite, machine=None, compiler=None, skip_inherit=False, skip_tests=None)[source]

      Return a list of FULL test names for a suite.

      -CIME.get_tests.get_test_suites()[source]
      +CIME.get_tests.get_test_suites()[source]
      -CIME.get_tests.infer_arch_from_tests(testargs)[source]
      +CIME.get_tests.infer_arch_from_tests(testargs)[source]

      Return a tuple (machine, [compilers]) that can be inferred from the test args

      >>> infer_arch_from_tests(["NCK.f19_g16_rx1.A.melvin_gnu"])
       ('melvin', ['gnu'])
      @@ -2762,33 +2869,47 @@ 

      Submodules +
      +CIME.get_tests.is_perf_test(test)[source]
      +

      Is the provided test in a suite with perf=True?

      +
      >>> is_perf_test("SMS_P2.T42_T42.S.melvin_gnu")
      +True
      +>>> is_perf_test("SMS_P2.f19_g16_rx1.X.melvin_gnu")
      +False
      +>>> is_perf_test("PFS_P2.f19_g16_rx1.X.melvin_gnu")
      +True
      +
      +
      +

      +
      -CIME.get_tests.key_test_time(test_full_name)[source]
      +CIME.get_tests.key_test_time(test_full_name)[source]
      -CIME.get_tests.suite_has_test(suite, test_full_name, skip_inherit=False)[source]
      +CIME.get_tests.suite_has_test(suite, test_full_name, skip_inherit=False)[source]
      -

      CIME.get_timing module

      +

      CIME.get_timing module

      Library for implementing getTiming tool which gets timing information from a run.

      -CIME.get_timing.get_timing(case, lid)[source]
      +CIME.get_timing.get_timing(case, lid)[source]
      -

      CIME.hist_utils module

      +

      CIME.hist_utils module

      Functions for actions pertaining to history files.

      -CIME.hist_utils.compare_baseline(case, baseline_dir=None, outfile_suffix='')[source]
      +CIME.hist_utils.compare_baseline(case, baseline_dir=None, outfile_suffix='')[source]

      compare the current test output to a baseline result

      case - The case containing the hist files to be compared against baselines baseline_dir - Optionally, specify a specific baseline dir, otherwise it will be computed from case config @@ -2802,7 +2923,7 @@

      Submodules
      -CIME.hist_utils.compare_test(case, suffix1, suffix2, ignore_fieldlist_diffs=False)[source]
      +CIME.hist_utils.compare_test(case, suffix1, suffix2, ignore_fieldlist_diffs=False)[source]

      Compares two sets of component history files in the testcase directory

      case - The case containing the hist files to compare suffix1 - The suffix that identifies the first batch of hist files @@ -2818,7 +2939,7 @@

      Submodules
      -CIME.hist_utils.copy_histfiles(case, suffix, match_suffix=None)[source]
      +CIME.hist_utils.copy_histfiles(case, suffix, match_suffix=None)[source]

      Copy the most recent batch of hist files in a case, adding the given suffix.

      This can allow you to temporarily “save” these files so they won’t be blown away if you re-run the case.

      @@ -2829,7 +2950,7 @@

      Submodules
      -CIME.hist_utils.cprnc(model, file1, file2, case, rundir, multiinst_driver_compare=False, outfile_suffix='', ignore_fieldlist_diffs=False, cprnc_exe=None)[source]
      +CIME.hist_utils.cprnc(model, file1, file2, case, rundir, multiinst_driver_compare=False, outfile_suffix='', ignore_fieldlist_diffs=False, cprnc_exe=None)[source]

      Run cprnc to compare two individual nc files

      file1 - the full or relative path of the first file file2 - the full or relative path of the second file @@ -2853,19 +2974,19 @@

      Submodules
      -CIME.hist_utils.generate_baseline(case, baseline_dir=None, allow_baseline_overwrite=False)[source]
      +CIME.hist_utils.generate_baseline(case, baseline_dir=None, allow_baseline_overwrite=False)[source]

      -CIME.hist_utils.generate_teststatus(testdir, baseline_dir)[source]
      +CIME.hist_utils.generate_teststatus(testdir, baseline_dir)[source]

      CESM stores it’s TestStatus file in baselines. Do not let exceptions escape from this function.

      -CIME.hist_utils.get_ts_synopsis(comments)[source]
      +CIME.hist_utils.get_ts_synopsis(comments)[source]

      Reduce case diff comments down to a single line synopsis so that we can put something in the TestStatus file. It’s expected that the comments provided to this function came from compare_baseline, not compare_tests.

      @@ -2895,7 +3016,7 @@

      Submodules
      -CIME.hist_utils.rename_all_hist_files(case, suffix)[source]
      +CIME.hist_utils.rename_all_hist_files(case, suffix)[source]

      Renaming all hist files in a case, adding the given suffix.

      case - The case containing the files you want to save suffix - The string suffix you want to add to saved files, this can be used to find them later.

      @@ -2903,60 +3024,60 @@

      Submodules -

      CIME.jenkins_generic_job module

      +

      CIME.jenkins_generic_job module

      -CIME.jenkins_generic_job.archive_old_test_data(machine, mach_comp, test_id_root, test_root, old_test_archive, avoid_test_id)[source]
      +CIME.jenkins_generic_job.archive_old_test_data(machine, mach_comp, test_id_root, test_root, old_test_archive, avoid_test_id)[source]
      -CIME.jenkins_generic_job.cleanup_queue(test_root, test_id)[source]
      +CIME.jenkins_generic_job.cleanup_queue(test_root, test_id)[source]

      Delete all jobs left in the queue

      -CIME.jenkins_generic_job.delete_old_test_data(mach_comp, test_id_root, scratch_root, test_root, run_area, build_area, archive_area, avoid_test_id)[source]
      +CIME.jenkins_generic_job.delete_old_test_data(mach_comp, test_id_root, scratch_root, test_root, run_area, build_area, archive_area, avoid_test_id)[source]
      -CIME.jenkins_generic_job.handle_old_test_data(machine, compiler, test_id_root, scratch_root, test_root, avoid_test_id)[source]
      +CIME.jenkins_generic_job.handle_old_test_data(machine, compiler, test_id_root, scratch_root, test_root, avoid_test_id)[source]
      -CIME.jenkins_generic_job.jenkins_generic_job(generate_baselines, submit_to_cdash, no_batch, baseline_name, arg_cdash_build_name, cdash_project, arg_test_suite, cdash_build_group, baseline_compare, scratch_root, parallel_jobs, walltime, machine, compiler, real_baseline_name, baseline_root, update_success, check_throughput, check_memory, ignore_memleak, pes_file, jenkins_id, queue)[source]
      +CIME.jenkins_generic_job.jenkins_generic_job(generate_baselines, submit_to_cdash, no_batch, baseline_name, arg_cdash_build_name, cdash_project, arg_test_suite, cdash_build_group, baseline_compare, scratch_root, parallel_jobs, walltime, machine, compiler, real_baseline_name, baseline_root, update_success, check_throughput, check_memory, ignore_memleak, pes_file, jenkins_id, queue)[source]

      Return True if all tests passed

      -CIME.jenkins_generic_job.scan_for_test_ids(old_test_archive, mach_comp, test_id_root)[source]
      +CIME.jenkins_generic_job.scan_for_test_ids(old_test_archive, mach_comp, test_id_root)[source]

      -

      CIME.locked_files module

      +

      CIME.locked_files module

      -CIME.locked_files.is_locked(filename, caseroot=None)[source]
      +CIME.locked_files.is_locked(filename, caseroot=None)[source]
      -CIME.locked_files.lock_file(filename, caseroot=None, newname=None)[source]
      +CIME.locked_files.lock_file(filename, caseroot=None, newname=None)[source]
      -CIME.locked_files.unlock_file(filename, caseroot=None)[source]
      +CIME.locked_files.unlock_file(filename, caseroot=None)[source]
      -

      CIME.namelist module

      +

      CIME.namelist module

      Module containing tools for dealing with Fortran namelists.

      The public interface consists of the following functions: - character_literal_to_string @@ -3013,7 +3134,7 @@

      Submodules
      -class CIME.namelist.Namelist(groups=None)[source]
      +class CIME.namelist.Namelist(groups=None)[source]

      Bases: object

      Class representing a Fortran namelist.

      Public methods: @@ -3028,12 +3149,12 @@

      Submodules
      -clean_groups()[source]
      +clean_groups()[source]
      -delete_variable(group_name, variable_name)[source]
      +delete_variable(group_name, variable_name)[source]

      Delete a variable from a specified group.

      If the specified group or variable does not exist, this is a no-op.

      >>> x = parse(text='&foo bar=1 /')
      @@ -3050,7 +3171,7 @@ 

      Submodules
      -get_group_names()[source]
      +get_group_names()[source]

      Return a list of all groups in the namelist.

      >>> Namelist().get_group_names()
       []
      @@ -3062,12 +3183,12 @@ 

      Submodules
      -get_group_variables(group_name)[source]
      +get_group_variables(group_name)[source]

      -get_value(variable_name)[source]
      +get_value(variable_name)[source]

      Return the value of a uniquely-named variable.

      This function is similar to get_variable_value, except that it does not require a group_name, and it requires that the variable_name be @@ -3088,7 +3209,7 @@

      Submodules
      -get_variable_names(group_name)[source]
      +get_variable_names(group_name)[source]

      Return a list of all variables in the given namelist group.

      If the specified group is not in the namelist, returns an empty list.

      >>> Namelist().get_variable_names('foo')
      @@ -3108,7 +3229,7 @@ 

      Submodules
      -get_variable_value(group_name, variable_name)[source]
      +get_variable_value(group_name, variable_name)[source]

      Return the value of the specified variable.

      This function always returns a non-empty list containing strings. If the specified group_name or variable_name is not present, [‘’] is @@ -3125,7 +3246,7 @@

      Submodules
      -merge_nl(other, overwrite=False)[source]
      +merge_nl(other, overwrite=False)[source]

      Merge this namelist object with another.

      Values in the invoking (self) Namelist will take precedence over values in the other Namelist, unless overwrite=True is passed in, @@ -3176,7 +3297,7 @@

      Submodules
      -set_variable_value(group_name, variable_name, value, var_size=1)[source]
      +set_variable_value(group_name, variable_name, value, var_size=1)[source]

      Set the value of the specified variable.

      >>> x = parse(text='&foo bar=1 /')
       >>> x.get_variable_value('foo', 'bar')
      @@ -3205,7 +3326,7 @@ 

      Submodules
      -write(out_file, groups=None, append=False, format_='nml', sorted_groups=True)[source]
      +write(out_file, groups=None, append=False, format_='nml', sorted_groups=True)[source]

      Write a the output data (normally fortran namelist) to the out_file

      As with parse, the out_file argument can be either a file name, or a file object with a write method that accepts unicode. If specified, @@ -3220,7 +3341,7 @@

      Submodules
      -write_nuopc(out_file, groups=None, sorted_groups=True)[source]
      +write_nuopc(out_file, groups=None, sorted_groups=True)[source]

      Write a nuopc config file out_file

      As with parse, the out_file argument can be either a file name, or a file object with a write method that accepts unicode. If specified, @@ -3231,7 +3352,7 @@

      Submodules
      -CIME.namelist.character_literal_to_string(literal)[source]
      +CIME.namelist.character_literal_to_string(literal)[source]

      Convert a Fortran character literal to a Python string.

      This function assumes (without checking) that literal is a valid literal.

      >>> character_literal_to_string("'blah'")
      @@ -3248,7 +3369,7 @@ 

      Submodules
      -CIME.namelist.compress_literal_list(literals)[source]
      +CIME.namelist.compress_literal_list(literals)[source]

      Uses repetition syntax to shorten a literal list.

      >>> compress_literal_list([])
       []
      @@ -3264,7 +3385,7 @@ 

      Submodules
      -CIME.namelist.expand_literal_list(literals)[source]
      +CIME.namelist.expand_literal_list(literals)[source]

      Expands a list of literal values to get rid of repetition syntax.

      >>> expand_literal_list([])
       []
      @@ -3280,7 +3401,7 @@ 

      Submodules
      -CIME.namelist.fortran_namelist_base_value(string)[source]
      +CIME.namelist.fortran_namelist_base_value(string)[source]

      Strip off whitespace and repetition syntax from a namelist value.

      >>> fortran_namelist_base_value("")
       ''
      @@ -3300,7 +3421,7 @@ 

      Submodules
      -CIME.namelist.get_fortran_name_only(full_var)[source]
      +CIME.namelist.get_fortran_name_only(full_var)[source]

      remove array section if any and return only the variable name >>> get_fortran_name_only(‘foo’) ‘foo’ @@ -3320,7 +3441,7 @@

      Submodules
      -CIME.namelist.get_fortran_variable_indices(varname, varlen=1, allow_any_len=False)[source]
      +CIME.namelist.get_fortran_variable_indices(varname, varlen=1, allow_any_len=False)[source]

      get indices from a fortran namelist variable as a triplet of minindex, maxindex and step

      >>> get_fortran_variable_indices('foo(3)')
       (3, 3, 1)
      @@ -3338,7 +3459,7 @@ 

      Submodules
      -CIME.namelist.is_valid_fortran_name(string)[source]
      +CIME.namelist.is_valid_fortran_name(string)[source]

      Check that a variable name is allowed in Fortran.

      The rules are: 1. The name must start with a letter. @@ -3383,7 +3504,7 @@

      Submodules
      -CIME.namelist.is_valid_fortran_namelist_literal(type_, string)[source]
      +CIME.namelist.is_valid_fortran_namelist_literal(type_, string)[source]

      Determine whether a literal is valid in a Fortran namelist.

      Note that kind parameters are not allowed in namelists, which simplifies this check a bit. Internal whitespace is allowed for complex and character @@ -3638,7 +3759,7 @@

      Submodules
      -CIME.namelist.literal_to_python_value(literal, type_=None)[source]
      +CIME.namelist.literal_to_python_value(literal, type_=None)[source]

      Convert a Fortran literal string to a Python value.

      This function assumes that the input contains a single value, i.e. repetition syntax is not used. The type can be specified by passing a string @@ -3698,7 +3819,7 @@

      Submodules
      -CIME.namelist.merge_literal_lists(default, overwrite)[source]
      +CIME.namelist.merge_literal_lists(default, overwrite)[source]

      Merge two lists of literal value strings.

      The overwrite values have higher precedence, so will overwrite the default values. However, if overwrite contains null values, or is @@ -3726,7 +3847,7 @@

      Submodules
      -CIME.namelist.parse(in_file=None, text=None, groupless=False, convert_tab_to_space=True)[source]
      +CIME.namelist.parse(in_file=None, text=None, groupless=False, convert_tab_to_space=True)[source]

      Parse a Fortran namelist.

      The in_file argument must be either a str or unicode object containing @@ -3763,14 +3884,14 @@

      Submodules
      -CIME.namelist.shouldRaise(eclass, method, *args, **kw)[source]
      +CIME.namelist.shouldRaise(eclass, method, *args, **kw)[source]

      A helper function to make doctests py3 compatible http://python3porting.com/problems.html#running-doctests

      -CIME.namelist.string_to_character_literal(string)[source]
      +CIME.namelist.string_to_character_literal(string)[source]

      Convert a Python string to a Fortran character literal.

      This function always uses double quotes (”) as the delimiter.

      >>> string_to_character_literal('blah')
      @@ -3785,16 +3906,16 @@ 

      Submodules -

      CIME.nmlgen module

      +

      CIME.nmlgen module

      Class for generating component namelists.

      -class CIME.nmlgen.NamelistGenerator(case, definition_files, files=None)[source]
      +class CIME.nmlgen.NamelistGenerator(case, definition_files, files=None)[source]

      Bases: object

      Utility class for generating namelists for a given component.

      -add_default(name, value=None, ignore_abs_path=None)[source]
      +add_default(name, value=None, ignore_abs_path=None)[source]

      Add a value for the specified variable to the namelist.

      If the specified variable is already defined in the object, the existing value is preserved. Otherwise, the value argument, if provided, will @@ -3807,7 +3928,7 @@

      Submodules
      -add_defaults_for_group(group)[source]
      +add_defaults_for_group(group)[source]

      Call add_default for namelist variables in the given group

      This still skips variables that have attributes of skip_default_entry or per_stream_entry.

      @@ -3817,18 +3938,18 @@

      Submodules
      -add_nmlcontents(filename, group, append=True, format_='nmlcontents', sorted_groups=True)[source]
      +add_nmlcontents(filename, group, append=True, format_='nmlcontents', sorted_groups=True)[source]

      Write only contents of nml group

      -clean_streams()[source]
      +clean_streams()[source]
      -confirm_group_is_empty(group_name, errmsg)[source]
      +confirm_group_is_empty(group_name, errmsg)[source]

      Confirms that no values have been added to the given group

      If any values HAVE been added to this group, aborts with the given error message.

      This is often paired with use of skip_default_for_groups in the init_defaults call @@ -3848,13 +3969,13 @@

      Submodules
      -create_shr_strdata_nml()[source]
      +create_shr_strdata_nml()[source]

      Set defaults for shr_strdata_nml variables other than the variable domainfile

      -create_stream_file_and_update_shr_strdata_nml(config, caseroot, stream, stream_path, data_list_path)[source]
      +create_stream_file_and_update_shr_strdata_nml(config, caseroot, stream, stream_path, data_list_path)[source]

      Write the pseudo-XML file corresponding to a given stream.

      Arguments: config - Used to look up namelist defaults. This is used in addition

      @@ -3870,7 +3991,7 @@

      Submodules
      -get_default(name, config=None, allow_none=False)[source]
      +get_default(name, config=None, allow_none=False)[source]

      Get the value of a variable from the namelist definition file.

      The config argument is passed through to the underlying NamelistDefaults.get_value call as the attribute argument.

      @@ -3903,18 +4024,18 @@

      Submodules
      -get_group_variables(group_name)[source]
      +get_group_variables(group_name)[source]

      -get_streams()[source]
      +get_streams()[source]

      Get a list of all streams used for the current data model mode.

      -get_value(name)[source]
      +get_value(name)[source]

      Get the current value of a given namelist variable.

      Note that the return value of this function is always a string or a list of strings. E.g. the scalar logical value .false. will be returned as @@ -3931,7 +4052,7 @@

      Submodules
      -init_defaults(infiles, config, skip_groups=None, skip_entry_loop=False, skip_default_for_groups=None, set_group_name=None)[source]
      +init_defaults(infiles, config, skip_groups=None, skip_entry_loop=False, skip_default_for_groups=None, set_group_name=None)[source]

      Return array of names of all definition nodes

      infiles should be a list of file paths, each one giving namelist settings that take precedence over the default values. Often there will be only one file in this @@ -3944,33 +4065,33 @@

      Submodules
      -new_instance()[source]
      +new_instance()[source]

      Clean the object just enough to introduce a new instance

      -static quote_string(string)[source]
      +static quote_string(string)[source]

      Convert a string to a quoted Fortran literal.

      Does nothing if the string appears to be quoted already.

      -rename_group(group, newgroup)[source]
      +rename_group(group, newgroup)[source]

      Pass through to namelist definition

      -set_abs_file_path(file_path)[source]
      +set_abs_file_path(file_path)[source]

      If file_path is relative, make it absolute using DIN_LOC_ROOT.

      If an absolute path is input, it is returned unchanged.

      -set_value(name, value)[source]
      +set_value(name, value)[source]

      Set the current value of a given namelist variable.

      Usually, you should use add_default instead of this function.

      The name argument is the name of the variable to set, and the value @@ -3987,7 +4108,7 @@

      Submodules
      -update_shr_strdata_nml(config, stream, stream_path)[source]
      +update_shr_strdata_nml(config, stream, stream_path)[source]

      Updates values for the shr_strdata_nml namelist group.

      This should be done once per stream, and it shouldn’t usually be called directly, since create_stream_file calls this method itself.

      @@ -3995,25 +4116,25 @@

      Submodules
      -write_modelio_file(filename)[source]
      +write_modelio_file(filename)[source]

      Write mct component modelio files

      -write_nuopc_config_file(filename, data_list_path=None, sorted_groups=False)[source]
      +write_nuopc_config_file(filename, data_list_path=None, sorted_groups=False)[source]

      Write the nuopc config file

      -write_nuopc_modelio_file(filename)[source]
      +write_nuopc_modelio_file(filename)[source]

      Write nuopc component modelio files

      -write_output_file(namelist_file, data_list_path=None, groups=None, sorted_groups=True)[source]
      +write_output_file(namelist_file, data_list_path=None, groups=None, sorted_groups=True)[source]

      Write out the namelists and input data files.

      The namelist_file and modelio_file are the locations to which the component and modelio namelists will be written, respectively. The @@ -4023,7 +4144,7 @@

      Submodules
      -write_seq_maps(filename)[source]
      +write_seq_maps(filename)[source]

      Write mct out seq_maps.rc

      @@ -4031,56 +4152,56 @@

      Submodules -

      CIME.provenance module

      +

      CIME.provenance module

      Library for saving build/run provenance.

      +CIME.provenance.get_recommended_test_time_based_on_past(baseline_root, test, raw=False)[source]
      -CIME.provenance.get_test_success(baseline_root, src_root, test, testing=False)[source]
      +CIME.provenance.get_test_success(baseline_root, src_root, test, testing=False)[source]

      Returns (was prev run success, commit when test last passed, commit when test last transitioned from pass to fail)

      Unknown history is expressed as None

      -CIME.provenance.save_test_success(baseline_root, src_root, test, succeeded, force_commit_test=None)[source]
      +CIME.provenance.save_test_success(baseline_root, src_root, test, succeeded, force_commit_test=None)[source]

      Update success data accordingly based on succeeded flag

      -CIME.provenance.save_test_time(baseline_root, test, time_seconds, commit)[source]
      +CIME.provenance.save_test_time(baseline_root, test, time_seconds, commit)[source]

      -

      CIME.simple_compare module

      +

      CIME.simple_compare module

      -CIME.simple_compare.compare_files(gold_file, compare_file, case=None)[source]
      +CIME.simple_compare.compare_files(gold_file, compare_file, case=None)[source]

      Returns true if files are the same, comments are returned too: (success, comments)

      -CIME.simple_compare.compare_runconfigfiles(gold_file, compare_file, case=None)[source]
      +CIME.simple_compare.compare_runconfigfiles(gold_file, compare_file, case=None)[source]

      Returns true if files are the same, comments are returned too: (success, comments)

      -CIME.simple_compare.findDiff(d1, d2, path='', case=None)[source]
      +CIME.simple_compare.findDiff(d1, d2, path='', case=None)[source]
      -

      CIME.test_scheduler module

      +

      CIME.test_scheduler module

      A library for scheduling/running through the phases of a set of system tests. Supports phase-level parallelism (can make progres on multiple system tests at once).

      @@ -4089,16 +4210,16 @@

      Submodules
      -class CIME.test_scheduler.TestScheduler(test_names, test_data=None, no_run=False, no_build=False, no_setup=False, no_batch=None, test_root=None, test_id=None, machine_name=None, compiler=None, baseline_root=None, baseline_cmp_name=None, baseline_gen_name=None, clean=False, namelists_only=False, project=None, parallel_jobs=None, walltime=None, proc_pool=None, use_existing=False, save_timing=False, queue=None, allow_baseline_overwrite=False, output_root=None, force_procs=None, force_threads=None, mpilib=None, input_dir=None, pesfile=None, run_count=0, mail_user=None, mail_type=None, allow_pnl=False, non_local=False, single_exe=False, workflow=None, chksum=False, force_rebuild=False)[source]
      +class CIME.test_scheduler.TestScheduler(test_names, test_data=None, no_run=False, no_build=False, no_setup=False, no_batch=None, test_root=None, test_id=None, machine_name=None, compiler=None, baseline_root=None, baseline_cmp_name=None, baseline_gen_name=None, clean=False, namelists_only=False, project=None, parallel_jobs=None, walltime=None, proc_pool=None, use_existing=False, save_timing=False, queue=None, allow_baseline_overwrite=False, output_root=None, force_procs=None, force_threads=None, mpilib=None, input_dir=None, pesfile=None, run_count=0, mail_user=None, mail_type=None, allow_pnl=False, non_local=False, single_exe=False, workflow=None, chksum=False, force_rebuild=False)[source]

      Bases: object

      -get_testnames()[source]
      +get_testnames()[source]
      -run_tests(wait=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False)[source]
      +run_tests(wait=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False)[source]

      Main API for this class.

      Return True if all tests passed.

      @@ -4107,7 +4228,7 @@

      Submodules -

      CIME.test_status module

      +

      CIME.test_status module

      Contains the crucial TestStatus class which manages phase-state of a test case and ensure that this state is represented by the TestStatus file in the case.

      @@ -4136,36 +4257,36 @@

      Submodules
      -class CIME.test_status.TestStatus(test_dir=None, test_name=None, no_io=False)[source]
      +class CIME.test_status.TestStatus(test_dir=None, test_name=None, no_io=False)[source]

      Bases: object

      -current_is(phase, status)[source]
      +current_is(phase, status)[source]
      -flush()[source]
      +flush()[source]
      -get_comment(phase)[source]
      +get_comment(phase)[source]
      -get_latest_phase()[source]
      +get_latest_phase()[source]
      -get_name()[source]
      +get_name()[source]
      -get_overall_test_status(wait_for_run=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False, no_run=False)[source]
      +get_overall_test_status(wait_for_run=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False, no_run=False)[source]

      Given the current phases and statuses, produce a single results for this test. Preference is given to PEND since we don’t want to stop waiting for a test that hasn’t finished. Namelist diffs are given the lowest precedence.

      @@ -4180,7 +4301,9 @@

      Submodules>>> _test_helper2('PASS ERS.foo.A RUN\nFAIL ERS.foo.A TPUTCOMP') ('PASS', 'RUN') >>> _test_helper2('PASS ERS.foo.A RUN\nFAIL ERS.foo.A TPUTCOMP', check_throughput=True) -('FAIL', 'TPUTCOMP') +('DIFF', 'TPUTCOMP') +>>> _test_helper2('PASS ERS.foo.A RUN\nFAIL ERS.foo.A MEMCOMP', check_memory=True) +('DIFF', 'MEMCOMP') >>> _test_helper2('PASS ERS.foo.A MODEL_BUILD\nPASS ERS.foo.A RUN\nFAIL ERS.foo.A NLCOMP') ('NLFAIL', 'RUN') >>> _test_helper2('PASS ERS.foo.A MODEL_BUILD\nPEND ERS.foo.A RUN\nFAIL ERS.foo.A NLCOMP') @@ -4249,12 +4372,12 @@

      Submodules
      -get_status(phase)[source]
      +get_status(phase)[source]

      -increment_non_pass_counts(non_pass_counts)[source]
      +increment_non_pass_counts(non_pass_counts)[source]

      Increment counts of the number of times given phases did not pass

      non_pass_counts is a dictionary whose keys are phases of interest and whose values are running counts of the number of @@ -4264,7 +4387,7 @@

      Submodules
      -phase_statuses_dump(prefix='', skip_passes=False, skip_phase_list=None, xfails=None)[source]
      +phase_statuses_dump(prefix='', skip_passes=False, skip_phase_list=None, xfails=None)[source]
      Args:

      prefix: string printed at the start of each line skip_passes: if True, do not output lines that have a PASS status @@ -4279,7 +4402,7 @@

      Submodules
      -set_status(phase, status, comments='')[source]
      +set_status(phase, status, comments='')[source]

      Update the status of this test by changing the status of given phase to the given status.

      >>> with TestStatus(test_dir="/", test_name="ERS.foo.A", no_io=True) as ts:
      @@ -4318,23 +4441,23 @@ 

      Submodules -

      CIME.test_utils module

      +

      CIME.test_utils module

      Utility functions used in test_scheduler.py, and by other utilities that need to get test lists.

      -CIME.test_utils.get_test_status_files(test_root, compiler, test_id=None)[source]
      +CIME.test_utils.get_test_status_files(test_root, compiler, test_id=None)[source]
      -CIME.test_utils.get_tests_from_xml(xml_machine=None, xml_category=None, xml_compiler=None, xml_testlist=None, machine=None, compiler=None, driver=None)[source]
      +CIME.test_utils.get_tests_from_xml(xml_machine=None, xml_category=None, xml_compiler=None, xml_testlist=None, machine=None, compiler=None, driver=None)[source]

      Parse testlists for a list of tests

      -CIME.test_utils.test_to_string(test, category_field_width=0, test_field_width=0, show_options=False)[source]
      +CIME.test_utils.test_to_string(test, category_field_width=0, test_field_width=0, show_options=False)[source]

      Given a test dictionary, return a string representation suitable for printing

      Args:
      @@ -4369,11 +4492,11 @@

      Submodules -

      CIME.user_mod_support module

      +

      CIME.user_mod_support module

      user_mod_support.py

      -CIME.user_mod_support.apply_user_mods(caseroot, user_mods_path, keepexe=None)[source]
      +CIME.user_mod_support.apply_user_mods(caseroot, user_mods_path, keepexe=None)[source]

      Recursivlely apply user_mods to caseroot - this includes updating user_nl_xxx, updating SourceMods and creating case shell_commands and xmlchange_cmds files

      First remove case shell_commands files if any already exist

      @@ -4385,7 +4508,7 @@

      Submodules
      -CIME.user_mod_support.build_include_dirs_list(user_mods_path, include_dirs=None)[source]
      +CIME.user_mod_support.build_include_dirs_list(user_mods_path, include_dirs=None)[source]

      If user_mods_path has a file “include_user_mods” read that file and add directories to the include_dirs, recursively check each of those directories for further directories. @@ -4394,18 +4517,18 @@

      Submodules -

      CIME.utils module

      +

      CIME.utils module

      Common functions used by cime python scripts Warning: you cannot use CIME Classes in this module as it causes circular dependencies

      -exception CIME.utils.CIMEError[source]
      +exception CIME.utils.CIMEError[source]

      Bases: SystemExit, Exception

      -class CIME.utils.EnvironmentContext(**kwargs)[source]
      +class CIME.utils.EnvironmentContext(**kwargs)[source]

      Bases: object

      Context manager for environment variables Usage:

      @@ -4424,11 +4547,11 @@

      Submodules
      -class CIME.utils.IndentFormatter(indent, fmt=None, datefmt=None)[source]
      +class CIME.utils.IndentFormatter(indent, fmt=None, datefmt=None)[source]

      Bases: Formatter

      -format(record)[source]
      +format(record)[source]

      Format the specified record as text.

      The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. @@ -4444,58 +4567,76 @@

      Submodules
      -class CIME.utils.SharedArea(new_perms=2)[source]
      +class CIME.utils.SharedArea(new_perms=2)[source]

      Bases: object

      Enable 0002 umask within this manager

      -class CIME.utils.Timeout(seconds, action=None)[source]
      +class CIME.utils.Timeout(seconds, action=None)[source]

      Bases: object

      A context manager that implements a timeout. By default, it will raise exception, but a custon function call can be provided. Provided None as seconds makes this class a no-op

      +
      +
      +CIME.utils.add_flag_to_cmd(flag, val)[source]
      +

      Given a flag and value for a shell command, return a string

      +
      >>> add_flag_to_cmd("-f", "hi")
      +'-f hi'
      +>>> add_flag_to_cmd("--foo", 42)
      +'--foo 42'
      +>>> add_flag_to_cmd("--foo=", 42)
      +'--foo=42'
      +>>> add_flag_to_cmd("--foo:", 42)
      +'--foo:42'
      +>>> add_flag_to_cmd("--foo:", " hi ")
      +'--foo:hi'
      +
      +
      +
      +
      -CIME.utils.add_mail_type_args(parser)[source]
      +CIME.utils.add_mail_type_args(parser)[source]
      -CIME.utils.analyze_build_log(comp, log, compiler)[source]
      +CIME.utils.analyze_build_log(comp, log, compiler)[source]

      Capture and report warning count, capture and report errors and undefined references.

      -CIME.utils.append_case_status(phase, status, msg=None, caseroot='.')[source]
      +CIME.utils.append_case_status(phase, status, msg=None, caseroot='.')[source]

      Update CaseStatus file

      -CIME.utils.append_status(msg, sfile, caseroot='.')[source]
      +CIME.utils.append_status(msg, sfile, caseroot='.')[source]

      Append msg to sfile in caseroot

      -CIME.utils.append_testlog(msg, caseroot='.')[source]
      +CIME.utils.append_testlog(msg, caseroot='.')[source]

      Add to TestStatus.log file

      -CIME.utils.batch_jobid(case=None)[source]
      +CIME.utils.batch_jobid(case=None)[source]
      -CIME.utils.check_name(fullname, additional_chars=None, fullpath=False)[source]
      +CIME.utils.check_name(fullname, additional_chars=None, fullpath=False)[source]

      check for unallowed characters in name, this routine only checks the final name and does not check if path exists or is writable

      @@ -4519,12 +4660,12 @@

      Submodules
      -CIME.utils.clear_folder(_dir)[source]
      +CIME.utils.clear_folder(_dir)[source]

      -CIME.utils.compute_total_time(job_cost_map, proc_pool)[source]
      +CIME.utils.compute_total_time(job_cost_map, proc_pool)[source]

      Given a map: jobname -> (procs, est-time), return a total time estimate for a given processor pool size

      >>> job_cost_map = {"A" : (4, 3000), "B" : (2, 1000), "C" : (8, 2000), "D" : (1, 800)}
      @@ -4540,12 +4681,12 @@ 

      Submodules
      -CIME.utils.configure_logging(verbose, debug, silent)[source]
      +CIME.utils.configure_logging(verbose, debug, silent)[source]

      -CIME.utils.convert_to_babylonian_time(seconds)[source]
      +CIME.utils.convert_to_babylonian_time(seconds)[source]

      Convert time value to seconds to HH:MM:SS

      >>> convert_to_babylonian_time(3661)
       '01:01:01'
      @@ -4557,7 +4698,7 @@ 

      Submodules
      -CIME.utils.convert_to_seconds(time_str)[source]
      +CIME.utils.convert_to_seconds(time_str)[source]

      Convert time value in [[HH:]MM:]SS to seconds

      We assume that XX:YY is likely to be HH:MM, not MM:SS

      >>> convert_to_seconds("42")
      @@ -4572,7 +4713,7 @@ 

      Submodules
      -CIME.utils.convert_to_string(value, type_str=None, vid='')[source]
      +CIME.utils.convert_to_string(value, type_str=None, vid='')[source]

      Convert value back to string. vid is only for generating better error messages. >>> convert_to_string(6, type_str=”integer”) == ‘6’ @@ -4587,20 +4728,20 @@

      Submodules
      -CIME.utils.convert_to_type(value, type_str, vid='')[source]
      +CIME.utils.convert_to_type(value, type_str, vid='')[source]

      Convert value from string to another type. vid is only for generating better error messages.

      -CIME.utils.convert_to_unknown_type(value)[source]
      +CIME.utils.convert_to_unknown_type(value)[source]

      Convert value to it’s real type by probing conversions.

      -CIME.utils.copy_globs(globs_to_copy, output_directory, lid=None)[source]
      +CIME.utils.copy_globs(globs_to_copy, output_directory, lid=None)[source]

      Takes a list of globs and copies all files to output_directory.

      Hiddens files become unhidden i.e. removing starting dot.

      Output filename is derviced from the basename of the input path and can @@ -4609,7 +4750,7 @@

      Submodules
      -CIME.utils.copy_local_macros_to_dir(destination, extra_machdir=None)[source]
      +CIME.utils.copy_local_macros_to_dir(destination, extra_machdir=None)[source]

      Copy any local macros files to the path given by ‘destination’.

      Local macros files are potentially found in: (1) extra_machdir/cmake_macros/.cmake @@ -4618,24 +4759,24 @@

      Submodules
      -CIME.utils.copyifnewer(src, dest)[source]
      +CIME.utils.copyifnewer(src, dest)[source]

      if dest does not exist or is older than src copy src to dest

      -CIME.utils.deprecate_action(message)[source]
      +CIME.utils.deprecate_action(message)[source]
      -CIME.utils.does_file_have_string(filepath, text)[source]
      +CIME.utils.does_file_have_string(filepath, text)[source]

      Does the text string appear in the filepath file

      -CIME.utils.expect(condition, error_msg, exc_type=<class 'CIME.utils.CIMEError'>, error_prefix='ERROR:')[source]
      +CIME.utils.expect(condition, error_msg, exc_type=<class 'CIME.utils.CIMEError'>, error_prefix='ERROR:')[source]

      Similar to assert except doesn’t generate an ugly stacktrace. Useful for checking user error, not programming error.

      >>> expect(True, "error1")
      @@ -4649,32 +4790,32 @@ 

      Submodules
      -CIME.utils.file_contains_python_function(filepath, funcname)[source]
      +CIME.utils.file_contains_python_function(filepath, funcname)[source]

      Checks whether the given file contains a top-level definition of the function ‘funcname’

      Returns a boolean value (True if the file contains this function definition, False otherwise)

      -CIME.utils.filter_unicode(unistr)[source]
      +CIME.utils.filter_unicode(unistr)[source]

      Sometimes unicode chars can cause problems

      -CIME.utils.find_files(rootdir, pattern)[source]
      +CIME.utils.find_files(rootdir, pattern)[source]

      recursively find all files matching a pattern

      -CIME.utils.find_proc_id(proc_name=None, children_only=False, of_parent=None)[source]
      +CIME.utils.find_proc_id(proc_name=None, children_only=False, of_parent=None)[source]

      Children implies recursive.

      -CIME.utils.find_system_test(testname, case)[source]
      +CIME.utils.find_system_test(testname, case)[source]

      Find and import the test matching testname Look through the paths set in config_files.xml variable SYSTEM_TESTS_DIR for components used in this case to find a test matching testname. Add the @@ -4684,12 +4825,12 @@

      Submodules
      -CIME.utils.fixup_sys_path(*additional_paths)[source]
      +CIME.utils.fixup_sys_path(*additional_paths)[source]

      -CIME.utils.format_time(time_format, input_format, input_time)[source]
      +CIME.utils.format_time(time_format, input_format, input_time)[source]

      Converts the string input_time from input_format to time_format Valid format specifiers are “%H”, “%M”, and “%S” % signs must be followed by an H, M, or S and then a separator @@ -4710,17 +4851,17 @@

      Submodules
      -CIME.utils.get_all_cime_models()[source]
      +CIME.utils.get_all_cime_models()[source]

      -CIME.utils.get_batch_script_for_job(job)[source]
      +CIME.utils.get_batch_script_for_job(job)[source]
      -CIME.utils.get_charge_account(machobj=None, project=None)[source]
      +CIME.utils.get_charge_account(machobj=None, project=None)[source]

      Hierarchy for choosing CHARGE_ACCOUNT: 1. Environment variable CHARGE_ACCOUNT 2. File $HOME/.cime/config @@ -4743,28 +4884,28 @@

      Submodules
      -CIME.utils.get_cime_config()[source]
      +CIME.utils.get_cime_config()[source]

      -CIME.utils.get_cime_default_driver()[source]
      +CIME.utils.get_cime_default_driver()[source]
      -CIME.utils.get_cime_root(case=None)[source]
      +CIME.utils.get_cime_root(case=None)[source]

      Return the absolute path to the root of CIME that contains this script

      -CIME.utils.get_config_path()[source]
      +CIME.utils.get_config_path()[source]
      -CIME.utils.get_current_branch(repo=None)[source]
      +CIME.utils.get_current_branch(repo=None)[source]

      Return the name of the current branch for a repository

      >>> if "GIT_BRANCH" in os.environ:
       ...     get_current_branch() is not None
      @@ -4778,7 +4919,7 @@ 

      Submodules
      -CIME.utils.get_current_commit(short=False, repo=None, tag=False)[source]
      +CIME.utils.get_current_commit(short=False, repo=None, tag=False)[source]

      Return the sha1 of the current HEAD commit

      >>> get_current_commit() is not None
       True
      @@ -4788,7 +4929,7 @@ 

      Submodules
      -CIME.utils.get_current_submodule_status(recursive=False, repo=None)[source]
      +CIME.utils.get_current_submodule_status(recursive=False, repo=None)[source]

      Return the sha1s of the current currently checked out commit for each submodule, along with the submodule path and the output of git describe for the SHA-1.

      >>> get_current_submodule_status() is not None
      @@ -4799,7 +4940,7 @@ 

      Submodules
      -CIME.utils.get_full_test_name(partial_test, caseopts=None, grid=None, compset=None, machine=None, compiler=None, testmods_list=None, testmods_string=None)[source]
      +CIME.utils.get_full_test_name(partial_test, caseopts=None, grid=None, compset=None, machine=None, compiler=None, testmods_list=None, testmods_string=None)[source]

      Given a partial CIME test name, return in form TESTCASE.GRID.COMPSET.MACHINE_COMPILER[.TESTMODS] Use the additional args to fill out the name if needed

      Testmods can be provided through one of two arguments, but not both: @@ -4847,7 +4988,7 @@

      Submodules
      -CIME.utils.get_htmlroot(machobj=None)[source]
      +CIME.utils.get_htmlroot(machobj=None)[source]

      Get location for test HTML output

      Hierarchy for choosing CIME_HTML_ROOT: 0. Environment variable CIME_HTML_ROOT @@ -4857,19 +4998,19 @@

      Submodules
      -CIME.utils.get_lids(case)[source]
      +CIME.utils.get_lids(case)[source]

      -CIME.utils.get_logging_options()[source]
      +CIME.utils.get_logging_options()[source]

      Use to pass same logging options as was used for current executable to subprocesses.

      -CIME.utils.get_model()[source]
      +CIME.utils.get_model()[source]

      Get the currently configured model value The CIME_MODEL env variable may or may not be set

      >>> os.environ["CIME_MODEL"] = "garbage"
      @@ -4892,12 +5033,12 @@ 

      Submodules
      -CIME.utils.get_model_config_location_within_cime(model=None)[source]
      +CIME.utils.get_model_config_location_within_cime(model=None)[source]

      -CIME.utils.get_model_config_root(model=None)[source]
      +CIME.utils.get_model_config_root(model=None)[source]

      Get absolute path to model config area”

      >>> os.environ["CIME_MODEL"] = "e3sm" # Set the test up don't depend on external resources
       >>> os.path.isdir(get_model_config_root())
      @@ -4908,7 +5049,7 @@ 

      Submodules
      -CIME.utils.get_project(machobj=None)[source]
      +CIME.utils.get_project(machobj=None)[source]

      Hierarchy for choosing PROJECT: 0. Command line flag to create_newcase or create_test 1. Environment variable PROJECT @@ -4920,18 +5061,18 @@

      Submodules
      -CIME.utils.get_python_libs_location_within_cime()[source]
      +CIME.utils.get_python_libs_location_within_cime()[source]

      From within CIME, return subdirectory of python libraries

      -CIME.utils.get_schema_path()[source]
      +CIME.utils.get_schema_path()[source]
      -CIME.utils.get_scripts_root()[source]
      +CIME.utils.get_scripts_root()[source]

      Get absolute path to scripts

      >>> os.path.isdir(get_scripts_root())
       True
      @@ -4941,41 +5082,41 @@ 

      Submodules
      -CIME.utils.get_src_root()[source]
      +CIME.utils.get_src_root()[source]

      Return the absolute path to the root of SRCROOT.

      -CIME.utils.get_template_path()[source]
      +CIME.utils.get_template_path()[source]
      -CIME.utils.get_time_in_seconds(timeval, unit)[source]
      +CIME.utils.get_time_in_seconds(timeval, unit)[source]

      Convert a time from ‘unit’ to seconds

      -CIME.utils.get_timestamp(timestamp_format='%Y%m%d_%H%M%S', utc_time=False)[source]
      +CIME.utils.get_timestamp(timestamp_format='%Y%m%d_%H%M%S', utc_time=False)[source]

      Get a string representing the current UTC time in format: YYYYMMDD_HHMMSS

      The format can be changed if needed.

      -CIME.utils.get_tools_path()[source]
      +CIME.utils.get_tools_path()[source]
      -CIME.utils.get_umask()[source]
      +CIME.utils.get_umask()[source]
      -CIME.utils.get_urlroot(machobj=None)[source]
      +CIME.utils.get_urlroot(machobj=None)[source]

      Get URL to htmlroot

      Hierarchy for choosing CIME_URL_ROOT: 0. Environment variable CIME_URL_ROOT @@ -4985,12 +5126,12 @@

      Submodules
      -CIME.utils.gunzip_existing_file(filepath)[source]
      +CIME.utils.gunzip_existing_file(filepath)[source]

      -CIME.utils.gzip_existing_file(filepath)[source]
      +CIME.utils.gzip_existing_file(filepath)[source]

      Gzips an existing file, removes the unzipped version, returns path to zip file. Note the that the timestamp of the original file will be maintained in the zipped file.

      @@ -5008,22 +5149,22 @@

      Submodules
      -CIME.utils.id_generator(size=6, chars='abcdefghijklmnopqrstuvwxyz0123456789')[source]
      +CIME.utils.id_generator(size=6, chars='abcdefghijklmnopqrstuvwxyz0123456789')[source]

      -CIME.utils.import_and_run_sub_or_cmd(cmd, cmdargs, subname, subargs, config_dir, compname, logfile=None, case=None, from_dir=None, timeout=None)[source]
      +CIME.utils.import_and_run_sub_or_cmd(cmd, cmdargs, subname, subargs, config_dir, compname, logfile=None, case=None, from_dir=None, timeout=None)[source]
      -CIME.utils.import_from_file(name, file_path)[source]
      +CIME.utils.import_from_file(name, file_path)[source]
      -CIME.utils.indent_string(the_string, indent_level)[source]
      +CIME.utils.indent_string(the_string, indent_level)[source]

      Indents the given string by a given number of spaces

      Args:

      the_string: str @@ -5037,42 +5178,42 @@

      Submodules
      -CIME.utils.is_last_process_complete(filepath, expect_text, fail_text)[source]
      +CIME.utils.is_last_process_complete(filepath, expect_text, fail_text)[source]

      Search the filepath in reverse order looking for expect_text before finding fail_text. This utility is used by archive_metadata.

      -CIME.utils.is_python_executable(filepath)[source]
      +CIME.utils.is_python_executable(filepath)[source]
      -CIME.utils.ls_sorted_by_mtime(path)[source]
      +CIME.utils.ls_sorted_by_mtime(path)[source]

      return list of path sorted by timestamp oldest first

      -CIME.utils.match_any(item, re_counts)[source]
      +CIME.utils.match_any(item, re_counts)[source]

      Return true if item matches any regex in re_counts’ keys. Increments count if a match was found.

      -CIME.utils.model_log(model, arg_logger, msg, debug_others=True)[source]
      +CIME.utils.model_log(model, arg_logger, msg, debug_others=True)[source]
      -CIME.utils.new_lid(case=None)[source]
      +CIME.utils.new_lid(case=None)[source]
      -CIME.utils.normalize_case_id(case_id)[source]
      +CIME.utils.normalize_case_id(case_id)[source]

      Given a case_id, return it in form TESTCASE.GRID.COMPSET.PLATFORM

      >>> normalize_case_id('ERT.ne16_g37.B1850C5.sandiatoss3_intel')
       'ERT.ne16_g37.B1850C5.sandiatoss3_intel'
      @@ -5088,7 +5229,7 @@ 

      Submodules
      -CIME.utils.parse_args_and_handle_standard_logging_options(args, parser=None)[source]
      +CIME.utils.parse_args_and_handle_standard_logging_options(args, parser=None)[source]

      Guide to logging in CIME.

      logger.debug -> Verbose/detailed output, use for debugging, off by default. Goes to a .log file logger.info -> Goes to stdout (and log if –debug). Use for normal program output @@ -5098,7 +5239,7 @@

      Submodules
      -CIME.utils.parse_test_name(test_name)[source]
      +CIME.utils.parse_test_name(test_name)[source]

      Given a CIME test name TESTCASE[_CASEOPTS].GRID.COMPSET[.MACHINE_COMPILER[.TESTMODS]], return each component of the testname with machine and compiler split. Do not error if a partial testname is provided (TESTCASE or TESTCASE.GRID) instead @@ -5134,6 +5275,12 @@

      Submodules['ERS', None, 'fe12_123', 'JGF', 'machine', 'compiler', None] >>> parse_test_name('ERS.fe12_123.JGF.machine_compiler.test-mods') ['ERS', None, 'fe12_123', 'JGF', 'machine', 'compiler', ['test/mods']] +>>> parse_test_name('ERS.fe12_123.JGF.*_compiler.test-mods') +['ERS', None, 'fe12_123', 'JGF', None, 'compiler', ['test/mods']] +>>> parse_test_name('ERS.fe12_123.JGF.machine_*.test-mods') +['ERS', None, 'fe12_123', 'JGF', 'machine', None, ['test/mods']] +>>> parse_test_name('ERS.fe12_123.JGF.*_*.test-mods') +['ERS', None, 'fe12_123', 'JGF', None, None, ['test/mods']] >>> parse_test_name('ERS.fe12_123.JGF.machine_compiler.test-mods--other-dir-path--and-one-more') ['ERS', None, 'fe12_123', 'JGF', 'machine', 'compiler', ['test/mods', 'other/dir/path', 'and/one/more']] >>> parse_test_name('SMS.f19_g16.2000_DATM%QI.A_XLND_SICE_SOCN_XROF_XGLC_SWAV.mach-ine_compiler.test-mods') @@ -5150,48 +5297,48 @@

      Submodules
      -CIME.utils.redirect_logger(new_target, logger_name)[source]
      +CIME.utils.redirect_logger(new_target, logger_name)[source]

      -CIME.utils.redirect_stderr(new_target)[source]
      +CIME.utils.redirect_stderr(new_target)[source]
      -CIME.utils.redirect_stdout(new_target)[source]
      +CIME.utils.redirect_stdout(new_target)[source]
      -CIME.utils.redirect_stdout_stderr(new_target)[source]
      +CIME.utils.redirect_stdout_stderr(new_target)[source]
      -CIME.utils.reset_cime_config()[source]
      +CIME.utils.reset_cime_config()[source]

      Useful to keep unit tests from interfering with each other

      -CIME.utils.resolve_mail_type_args(args)[source]
      +CIME.utils.resolve_mail_type_args(args)[source]
      -CIME.utils.run_and_log_case_status(func, phase, caseroot='.', custom_starting_msg_functor=None, custom_success_msg_functor=None, is_batch=False)[source]
      +CIME.utils.run_and_log_case_status(func, phase, caseroot='.', custom_starting_msg_functor=None, custom_success_msg_functor=None, is_batch=False)[source]
      -CIME.utils.run_bld_cmd_ensure_logging(cmd, arg_logger, from_dir=None, timeout=None)[source]
      +CIME.utils.run_bld_cmd_ensure_logging(cmd, arg_logger, from_dir=None, timeout=None)[source]
      -CIME.utils.run_cmd(cmd, input_str=None, from_dir=None, verbose=None, arg_stdout=<object object>, arg_stderr=<object object>, env=None, combine_output=False, timeout=None, executable=None, shell=True)[source]
      +CIME.utils.run_cmd(cmd, input_str=None, from_dir=None, verbose=None, arg_stdout=<object object>, arg_stderr=<object object>, env=None, combine_output=False, timeout=None, executable=None, shell=True)[source]

      Wrapper around subprocess to make it much more convenient to run shell commands

      >>> run_cmd('ls file_i_hope_doesnt_exist')[0] != 0
       True
      @@ -5201,7 +5348,7 @@ 

      Submodules
      -CIME.utils.run_cmd_no_fail(cmd, input_str=None, from_dir=None, verbose=None, arg_stdout=<object object>, arg_stderr=<object object>, env=None, combine_output=False, timeout=None, executable=None)[source]
      +CIME.utils.run_cmd_no_fail(cmd, input_str=None, from_dir=None, verbose=None, arg_stdout=<object object>, arg_stderr=<object object>, env=None, combine_output=False, timeout=None, executable=None)[source]

      Wrapper around subprocess to make it much more convenient to run shell commands. Expects command to work. Just returns output string.

      >>> run_cmd_no_fail('echo foo') == 'foo'
      @@ -5222,7 +5369,7 @@ 

      Submodules
      -CIME.utils.run_sub_or_cmd(cmd, cmdargs, subname, subargs, logfile=None, case=None, from_dir=None, timeout=None)[source]
      +CIME.utils.run_sub_or_cmd(cmd, cmdargs, subname, subargs, logfile=None, case=None, from_dir=None, timeout=None)[source]

      This code will try to import and run each cmd as a subroutine if that fails it will run it as a program in a seperate shell

      Raises exception on failure.

      @@ -5230,7 +5377,7 @@

      Submodules
      -CIME.utils.safe_copy(src_path, tgt_path, preserve_meta=True)[source]
      +CIME.utils.safe_copy(src_path, tgt_path, preserve_meta=True)[source]

      A flexbile and safe copy routine. Will try to copy file and metadata, but this can fail if the current user doesn’t own the tgt file. A fallback data-only copy is attempted in this case. Works even if overwriting a read-only file.

      @@ -5245,7 +5392,7 @@

      Submodules
      -CIME.utils.safe_recursive_copy(src_dir, tgt_dir, file_map)[source]
      +CIME.utils.safe_recursive_copy(src_dir, tgt_dir, file_map)[source]

      Copies a set of files from one dir to another. Works even if overwriting a read-only file. Files can be relative paths and the relative path will be matched on the tgt side.

      @@ -5253,36 +5400,36 @@

      Submodules
      -CIME.utils.set_logger_indent(indent)[source]
      +CIME.utils.set_logger_indent(indent)[source]

      -CIME.utils.set_model(model)[source]
      +CIME.utils.set_model(model)[source]

      Set the model to be used in this session

      -CIME.utils.setup_standard_logging_options(parser)[source]
      +CIME.utils.setup_standard_logging_options(parser)[source]
      -CIME.utils.start_buffering_output()[source]
      +CIME.utils.start_buffering_output()[source]

      All stdout, stderr will be buffered after this is called. This is python’s default behavior.

      -CIME.utils.stop_buffering_output()[source]
      +CIME.utils.stop_buffering_output()[source]

      All stdout, stderr will not be buffered after this is called.

      -CIME.utils.string_in_list(_string, _list)[source]
      +CIME.utils.string_in_list(_string, _list)[source]

      Case insensitive search for string in list returns the matching list value >>> string_in_list(“Brack”,[“bar”, “bracK”, “foo”]) @@ -5294,12 +5441,12 @@

      Submodules
      -CIME.utils.stringify_bool(val)[source]
      +CIME.utils.stringify_bool(val)[source]

      +CIME.utils.symlink_force(target, link_name)[source]

      Makes a symlink from link_name to target. Unlike the standard os.symlink, this will work even if link_name already exists (in which case link_name will be overwritten).

      @@ -5307,12 +5454,12 @@

      Submodules
      -CIME.utils.touch(fname)[source]
      +CIME.utils.touch(fname)[source]

      -CIME.utils.transform_vars(text, case=None, subgroup=None, overrides=None, default=None)[source]
      +CIME.utils.transform_vars(text, case=None, subgroup=None, overrides=None, default=None)[source]

      Do the variable substitution for any variables that need transforms recursively.

      >>> transform_vars("{{ cesm_stdout }}", default="cesm.stdout")
      @@ -5327,100 +5474,100 @@ 

      Submodules
      -CIME.utils.verbatim_success_msg(return_val)[source]
      +CIME.utils.verbatim_success_msg(return_val)[source]

      -CIME.utils.wait_for_unlocked(filepath)[source]
      +CIME.utils.wait_for_unlocked(filepath)[source]

      -

      CIME.wait_for_tests module

      +

      CIME.wait_for_tests module

      -CIME.wait_for_tests.create_cdash_build_xml(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, data_rel_path, git_commit)[source]
      +CIME.wait_for_tests.create_cdash_build_xml(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, data_rel_path, git_commit)[source]
      -CIME.wait_for_tests.create_cdash_config_xml(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, data_rel_path, git_commit)[source]
      +CIME.wait_for_tests.create_cdash_config_xml(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, data_rel_path, git_commit)[source]
      -CIME.wait_for_tests.create_cdash_test_xml(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, data_rel_path, git_commit)[source]
      +CIME.wait_for_tests.create_cdash_test_xml(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, data_rel_path, git_commit)[source]
      -CIME.wait_for_tests.create_cdash_upload_xml(results, cdash_build_name, cdash_build_group, utc_time, hostname, force_log_upload)[source]
      +CIME.wait_for_tests.create_cdash_upload_xml(results, cdash_build_name, cdash_build_group, utc_time, hostname, force_log_upload)[source]
      -CIME.wait_for_tests.create_cdash_xml(results, cdash_build_name, cdash_project, cdash_build_group, force_log_upload=False)[source]
      +CIME.wait_for_tests.create_cdash_xml(results, cdash_build_name, cdash_project, cdash_build_group, force_log_upload=False)[source]
      -CIME.wait_for_tests.create_cdash_xml_boiler(phase, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, git_commit)[source]
      +CIME.wait_for_tests.create_cdash_xml_boiler(phase, cdash_build_name, cdash_build_group, utc_time, current_time, hostname, git_commit)[source]
      -CIME.wait_for_tests.create_cdash_xml_fakes(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname)[source]
      +CIME.wait_for_tests.create_cdash_xml_fakes(results, cdash_build_name, cdash_build_group, utc_time, current_time, hostname)[source]
      -CIME.wait_for_tests.get_nml_diff(test_path)[source]
      +CIME.wait_for_tests.get_nml_diff(test_path)[source]
      -CIME.wait_for_tests.get_test_output(test_path)[source]
      +CIME.wait_for_tests.get_test_output(test_path)[source]
      -CIME.wait_for_tests.get_test_phase(test_path, phase)[source]
      +CIME.wait_for_tests.get_test_phase(test_path, phase)[source]
      -CIME.wait_for_tests.get_test_time(test_path)[source]
      +CIME.wait_for_tests.get_test_time(test_path)[source]
      -CIME.wait_for_tests.set_up_signal_handlers()[source]
      +CIME.wait_for_tests.set_up_signal_handlers()[source]
      -CIME.wait_for_tests.signal_handler(*_)[source]
      +CIME.wait_for_tests.signal_handler(*_)[source]
      -CIME.wait_for_tests.wait_for_test(test_path, results, wait, check_throughput, check_memory, ignore_namelists, ignore_memleak, no_run)[source]
      +CIME.wait_for_tests.wait_for_test(test_path, results, wait, check_throughput, check_memory, ignore_namelists, ignore_memleak, no_run)[source]
      -CIME.wait_for_tests.wait_for_tests(test_paths, no_wait=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False, cdash_build_name=None, cdash_project='E3SM', cdash_build_group='ACME_Latest', timeout=None, force_log_upload=False, no_run=False, update_success=False, expect_test_complete=True)[source]
      +CIME.wait_for_tests.wait_for_tests(test_paths, no_wait=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False, cdash_build_name=None, cdash_project='E3SM', cdash_build_group='ACME_Latest', timeout=None, force_log_upload=False, no_run=False, update_success=False, expect_test_complete=True)[source]
      -CIME.wait_for_tests.wait_for_tests_impl(test_paths, no_wait=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False, no_run=False)[source]
      +CIME.wait_for_tests.wait_for_tests_impl(test_paths, no_wait=False, check_throughput=False, check_memory=False, ignore_namelists=False, ignore_memleak=False, no_run=False)[source]
      -

      Module contents

      +

      Module contents

      diff --git a/versions/master/html/CIME_api/CIME.scripts.html b/versions/master/html/CIME_api/CIME.scripts.html index c13332ef403..3f33a2b555e 100644 --- a/versions/master/html/CIME_api/CIME.scripts.html +++ b/versions/master/html/CIME_api/CIME.scripts.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
    • CIME.SystemTests package
    • CIME.Tools package
    • CIME.XML package
    • +
    • CIME.baselines package
    • CIME.build_scripts package
    • CIME.case package
    • CIME.data package
    • @@ -137,29 +138,29 @@
      -

      CIME.scripts package

      +

      CIME.scripts package

      -

      Submodules

      +

      Submodules

      -

      CIME.scripts.create_clone module

      +

      CIME.scripts.create_clone module

      -CIME.scripts.create_clone.parse_command_line(args)[source]
      +CIME.scripts.create_clone.parse_command_line(args)[source]
      -

      CIME.scripts.create_newcase module

      +

      CIME.scripts.create_newcase module

      Script to create a new CIME Case Control System (CSS) experimental case.

      -CIME.scripts.create_newcase.parse_command_line(args, cimeroot, description)[source]
      +CIME.scripts.create_newcase.parse_command_line(args, cimeroot, description)[source]
      -

      CIME.scripts.create_test module

      +

      CIME.scripts.create_test module

      Script to create, build and run CIME tests. This script can:

      1. Run a single test, or more than one test @@ -208,40 +209,40 @@

        Submoduleshttps://github.com/ESMCI/cime

        -CIME.scripts.create_test.create_test(test_names, test_data, compiler, machine_name, no_run, no_build, no_setup, no_batch, test_root, baseline_root, clean, baseline_cmp_name, baseline_gen_name, namelists_only, project, test_id, parallel_jobs, walltime, single_submit, proc_pool, use_existing, save_timing, queue, allow_baseline_overwrite, output_root, wait, force_procs, force_threads, mpilib, input_dir, pesfile, run_count, mail_user, mail_type, check_throughput, check_memory, ignore_namelists, ignore_memleak, allow_pnl, non_local, single_exe, workflow, chksum, force_rebuild)[source]
        +CIME.scripts.create_test.create_test(test_names, test_data, compiler, machine_name, no_run, no_build, no_setup, no_batch, test_root, baseline_root, clean, baseline_cmp_name, baseline_gen_name, namelists_only, project, test_id, parallel_jobs, walltime, single_submit, proc_pool, use_existing, save_timing, queue, allow_baseline_overwrite, output_root, wait, force_procs, force_threads, mpilib, input_dir, pesfile, run_count, mail_user, mail_type, check_throughput, check_memory, ignore_namelists, ignore_memleak, allow_pnl, non_local, single_exe, workflow, chksum, force_rebuild)[source]
        -CIME.scripts.create_test.get_default_setting(config, varname, default_if_not_found, check_main=False)[source]
        +CIME.scripts.create_test.get_default_setting(config, varname, default_if_not_found, check_main=False)[source]
        -CIME.scripts.create_test.parse_command_line(args, description)[source]
        +CIME.scripts.create_test.parse_command_line(args, description)[source]
        -CIME.scripts.create_test.single_submit_impl(machine_name, test_id, proc_pool, _, args, job_cost_map, wall_time, test_root)[source]
        +CIME.scripts.create_test.single_submit_impl(machine_name, test_id, proc_pool, _, args, job_cost_map, wall_time, test_root)[source]

      -

      CIME.scripts.query_config module

      +

      CIME.scripts.query_config module

      Displays information about available compsets, component settings, grids and/or machines. Typically run with one of the arguments –compsets, –settings, –grids or –machines; if you specify more than one of these arguments, information will be listed for each.

      -class CIME.scripts.query_config.ArgumentParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]
      +class CIME.scripts.query_config.ArgumentParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]

      Bases: ArgumentParser

      we override the error message from ArgumentParser to have a more helpful message in the case of missing arguments

      -error(message: string)[source]
      +error(message: string)[source]

      Prints a usage message incorporating the message to stderr and exits.

      If you override this in a subclass, it should not return – it @@ -252,75 +253,75 @@

      Submodules
      -class CIME.scripts.query_config.Machines(infile=None, files=None, machine=None, extra_machines_dir=None)[source]
      +class CIME.scripts.query_config.Machines(infile=None, files=None, machine=None, extra_machines_dir=None)[source]

      Bases: Machines

      we overide print_values from Machines to add current in machine description

      -print_values(machine_name='all')[source]
      +print_values(machine_name='all')[source]

      -CIME.scripts.query_config.get_components(files)[source]
      +CIME.scripts.query_config.get_components(files)[source]

      Determine the valid component classes (e.g. atm) for the driver/cpl These are then stored in comps_array

      -CIME.scripts.query_config.get_compsets(files)[source]
      +CIME.scripts.query_config.get_compsets(files)[source]

      Determine valid component values by checking the value attributes for COMPSETS_SPEC_FILE

      -CIME.scripts.query_config.parse_command_line(args, description)[source]
      +CIME.scripts.query_config.parse_command_line(args, description)[source]

      parse command line arguments

      -CIME.scripts.query_config.print_compset(name, files, all_components=False, xml=False)[source]
      +CIME.scripts.query_config.print_compset(name, files, all_components=False, xml=False)[source]

      print compsets associated with the component name, but if all_components is true only print the details if the associated component is available

      -CIME.scripts.query_config.query_all_components(files, xml=False)[source]
      +CIME.scripts.query_config.query_all_components(files, xml=False)[source]

      query all components

      -CIME.scripts.query_config.query_component(name, files, all_components=False, xml=False)[source]
      +CIME.scripts.query_config.query_component(name, files, all_components=False, xml=False)[source]

      query a component by name

      -CIME.scripts.query_config.query_compsets(files, name, xml=False)[source]
      +CIME.scripts.query_config.query_compsets(files, name, xml=False)[source]

      query compset definition give a compset name

      -CIME.scripts.query_config.query_grids(files, long_output, xml=False)[source]
      +CIME.scripts.query_config.query_grids(files, long_output, xml=False)[source]

      query all grids.

      -CIME.scripts.query_config.query_machines(files, machine_name='all', xml=False)[source]
      +CIME.scripts.query_config.query_machines(files, machine_name='all', xml=False)[source]

      query machines. Defaule: all

      -

      CIME.scripts.query_testlists module

      +

      CIME.scripts.query_testlists module

      Script to query xml test lists, displaying all tests in human-readable form.

      Usage:
      @@ -336,7 +337,7 @@

      Submodules
      -CIME.scripts.query_testlists.count_test_data(test_data)[source]
      +CIME.scripts.query_testlists.count_test_data(test_data)[source]
      Args:
      test_data (dict): dictionary of test data, containing at least these keys:

      diff --git a/versions/master/html/CIME_api/CIME.tests.html b/versions/master/html/CIME_api/CIME.tests.html index 0602c191774..1df0e110a31 100644 --- a/versions/master/html/CIME_api/CIME.tests.html +++ b/versions/master/html/CIME_api/CIME.tests.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -66,6 +66,7 @@
    • CIME.SystemTests package
    • CIME.Tools package
    • CIME.XML package
    • +
    • CIME.baselines package
    • CIME.build_scripts package
    • CIME.case package
    • CIME.data package
    • @@ -137,152 +138,152 @@
      -

      CIME.tests package

      +

      CIME.tests package

      -

      Submodules

      +

      Submodules

      -

      CIME.tests.base module

      +

      CIME.tests.base module

      -class CIME.tests.base.BaseTestCase(methodName='runTest')[source]
      +class CIME.tests.base.BaseTestCase(methodName='runTest')[source]

      Bases: TestCase

      -FAST_ONLY = None
      +FAST_ONLY = None
      -GLOBAL_TIMEOUT = None
      +GLOBAL_TIMEOUT = None
      -MACHINE = None
      +MACHINE = None
      -NO_BATCH = None
      +NO_BATCH = None
      -NO_CMAKE = None
      +NO_CMAKE = None
      -NO_FORTRAN_RUN = None
      +NO_FORTRAN_RUN = None
      -NO_TEARDOWN = None
      +NO_TEARDOWN = None
      -SCRIPT_DIR = '/home/runner/work/cime/cime/scripts'
      +SCRIPT_DIR = '/home/runner/work/cime/cime/scripts'
      -TEST_COMPILER = None
      +TEST_COMPILER = None
      -TEST_MPILIB = None
      +TEST_MPILIB = None
      -TEST_ROOT = None
      +TEST_ROOT = None
      -TOOLS_DIR = '/home/runner/work/cime/cime/CIME/Tools'
      +TOOLS_DIR = '/home/runner/work/cime/cime/CIME/Tools'
      -assert_dashboard_has_build(build_name, expected_count=1)[source]
      +assert_dashboard_has_build(build_name, expected_count=1)[source]
      -assert_test_status(test_name, test_status_obj, test_phase, expected_stat)[source]
      +assert_test_status(test_name, test_status_obj, test_phase, expected_stat)[source]
      -get_casedir(case_fragment, all_cases)[source]
      +get_casedir(case_fragment, all_cases)[source]
      -kill_python_subprocesses(sig=Signals.SIGKILL, expected_num_killed=None)[source]
      +kill_python_subprocesses(sig=Signals.SIGKILL, expected_num_killed=None)[source]
      -kill_subprocesses(name=None, sig=Signals.SIGKILL, expected_num_killed=None)[source]
      +kill_subprocesses(name=None, sig=Signals.SIGKILL, expected_num_killed=None)[source]
      -run_cmd_assert_result(cmd, from_dir=None, expected_stat=0, env=None, verbose=False, shell=True)[source]
      +run_cmd_assert_result(cmd, from_dir=None, expected_stat=0, env=None, verbose=False, shell=True)[source]
      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -setup_proxy()[source]
      +setup_proxy()[source]
      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -verify_perms(root_dir)[source]
      +verify_perms(root_dir)[source]
      -CIME.tests.base.typed_os_environ(key, default_value, expected_type=None)[source]
      +CIME.tests.base.typed_os_environ(key, default_value, expected_type=None)[source]
      -

      CIME.tests.case_fake module

      +

      CIME.tests.case_fake module

      This module contains a fake implementation of the Case class that can be used for testing the tests.

      -class CIME.tests.case_fake.CaseFake(case_root, create_case_root=True)[source]
      +class CIME.tests.case_fake.CaseFake(case_root, create_case_root=True)[source]

      Bases: object

      -case_setup(clean=False, test_mode=False, reset=False)[source]
      +case_setup(clean=False, test_mode=False, reset=False)[source]
      -copy(newcasename, newcaseroot)[source]
      +copy(newcasename, newcaseroot)[source]

      Create and return a copy of self, but with CASE and CASEBASEID set to newcasename, CASEROOT set to newcaseroot, and RUNDIR set appropriately.

      @@ -294,7 +295,7 @@

      Submodules
      -create_clone(newcase, keepexe=False, mach_dir=None, project=None, cime_output_root=None, exeroot=None, rundir=None)[source]
      +create_clone(newcase, keepexe=False, mach_dir=None, project=None, cime_output_root=None, exeroot=None, rundir=None)[source]

      Create a clone of the current case. Also creates the CASEROOT directory for the clone case (given by newcase).

      @@ -315,12 +316,12 @@

      Submodules
      -flush()[source]
      +flush()[source]

      -get_value(item)[source]
      +get_value(item)[source]

      Get the value of the given item

      Returns None if item isn’t set for this case

      @@ -331,37 +332,37 @@

      Submodules
      -load_env(reset=False)[source]
      +load_env(reset=False)[source]

      -make_rundir()[source]
      +make_rundir()[source]

      Make directory given by RUNDIR

      -set_exeroot()[source]
      +set_exeroot()[source]

      Assumes CASEROOT is already set; sets an appropriate EXEROOT (nested inside CASEROOT)

      -set_initial_test_values()[source]
      +set_initial_test_values()[source]
      -set_rundir()[source]
      +set_rundir()[source]

      Assumes CASEROOT is already set; sets an appropriate RUNDIR (nested inside CASEROOT)

      -set_value(item, value)[source]
      +set_value(item, value)[source]

      Set the value of the given item to the given value

      Args:

      item (str): variable of interest @@ -374,16 +375,16 @@

      Submodules -

      CIME.tests.custom_assertions_test_status module

      +

      CIME.tests.custom_assertions_test_status module

      This module contains a class that extends unittest.TestCase, adding custom assertions that can be used when testing TestStatus.

      -class CIME.tests.custom_assertions_test_status.CustomAssertionsTestStatus(methodName='runTest')[source]
      +class CIME.tests.custom_assertions_test_status.CustomAssertionsTestStatus(methodName='runTest')[source]

      Bases: TestCase

      -assert_core_phases(output, test_name, fails)[source]
      +assert_core_phases(output, test_name, fails)[source]

      Asserts that ‘output’ contains a line for each of the core test phases for the given test_name. All results should be PASS except those given by the fails list, which should be FAILS.

      @@ -391,21 +392,21 @@

      Submodules
      -assert_num_expected_unexpected_fails(output, num_expected, num_unexpected)[source]
      +assert_num_expected_unexpected_fails(output, num_expected, num_unexpected)[source]

      Asserts that the number of occurrences of expected and unexpected fails in ‘output’ matches the given numbers

      -assert_phase_absent(output, phase, test_name)[source]
      +assert_phase_absent(output, phase, test_name)[source]

      Asserts that ‘output’ does not contain a status line for the given phase and test_name

      -assert_status_of_phase(output, status, phase, test_name, xfail=None)[source]
      +assert_status_of_phase(output, status, phase, test_name, xfail=None)[source]

      Asserts that ‘output’ contains a line showing the given status for the given phase for the given test_name.

      ‘xfail’ should have one of the following values: @@ -424,305 +425,305 @@

      Submodules -

      CIME.tests.scripts_regression_tests module

      +

      CIME.tests.scripts_regression_tests module

      Script containing CIME python regression test suite. This suite should be run to confirm overall CIME correctness.

      -CIME.tests.scripts_regression_tests.cleanup(test_root)[source]
      +CIME.tests.scripts_regression_tests.cleanup(test_root)[source]
      -CIME.tests.scripts_regression_tests.configure_tests(timeout, no_fortran_run, fast, no_batch, no_cmake, no_teardown, machine, compiler, mpilib, test_root, **kwargs)[source]
      +CIME.tests.scripts_regression_tests.configure_tests(timeout, no_fortran_run, fast, no_batch, no_cmake, no_teardown, machine, compiler, mpilib, test_root, **kwargs)[source]
      -CIME.tests.scripts_regression_tests.setup_arguments(parser)[source]
      +CIME.tests.scripts_regression_tests.setup_arguments(parser)[source]
      -CIME.tests.scripts_regression_tests.write_provenance_info(machine, test_compiler, test_mpilib, test_root)[source]
      +CIME.tests.scripts_regression_tests.write_provenance_info(machine, test_compiler, test_mpilib, test_root)[source]

      -

      CIME.tests.test_sys_bless_tests_results module

      +

      CIME.tests.test_sys_bless_tests_results module

      -class CIME.tests.test_sys_bless_tests_results.TestBlessTestResults(methodName='runTest')[source]
      +class CIME.tests.test_sys_bless_tests_results.TestBlessTestResults(methodName='runTest')[source]

      Bases: BaseTestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_bless_test_results()[source]
      +test_bless_test_results()[source]
      -test_rebless_namelist()[source]
      +test_rebless_namelist()[source]
      -

      CIME.tests.test_sys_build_system module

      +

      CIME.tests.test_sys_build_system module

      -class CIME.tests.test_sys_build_system.TestBuildSystem(methodName='runTest')[source]
      +class CIME.tests.test_sys_build_system.TestBuildSystem(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_clean_rebuild()[source]
      +test_clean_rebuild()[source]
      -

      CIME.tests.test_sys_cime_case module

      +

      CIME.tests.test_sys_cime_case module

      -class CIME.tests.test_sys_cime_case.TestCimeCase(methodName='runTest')[source]
      +class CIME.tests.test_sys_cime_case.TestCimeCase(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_case_clean()[source]
      +test_case_clean()[source]
      -test_case_submit_interface()[source]
      +test_case_submit_interface()[source]
      -test_cime_case()[source]
      +test_cime_case()[source]
      -test_cime_case_allow_failed_prereq()[source]
      +test_cime_case_allow_failed_prereq()[source]
      -test_cime_case_build_threaded_1()[source]
      +test_cime_case_build_threaded_1()[source]
      -test_cime_case_build_threaded_2()[source]
      +test_cime_case_build_threaded_2()[source]
      -test_cime_case_force_pecount()[source]
      +test_cime_case_force_pecount()[source]
      -test_cime_case_mpi_serial()[source]
      +test_cime_case_mpi_serial()[source]
      -test_cime_case_prereq()[source]
      +test_cime_case_prereq()[source]
      -test_cime_case_resubmit_immediate()[source]
      +test_cime_case_resubmit_immediate()[source]
      -test_cime_case_st_archive_resubmit()[source]
      +test_cime_case_st_archive_resubmit()[source]
      -test_cime_case_test_custom_project()[source]
      +test_cime_case_test_custom_project()[source]
      -test_cime_case_test_walltime_mgmt_1()[source]
      +test_cime_case_test_walltime_mgmt_1()[source]
      -test_cime_case_test_walltime_mgmt_2()[source]
      +test_cime_case_test_walltime_mgmt_2()[source]
      -test_cime_case_test_walltime_mgmt_3()[source]
      +test_cime_case_test_walltime_mgmt_3()[source]
      -test_cime_case_test_walltime_mgmt_4()[source]
      +test_cime_case_test_walltime_mgmt_4()[source]
      -test_cime_case_test_walltime_mgmt_5()[source]
      +test_cime_case_test_walltime_mgmt_5()[source]
      -test_cime_case_test_walltime_mgmt_6()[source]
      +test_cime_case_test_walltime_mgmt_6()[source]
      -test_cime_case_test_walltime_mgmt_7()[source]
      +test_cime_case_test_walltime_mgmt_7()[source]
      -test_cime_case_test_walltime_mgmt_8()[source]
      +test_cime_case_test_walltime_mgmt_8()[source]
      -test_cime_case_xmlchange_append()[source]
      +test_cime_case_xmlchange_append()[source]
      -test_configure()[source]
      +test_configure()[source]
      -test_create_test_longname()[source]
      +test_create_test_longname()[source]
      -test_env_loading()[source]
      +test_env_loading()[source]
      -test_self_build_cprnc()[source]
      +test_self_build_cprnc()[source]
      -test_xml_caching()[source]
      +test_xml_caching()[source]
      -

      CIME.tests.test_sys_cime_performance module

      +

      CIME.tests.test_sys_cime_performance module

      -class CIME.tests.test_sys_cime_performance.TestCimePerformance(methodName='runTest')[source]
      +class CIME.tests.test_sys_cime_performance.TestCimePerformance(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_cime_case_ctrl_performance()[source]
      +test_cime_case_ctrl_performance()[source]
      -

      CIME.tests.test_sys_create_newcase module

      +

      CIME.tests.test_sys_create_newcase module

      -class CIME.tests.test_sys_create_newcase.TestCreateNewcase(methodName='runTest')[source]
      +class CIME.tests.test_sys_create_newcase.TestCreateNewcase(methodName='runTest')[source]

      Bases: BaseTestCase

      -classmethod setUpClass()[source]
      +classmethod setUpClass()[source]

      Hook method for setting up class fixture before running tests in the class.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -classmethod tearDownClass()[source]
      +classmethod tearDownClass()[source]

      Hook method for deconstructing the class fixture after running all tests in the class.

      -test_a_createnewcase()[source]
      +test_a_createnewcase()[source]
      -test_aa_no_flush_on_instantiate()[source]
      +test_aa_no_flush_on_instantiate()[source]
      -test_b_user_mods()[source]
      +test_b_user_mods()[source]
      -test_c_create_clone_keepexe()[source]
      +test_c_create_clone_keepexe()[source]
      -test_d_create_clone_new_user()[source]
      +test_d_create_clone_new_user()[source]
      -test_dd_create_clone_not_writable()[source]
      +test_dd_create_clone_not_writable()[source]
      -test_e_xmlquery()[source]
      +test_e_xmlquery()[source]
      -test_f_createnewcase_with_user_compset()[source]
      +test_f_createnewcase_with_user_compset()[source]
      -test_g_createnewcase_with_user_compset_and_env_mach_pes()[source]
      +test_g_createnewcase_with_user_compset_and_env_mach_pes()[source]
      -test_h_primary_component()[source]
      +test_h_primary_component()[source]
      -test_j_createnewcase_user_compset_vs_alias()[source]
      +test_j_createnewcase_user_compset_vs_alias()[source]

      Create a compset using the alias and another compset using the full compset name and make sure they are the same by comparing the namelist files in CaseDocs. Ignore the modelio files and clean the directory names out first.

      @@ -730,152 +731,152 @@

      Submodules
      -test_k_append_config()[source]
      +test_k_append_config()[source]

      -test_ka_createnewcase_extra_machines_dir()[source]
      +test_ka_createnewcase_extra_machines_dir()[source]
      -test_m_createnewcase_alternate_drivers()[source]
      +test_m_createnewcase_alternate_drivers()[source]
      -test_n_createnewcase_bad_compset()[source]
      +test_n_createnewcase_bad_compset()[source]
      -

      CIME.tests.test_sys_full_system module

      +

      CIME.tests.test_sys_full_system module

      -class CIME.tests.test_sys_full_system.TestFullSystem(methodName='runTest')[source]
      +class CIME.tests.test_sys_full_system.TestFullSystem(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_full_system()[source]
      +test_full_system()[source]
      -

      CIME.tests.test_sys_grid_generation module

      +

      CIME.tests.test_sys_grid_generation module

      -class CIME.tests.test_sys_grid_generation.TestGridGeneration(methodName='runTest')[source]
      +class CIME.tests.test_sys_grid_generation.TestGridGeneration(methodName='runTest')[source]

      Bases: BaseTestCase

      -classmethod setUpClass()[source]
      +classmethod setUpClass()[source]

      Hook method for setting up class fixture before running tests in the class.

      -classmethod tearDownClass()[source]
      +classmethod tearDownClass()[source]

      Hook method for deconstructing the class fixture after running all tests in the class.

      -test_gen_domain()[source]
      +test_gen_domain()[source]
      -

      CIME.tests.test_sys_jenkins_generic_job module

      +

      CIME.tests.test_sys_jenkins_generic_job module

      -class CIME.tests.test_sys_jenkins_generic_job.TestJenkinsGenericJob(methodName='runTest')[source]
      +class CIME.tests.test_sys_jenkins_generic_job.TestJenkinsGenericJob(methodName='runTest')[source]

      Bases: BaseTestCase

      -assert_num_leftovers(suite)[source]
      +assert_num_leftovers(suite)[source]
      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -simple_test(expect_works, extra_args, build_name=None)[source]
      +simple_test(expect_works, extra_args, build_name=None)[source]
      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_jenkins_generic_job()[source]
      +test_jenkins_generic_job()[source]
      -test_jenkins_generic_job_kill()[source]
      +test_jenkins_generic_job_kill()[source]
      -test_jenkins_generic_job_realistic_dash()[source]
      +test_jenkins_generic_job_realistic_dash()[source]
      -threaded_test(expect_works, extra_args, build_name=None)[source]
      +threaded_test(expect_works, extra_args, build_name=None)[source]
      -

      CIME.tests.test_sys_manage_and_query module

      +

      CIME.tests.test_sys_manage_and_query module

      -class CIME.tests.test_sys_manage_and_query.TestManageAndQuery(methodName='runTest')[source]
      +class CIME.tests.test_sys_manage_and_query.TestManageAndQuery(methodName='runTest')[source]

      Bases: BaseTestCase

      Tests various scripts to manage and query xml files

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_query_testlists_count_runs()[source]
      +test_query_testlists_count_runs()[source]

      Make sure that query_testlists runs successfully with the –count argument

      -test_query_testlists_define_testtypes_runs()[source]
      +test_query_testlists_define_testtypes_runs()[source]

      Make sure that query_testlists runs successfully with the –define-testtypes argument

      -test_query_testlists_list_runs()[source]
      +test_query_testlists_list_runs()[source]

      Make sure that query_testlists runs successfully with the –list argument

      -test_query_testlists_runs()[source]
      +test_query_testlists_runs()[source]

      Make sure that query_testlists runs successfully

      This simply makes sure that query_testlists doesn’t generate any errors when it runs. This helps ensure that changes in other utilities don’t @@ -886,545 +887,734 @@

      Submodules -

      CIME.tests.test_sys_query_config module

      +

      CIME.tests.test_sys_query_config module

      -class CIME.tests.test_sys_query_config.TestQueryConfig(methodName='runTest')[source]
      +class CIME.tests.test_sys_query_config.TestQueryConfig(methodName='runTest')[source]

      Bases: BaseTestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_query_components()[source]
      +test_query_components()[source]
      -test_query_compsets()[source]
      +test_query_compsets()[source]
      -test_query_grids()[source]
      +test_query_grids()[source]
      -test_query_machines()[source]
      +test_query_machines()[source]
      -

      CIME.tests.test_sys_run_restart module

      +

      CIME.tests.test_sys_run_restart module

      -class CIME.tests.test_sys_run_restart.TestRunRestart(methodName='runTest')[source]
      +class CIME.tests.test_sys_run_restart.TestRunRestart(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_run_restart()[source]
      +test_run_restart()[source]
      -test_run_restart_too_many_fails()[source]
      +test_run_restart_too_many_fails()[source]
      -

      CIME.tests.test_sys_save_timings module

      +

      CIME.tests.test_sys_save_timings module

      -class CIME.tests.test_sys_save_timings.TestSaveTimings(methodName='runTest')[source]
      +class CIME.tests.test_sys_save_timings.TestSaveTimings(methodName='runTest')[source]

      Bases: BaseTestCase

      -simple_test(manual_timing=False)[source]
      +simple_test(manual_timing=False)[source]
      -test_save_timings()[source]
      +test_save_timings()[source]
      -test_save_timings_manual()[source]
      +test_save_timings_manual()[source]
      -test_success_recording()[source]
      +test_success_recording()[source]
      -

      CIME.tests.test_sys_single_submit module

      +

      CIME.tests.test_sys_single_submit module

      -class CIME.tests.test_sys_single_submit.TestSingleSubmit(methodName='runTest')[source]
      +class CIME.tests.test_sys_single_submit.TestSingleSubmit(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_single_submit()[source]
      +test_single_submit()[source]
      -

      CIME.tests.test_sys_test_scheduler module

      +

      CIME.tests.test_sys_test_scheduler module

      -class CIME.tests.test_sys_test_scheduler.TestTestScheduler(methodName='runTest')[source]
      +class CIME.tests.test_sys_test_scheduler.TestTestScheduler(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_a_phases()[source]
      +test_a_phases()[source]
      -test_b_full()[source]
      +test_b_full()[source]
      -test_c_use_existing()[source]
      +test_c_use_existing()[source]
      -test_chksum(strftime)[source]
      +test_chksum(strftime)[source]
      -test_d_retry()[source]
      +test_d_retry()[source]
      -test_e_test_inferred_compiler()[source]
      +test_e_test_inferred_compiler()[source]
      -test_force_rebuild()[source]
      +test_force_rebuild()[source]
      -

      CIME.tests.test_sys_unittest module

      +

      CIME.tests.test_sys_unittest module

      -class CIME.tests.test_sys_unittest.TestUnitTest(methodName='runTest')[source]
      +class CIME.tests.test_sys_unittest.TestUnitTest(methodName='runTest')[source]

      Bases: BaseTestCase

      -classmethod setUpClass()[source]
      +classmethod setUpClass()[source]

      Hook method for setting up class fixture before running tests in the class.

      -classmethod tearDownClass()[source]
      +classmethod tearDownClass()[source]

      Hook method for deconstructing the class fixture after running all tests in the class.

      -test_a_unit_test()[source]
      +test_a_unit_test()[source]
      -test_b_cime_f90_unit_tests()[source]
      +test_b_cime_f90_unit_tests()[source]
      -

      CIME.tests.test_sys_user_concurrent_mods module

      +

      CIME.tests.test_sys_user_concurrent_mods module

      -class CIME.tests.test_sys_user_concurrent_mods.TestUserConcurrentMods(methodName='runTest')[source]
      +class CIME.tests.test_sys_user_concurrent_mods.TestUserConcurrentMods(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_user_concurrent_mods()[source]
      +test_user_concurrent_mods()[source]
      -

      CIME.tests.test_sys_wait_for_tests module

      +

      CIME.tests.test_sys_wait_for_tests module

      -class CIME.tests.test_sys_wait_for_tests.TestWaitForTests(methodName='runTest')[source]
      +class CIME.tests.test_sys_wait_for_tests.TestWaitForTests(methodName='runTest')[source]

      Bases: BaseTestCase

      -live_test_impl(testdir, expected_results, last_phase, last_status)[source]
      +live_test_impl(testdir, expected_results, last_phase, last_status)[source]
      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -simple_test(testdir, expected_results, extra_args='', build_name=None)[source]
      +simple_test(testdir, expected_results, extra_args='', build_name=None)[source]
      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_wait_for_test_all_pass()[source]
      +test_wait_for_test_all_pass()[source]
      -test_wait_for_test_cdash_kill()[source]
      +test_wait_for_test_cdash_kill()[source]
      -test_wait_for_test_cdash_pass()[source]
      +test_wait_for_test_cdash_pass()[source]
      -test_wait_for_test_no_wait()[source]
      +test_wait_for_test_no_wait()[source]
      -test_wait_for_test_test_status_integration_pass()[source]
      +test_wait_for_test_test_status_integration_pass()[source]
      -test_wait_for_test_test_status_integration_submit_fail()[source]
      +test_wait_for_test_test_status_integration_submit_fail()[source]
      -test_wait_for_test_timeout()[source]
      +test_wait_for_test_timeout()[source]
      -test_wait_for_test_wait_for_missing_run_phase()[source]
      +test_wait_for_test_wait_for_missing_run_phase()[source]
      -test_wait_for_test_wait_for_pend()[source]
      +test_wait_for_test_wait_for_pend()[source]
      -test_wait_for_test_wait_kill()[source]
      +test_wait_for_test_wait_kill()[source]
      -test_wait_for_test_with_fail()[source]
      +test_wait_for_test_with_fail()[source]
      -threaded_test(testdir, expected_results, extra_args='', build_name=None)[source]
      +threaded_test(testdir, expected_results, extra_args='', build_name=None)[source]
      -

      CIME.tests.test_unit_aprun module

      +

      CIME.tests.test_unit_aprun module

      -class CIME.tests.test_unit_aprun.TestUnitAprun(methodName='runTest')[source]
      +class CIME.tests.test_unit_aprun.TestUnitAprun(methodName='runTest')[source]

      Bases: TestCase

      -test_aprun()[source]
      +test_aprun()[source]
      -test_aprun_extra_args()[source]
      +test_aprun_extra_args()[source]
      +
      +
      +

      CIME.tests.test_unit_baselines_performance module

      +
      +
      +class CIME.tests.test_unit_baselines_performance.TestUnitBaselinesPerformance(methodName='runTest')[source]
      +

      Bases: TestCase

      +
      +
      +test__perf_get_memory(get_latest_cpl_logs, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test__perf_get_memory_override(get_latest_cpl_logs, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test__perf_get_throughput(get_latest_cpl_logs, get_cpl_throughput)[source]
      +
      + +
      +
      +test_get_cpl_mem_usage(isfile)[source]
      +
      + +
      +
      +test_get_cpl_mem_usage_gz()[source]
      +
      + +
      +
      +test_get_cpl_throughput()[source]
      +
      + +
      +
      +test_get_cpl_throughput_no_file()[source]
      +
      + +
      +
      +test_get_latest_cpl_logs()[source]
      +
      + +
      +
      +test_get_latest_cpl_logs_found_multiple()[source]
      +
      + +
      +
      +test_get_latest_cpl_logs_found_single()[source]
      +
      + +
      +
      +test_perf_compare_memory_baseline(get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test_perf_compare_memory_baseline_above_threshold(get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test_perf_compare_memory_baseline_no_baseline(get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test_perf_compare_memory_baseline_no_baseline_file(get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test_perf_compare_memory_baseline_no_tolerance(get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test_perf_compare_memory_baseline_not_enough_samples(get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage)[source]
      +
      + +
      +
      +test_perf_compare_throughput_baseline(get_latest_cpl_logs, read_baseline_file, _perf_get_throughput)[source]
      +
      + +
      +
      +test_perf_compare_throughput_baseline_above_threshold(get_latest_cpl_logs, read_baseline_file, _perf_get_throughput)[source]
      +
      + +
      +
      +test_perf_compare_throughput_baseline_no_baseline(get_latest_cpl_logs, read_baseline_file, _perf_get_throughput)[source]
      +
      + +
      +
      +test_perf_compare_throughput_baseline_no_baseline_file(get_latest_cpl_logs, read_baseline_file, _perf_get_throughput)[source]
      +
      + +
      +
      +test_perf_compare_throughput_baseline_no_tolerance(get_latest_cpl_logs, read_baseline_file, _perf_get_throughput)[source]
      +
      + +
      +
      +test_perf_get_memory()[source]
      +
      + +
      +
      +test_perf_get_memory_default(_perf_get_memory)[source]
      +
      + +
      +
      +test_perf_get_memory_default_no_value(_perf_get_memory)[source]
      +
      + +
      +
      +test_perf_get_throughput()[source]
      +
      + +
      +
      +test_perf_get_throughput_default(_perf_get_throughput)[source]
      +
      + +
      +
      +test_perf_get_throughput_default_no_value(_perf_get_throughput)[source]
      +
      + +
      +
      +test_perf_write_baseline(perf_get_throughput, perf_get_memory, write_baseline_file)[source]
      +
      + +
      +
      +test_read_baseline_file()[source]
      +
      + +
      +
      +test_read_baseline_file_content()[source]
      +
      + +
      +
      +test_read_baseline_file_multi_line()[source]
      +
      + +
      +
      +test_write_baseline_file()[source]
      +
      + +
      +
      +test_write_baseline_runtimeerror(perf_get_throughput, perf_get_memory, write_baseline_file)[source]
      +
      + +
      +
      +test_write_baseline_skip(perf_get_throughput, perf_get_memory, write_baseline_file)[source]
      +
      + +
      + +
      +
      +CIME.tests.test_unit_baselines_performance.create_mock_case(tempdir, get_latest_cpl_logs=None)[source]
      +
      +
      -

      CIME.tests.test_unit_case module

      +

      CIME.tests.test_unit_case module

      -class CIME.tests.test_unit_case.TestCase(methodName='runTest')[source]
      +class CIME.tests.test_unit_case.TestCase(methodName='runTest')[source]

      Bases: TestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_copy(getuser, getfqdn, configure, create_caseroot, apply_user_mods, set_lookup_value, lock_file, strftime, read_xml)[source]
      +test_copy(getuser, getfqdn, configure, create_caseroot, apply_user_mods, set_lookup_value, lock_file, strftime, read_xml)[source]
      -test_create(get_user, getfqdn, configure, create_caseroot, apply_user_mods, set_lookup_value, lock_file, strftime, read_xml)[source]
      +test_create(get_user, getfqdn, configure, create_caseroot, apply_user_mods, set_lookup_value, lock_file, strftime, read_xml)[source]
      -test_fix_sys_argv_quotes(read_xml)[source]
      +test_fix_sys_argv_quotes(read_xml)[source]
      -test_fix_sys_argv_quotes_incomplete(read_xml)[source]
      +test_fix_sys_argv_quotes_incomplete(read_xml)[source]
      -test_fix_sys_argv_quotes_kv(read_xml)[source]
      +test_fix_sys_argv_quotes_kv(read_xml)[source]
      -test_fix_sys_argv_quotes_val(read_xml)[source]
      +test_fix_sys_argv_quotes_val(read_xml)[source]
      -test_fix_sys_argv_quotes_val_quoted(read_xml)[source]
      +test_fix_sys_argv_quotes_val_quoted(read_xml)[source]
      -test_new_hash(getuser, getfqdn, strftime, read_xml)[source]
      +test_new_hash(getuser, getfqdn, strftime, read_xml)[source]
      -class CIME.tests.test_unit_case.TestCaseSubmit(methodName='runTest')[source]
      +class CIME.tests.test_unit_case.TestCaseSubmit(methodName='runTest')[source]

      Bases: TestCase

      -test__submit(lock_file, unlock_file, basename)[source]
      +test__submit(lock_file, unlock_file, basename)[source]
      -test_check_case()[source]
      +test_check_case()[source] +
      + +
      +
      +test_check_case_test()[source]
      -test_submit(read_xml, get_value, init, _submit)[source]
      +test_submit(read_xml, get_value, init, _submit)[source]
      -class CIME.tests.test_unit_case.TestCase_RecordCmd(methodName='runTest')[source]
      +class CIME.tests.test_unit_case.TestCase_RecordCmd(methodName='runTest')[source]

      Bases: TestCase

      -assert_calls_match(calls, expected)[source]
      +assert_calls_match(calls, expected)[source]
      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_cmd_arg(get_value, flush, init)[source]
      +test_cmd_arg(get_value, flush, init)[source]
      -test_error(strftime, get_value, flush, init)[source]
      +test_error(strftime, get_value, flush, init)[source]
      -test_init(strftime, get_value, flush, init)[source]
      +test_init(strftime, get_value, flush, init)[source]
      -test_sub_relative(strftime, get_value, flush, init)[source]
      +test_sub_relative(strftime, get_value, flush, init)[source]
      -CIME.tests.test_unit_case.make_valid_case(path)[source]
      +CIME.tests.test_unit_case.make_valid_case(path)[source]

      Make the given path look like a valid case to avoid errors

      -

      CIME.tests.test_unit_case_fake module

      +

      CIME.tests.test_unit_case_fake module

      This module contains unit tests of CaseFake

      -class CIME.tests.test_unit_case_fake.TestCaseFake(methodName='runTest')[source]
      +class CIME.tests.test_unit_case_fake.TestCaseFake(methodName='runTest')[source]

      Bases: TestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_create_clone()[source]
      +test_create_clone()[source]
      -

      CIME.tests.test_unit_case_setup module

      +

      CIME.tests.test_unit_case_setup module

      -class CIME.tests.test_unit_case_setup.TestCaseSetup(methodName='runTest')[source]
      +class CIME.tests.test_unit_case_setup.TestCaseSetup(methodName='runTest')[source]

      Bases: TestCase

      -test_create_macros(_create_macros_cmake)[source]
      +test_create_macros(_create_macros_cmake)[source]
      -test_create_macros_cmake(copy_depends_files)[source]
      +test_create_macros_cmake(copy_depends_files)[source]
      -test_create_macros_copy_extra()[source]
      +test_create_macros_copy_extra()[source]
      -test_create_macros_copy_user()[source]
      +test_create_macros_copy_user()[source]
      -CIME.tests.test_unit_case_setup.chdir(path)[source]
      +CIME.tests.test_unit_case_setup.chdir(path)[source]
      -CIME.tests.test_unit_case_setup.create_machines_dir()[source]
      +CIME.tests.test_unit_case_setup.create_machines_dir()[source]

      Creates temp machines directory with fake content

      -

      CIME.tests.test_unit_compare_test_results module

      +

      CIME.tests.test_unit_compare_test_results module

      This module contains unit tests for compare_test_results

      -class CIME.tests.test_unit_compare_test_results.TestCaseFake(methodName='runTest')[source]
      +class CIME.tests.test_unit_compare_test_results.TestCaseFake(methodName='runTest')[source]

      Bases: TestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_baseline()[source]
      +test_baseline()[source]
      -test_failed_early()[source]
      +test_failed_early()[source]
      -test_hist_only()[source]
      +test_hist_only()[source]
      -test_namelists_only()[source]
      +test_namelists_only()[source]
      -

      CIME.tests.test_unit_compare_two module

      +

      CIME.tests.test_unit_compare_two module

      This module contains unit tests of the core logic in SystemTestsCompareTwo.

      -class CIME.tests.test_unit_compare_two.Call(method, arguments)
      +class CIME.tests.test_unit_compare_two.Call(method, arguments)

      Bases: tuple

      -arguments
      +arguments

      Alias for field number 1

      -method
      +method

      Alias for field number 0

      @@ -1432,11 +1622,11 @@

      Submodules
      -class CIME.tests.test_unit_compare_two.SystemTestsCompareTwoFake(case1, run_one_suffix='base', run_two_suffix='test', separate_builds=False, multisubmit=False, case2setup_raises_exception=False, run_one_should_pass=True, run_two_should_pass=True, compare_should_pass=True)[source]
      +class CIME.tests.test_unit_compare_two.SystemTestsCompareTwoFake(case1, run_one_suffix='base', run_two_suffix='test', separate_builds=False, multisubmit=False, case2setup_raises_exception=False, run_one_should_pass=True, run_two_should_pass=True, compare_should_pass=True)[source]

      Bases: SystemTestsCompareTwo

      -run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]
      +run_indv(suffix='base', st_archive=False, submit_resubmits=None, keep_init_generated_files=False)[source]

      This fake implementation appends to the log and raises an exception if it’s supposed to

      Note that the Call object appended to the log has the current CASE name @@ -1449,182 +1639,182 @@

      Submodules
      -class CIME.tests.test_unit_compare_two.TestSystemTestsCompareTwo(methodName='runTest')[source]
      +class CIME.tests.test_unit_compare_two.TestSystemTestsCompareTwo(methodName='runTest')[source]

      Bases: TestCase

      -get_caseroots(casename='mytest')[source]
      +get_caseroots(casename='mytest')[source]

      Returns a tuple (case1root, case2root)

      -get_compare_phase_name(mytest)[source]
      +get_compare_phase_name(mytest)[source]

      Returns a string giving the compare phase name for this test

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_compare_fails()[source]
      +test_compare_fails()[source]
      -test_compare_passes()[source]
      +test_compare_passes()[source]
      -test_internal_calls_multisubmit_failed_state()[source]
      +test_internal_calls_multisubmit_failed_state()[source]
      -test_resetup_case_single_exe()[source]
      +test_resetup_case_single_exe()[source]
      -test_run1_fails()[source]
      +test_run1_fails()[source]
      -test_run2_fails()[source]
      +test_run2_fails()[source]
      -test_run_phase_internal_calls()[source]
      +test_run_phase_internal_calls()[source]
      -test_run_phase_internal_calls_multisubmit_phase1()[source]
      +test_run_phase_internal_calls_multisubmit_phase1()[source]
      -test_run_phase_internal_calls_multisubmit_phase2()[source]
      +test_run_phase_internal_calls_multisubmit_phase2()[source]
      -test_run_phase_passes()[source]
      +test_run_phase_passes()[source]
      -test_setup()[source]
      +test_setup()[source]
      -test_setup_case2_exists()[source]
      +test_setup_case2_exists()[source]
      -test_setup_error()[source]
      +test_setup_error()[source]
      -test_setup_separate_builds_sharedlibroot()[source]
      +test_setup_separate_builds_sharedlibroot()[source]

      -

      CIME.tests.test_unit_config module

      +

      CIME.tests.test_unit_config module

      -class CIME.tests.test_unit_config.TestConfig(methodName='runTest')[source]
      +class CIME.tests.test_unit_config.TestConfig(methodName='runTest')[source]

      Bases: TestCase

      -test_class()[source]
      +test_class()[source]
      -test_class_external()[source]
      +test_class_external()[source]
      -test_load()[source]
      +test_load()[source]
      -test_overwrite()[source]
      +test_overwrite()[source]
      -

      CIME.tests.test_unit_cs_status module

      +

      CIME.tests.test_unit_cs_status module

      -class CIME.tests.test_unit_cs_status.TestCsStatus(methodName='runTest')[source]
      +class CIME.tests.test_unit_cs_status.TestCsStatus(methodName='runTest')[source]

      Bases: CustomAssertionsTestStatus

      -create_test_dir(test_dir)[source]
      +create_test_dir(test_dir)[source]

      Creates the given test directory under testroot.

      Returns the full path to the created test directory.

      -static create_test_status_core_passes(test_dir_path, test_name)[source]
      +static create_test_status_core_passes(test_dir_path, test_name)[source]

      Creates a TestStatus file in the given path, with PASS status for all core phases

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -set_last_core_phase_to_fail(test_dir_path, test_name)[source]
      +set_last_core_phase_to_fail(test_dir_path, test_name)[source]

      Sets the last core phase to FAIL

      Returns the name of this phase

      -static set_phase_to_status(test_dir_path, test_name, phase, status)[source]
      +static set_phase_to_status(test_dir_path, test_name, phase, status)[source]

      Sets the given phase to the given status for this test

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_count_fails()[source]
      +test_count_fails()[source]

      Test the count of fails with three tests

      For first phase of interest: First test FAILs, second PASSes, third FAILs; count should be 2, and this phase should not appear @@ -1636,30 +1826,30 @@

      Submodules
      -test_expected_fails()[source]
      +test_expected_fails()[source]

      With the expected_fails_file flag, expected failures should be flagged as such

      -test_fails_only()[source]
      +test_fails_only()[source]

      With fails_only flag, only fails and pends should appear in the output

      -test_force_rebuild()[source]
      +test_force_rebuild()[source]
      -test_single_test()[source]
      +test_single_test()[source]

      cs_status for a single test should include some minimal expected output

      -test_two_tests()[source]
      +test_two_tests()[source]

      cs_status for two tests (one with a FAIL) should include some minimal expected output

      @@ -1667,100 +1857,100 @@

      Submodules -

      CIME.tests.test_unit_custom_assertions_test_status module

      +

      CIME.tests.test_unit_custom_assertions_test_status module

      This module contains unit tests of CustomAssertionsTestStatus

      -class CIME.tests.test_unit_custom_assertions_test_status.TestCustomAssertions(methodName='runTest')[source]
      +class CIME.tests.test_unit_custom_assertions_test_status.TestCustomAssertions(methodName='runTest')[source]

      Bases: CustomAssertionsTestStatus

      -static output_line(status, test_name, phase, extra='')[source]
      +static output_line(status, test_name, phase, extra='')[source]
      -test_assertCorePhases_missingPhase_fails()[source]
      +test_assertCorePhases_missingPhase_fails()[source]

      assert_core_phases fails if there is a missing phase

      -test_assertCorePhases_passes()[source]
      +test_assertCorePhases_passes()[source]

      assert_core_phases passes when it should

      -test_assertCorePhases_wrongName_fails()[source]
      +test_assertCorePhases_wrongName_fails()[source]

      assert_core_phases fails if the test name is wrong

      -test_assertCorePhases_wrongStatus_fails()[source]
      +test_assertCorePhases_wrongStatus_fails()[source]

      assert_core_phases fails if a phase has the wrong status

      -test_assertPhaseAbsent_fails()[source]
      +test_assertPhaseAbsent_fails()[source]

      assert_phase_absent should fail when the phase is present for the given test_name

      -test_assertPhaseAbsent_passes()[source]
      +test_assertPhaseAbsent_passes()[source]

      assert_phase_absent should pass when the phase is absent for the given test_name

      -test_assertStatusOfPhase_withExtra_passes()[source]
      +test_assertStatusOfPhase_withExtra_passes()[source]

      Make sure assert_status_of_phase passes when there is some extra text at the end of the line

      -test_assertStatusOfPhase_xfailExpected_fails()[source]
      +test_assertStatusOfPhase_xfailExpected_fails()[source]

      assert_status_of_phase should fail when xfail=’expected’ but the line does NOT contain the EXPECTED comment

      -test_assertStatusOfPhase_xfailExpected_passes()[source]
      +test_assertStatusOfPhase_xfailExpected_passes()[source]

      assert_status_of_phase should pass when xfail=’expected’ and the line contains the EXPECTED comment

      -test_assertStatusOfPhase_xfailNo_fails()[source]
      +test_assertStatusOfPhase_xfailNo_fails()[source]

      assert_status_of_phase should fail when xfail=’no’ but the line contains the EXPECTED comment

      -test_assertStatusOfPhase_xfailNo_passes()[source]
      +test_assertStatusOfPhase_xfailNo_passes()[source]

      assert_status_of_phase should pass when xfail=’no’ and there is no EXPECTED/UNEXPECTED on the line

      -test_assertStatusOfPhase_xfailUnexpected_fails()[source]
      +test_assertStatusOfPhase_xfailUnexpected_fails()[source]

      assert_status_of_phase should fail when xfail=’unexpected’ but the line does NOT contain the UNEXPECTED comment

      -test_assertStatusOfPhase_xfailUnexpected_passes()[source]
      +test_assertStatusOfPhase_xfailUnexpected_passes()[source]

      assert_status_of_phase should pass when xfail=’unexpected’ and the line contains the UNEXPECTED comment

      @@ -1769,52 +1959,52 @@

      Submodules -

      CIME.tests.test_unit_doctest module

      +

      CIME.tests.test_unit_doctest module

      -class CIME.tests.test_unit_doctest.TestDocs(methodName='runTest')[source]
      +class CIME.tests.test_unit_doctest.TestDocs(methodName='runTest')[source]

      Bases: BaseTestCase

      -test_lib_docs()[source]
      +test_lib_docs()[source]
      -

      CIME.tests.test_unit_expected_fails_file module

      +

      CIME.tests.test_unit_expected_fails_file module

      -class CIME.tests.test_unit_expected_fails_file.TestExpectedFailsFile(methodName='runTest')[source]
      +class CIME.tests.test_unit_expected_fails_file.TestExpectedFailsFile(methodName='runTest')[source]

      Bases: TestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_basic()[source]
      +test_basic()[source]

      Basic test of the parsing of an expected fails file

      -test_invalid_file()[source]
      +test_invalid_file()[source]

      Given an invalid file, an exception should be raised in schema validation

      -test_same_test_appears_twice()[source]
      +test_same_test_appears_twice()[source]

      If the same test appears twice, its information should be appended.

      This is not the typical, expected layout of the file, but it should be handled correctly in case the file is written this way.

      @@ -1824,34 +2014,34 @@

      Submodules -

      CIME.tests.test_unit_grids module

      +

      CIME.tests.test_unit_grids module

      This module tests some functionality of CIME.XML.grids

      -class CIME.tests.test_unit_grids.TestComponentGrids(methodName='runTest')[source]
      +class CIME.tests.test_unit_grids.TestComponentGrids(methodName='runTest')[source]

      Bases: TestCase

      Tests the _ComponentGrids helper class defined in CIME.XML.grids

      -test_check_num_elements_right_ndomains()[source]
      +test_check_num_elements_right_ndomains()[source]

      With the right number of domains for a component, check_num_elements should pass

      -test_check_num_elements_right_nmaps()[source]
      +test_check_num_elements_right_nmaps()[source]

      With the right number of maps between two components, check_num_elements should pass

      -test_check_num_elements_wrong_ndomains()[source]
      +test_check_num_elements_wrong_ndomains()[source]

      With the wrong number of domains for a component, check_num_elements should fail

      -test_check_num_elements_wrong_nmaps()[source]
      +test_check_num_elements_wrong_nmaps()[source]

      With the wrong number of maps between two components, check_num_elements should fail

      @@ -1859,55 +2049,55 @@

      Submodules
      -class CIME.tests.test_unit_grids.TestGrids(methodName='runTest')[source]
      +class CIME.tests.test_unit_grids.TestGrids(methodName='runTest')[source]

      Bases: TestCase

      Tests some functionality of CIME.XML.grids

      Note that much of the functionality of CIME.XML.grids is NOT covered here

      -assert_grid_info_f09_g17(grid_info)[source]
      +assert_grid_info_f09_g17(grid_info)[source]

      Asserts that expected grid info is present and correct when using _MODEL_GRID_F09_G17

      -assert_grid_info_f09_g17_3glc(grid_info)[source]
      +assert_grid_info_f09_g17_3glc(grid_info)[source]

      Asserts that all domain info is present & correct for _MODEL_GRID_F09_G17_3GLC

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_get_grid_info_3glc()[source]
      +test_get_grid_info_3glc()[source]

      Test of get_grid_info with 3 glc grids

      -test_get_grid_info_basic()[source]
      +test_get_grid_info_basic()[source]

      Basic test of get_grid_info

      -test_get_grid_info_extra_gridmaps()[source]
      +test_get_grid_info_extra_gridmaps()[source]

      Test of get_grid_info with some extra gridmaps

      -test_get_grid_info_extra_required_gridmaps()[source]
      +test_get_grid_info_extra_required_gridmaps()[source]

      Test of get_grid_info with some extra required gridmaps

      @@ -1915,38 +2105,38 @@

      Submodules
      -class CIME.tests.test_unit_grids.TestGridsFunctions(methodName='runTest')[source]
      +class CIME.tests.test_unit_grids.TestGridsFunctions(methodName='runTest')[source]

      Bases: TestCase

      Tests helper functions defined in CIME.XML.grids

      These tests are in a separate class to avoid the unnecessary setUp and tearDown function of the main test class.

      -test_add_grid_info_existing()[source]
      +test_add_grid_info_existing()[source]

      Test of _add_grid_info when the given key already exists

      -test_add_grid_info_existing_with_value_for_multiple()[source]
      +test_add_grid_info_existing_with_value_for_multiple()[source]

      Test of _add_grid_info when the given key already exists and value_for_multiple is provided

      -test_add_grid_info_initial()[source]
      +test_add_grid_info_initial()[source]

      Test of _add_grid_info for the initial add of a given key

      -test_strip_grid_from_name_badname()[source]
      +test_strip_grid_from_name_badname()[source]

      _strip_grid_from_name should raise an exception for a name not ending with _grid

      -test_strip_grid_from_name_basic()[source]
      +test_strip_grid_from_name_basic()[source]

      Basic test of _strip_grid_from_name

      @@ -1954,105 +2144,105 @@

      Submodules -

      CIME.tests.test_unit_hist_utils module

      +

      CIME.tests.test_unit_hist_utils module

      -class CIME.tests.test_unit_hist_utils.TestHistUtils(methodName='runTest')[source]
      +class CIME.tests.test_unit_hist_utils.TestHistUtils(methodName='runTest')[source]

      Bases: TestCase

      -test_copy_histfiles(safe_copy)[source]
      +test_copy_histfiles(safe_copy)[source]
      -test_copy_histfiles_exclude(safe_copy)[source]
      +test_copy_histfiles_exclude(safe_copy)[source]

      -

      CIME.tests.test_unit_nmlgen module

      +

      CIME.tests.test_unit_nmlgen module

      -class CIME.tests.test_unit_nmlgen.TestNamelistGenerator(methodName='runTest')[source]
      +class CIME.tests.test_unit_nmlgen.TestNamelistGenerator(methodName='runTest')[source]

      Bases: TestCase

      -test_init_defaults()[source]
      +test_init_defaults()[source]
      -

      CIME.tests.test_unit_paramgen module

      +

      CIME.tests.test_unit_paramgen module

      This module tests some functionality of CIME.ParamGen.paramgen’s ParamGen class

      -class CIME.tests.test_unit_paramgen.DummyCase[source]
      +class CIME.tests.test_unit_paramgen.DummyCase[source]

      Bases: object

      A dummy Case class that mimics CIME class objects’ get_value method.

      -get_value(varname)[source]
      +get_value(varname)[source]
      -class CIME.tests.test_unit_paramgen.TestParamGen(methodName='runTest')[source]
      +class CIME.tests.test_unit_paramgen.TestParamGen(methodName='runTest')[source]

      Bases: TestCase

      Tests some basic functionality of the CIME.ParamGen.paramgen’s ParamGen class

      -test_expandable_vars()[source]
      +test_expandable_vars()[source]

      Tests the reduce method of ParamGen expandable vars in guards.

      -test_formula_expansion()[source]
      +test_formula_expansion()[source]

      Tests the formula expansion feature of ParamGen.

      -test_init_data()[source]
      +test_init_data()[source]

      Tests the ParamGen initializer with and without an initial data.

      -test_match()[source]
      +test_match()[source]

      Tests the default behavior of returning the last match and the optional behavior of returning the first match.

      -test_nested_reduce()[source]
      +test_nested_reduce()[source]

      Tests the reduce method of ParamGen on data with nested guards.

      -test_outer_guards()[source]
      +test_outer_guards()[source]

      Tests the reduce method on data with outer guards enclosing parameter definitions.

      -test_reduce()[source]
      +test_reduce()[source]

      Tests the reduce method of ParamGen on data with explicit guards (True or False).

      -test_undefined_var()[source]
      +test_undefined_var()[source]

      Tests the reduce method of ParamGen on nested guards where an undefined expandable var is specified below a guard that evaluates to False. The undefined var should not lead to an error since the enclosing guard evaluates to false.

      @@ -2062,44 +2252,44 @@

      Submodules
      -class CIME.tests.test_unit_paramgen.TestParamGenXmlConstructor(methodName='runTest')[source]
      +class CIME.tests.test_unit_paramgen.TestParamGenXmlConstructor(methodName='runTest')[source]

      Bases: TestCase

      A unit test class for testing ParamGen’s xml constructor.

      -test_default_var()[source]
      +test_default_var()[source]

      Test to check if default val is assigned when all guards eval to False

      -test_duplicate_entry_error()[source]
      +test_duplicate_entry_error()[source]

      Test to make sure duplicate ids raise the correct error when the “no_duplicates” flag is True.

      -test_mixed_guard()[source]
      +test_mixed_guard()[source]

      Tests multiple key=value guards mixed with explicit (flexible) guards.

      -test_mixed_guard_first()[source]
      +test_mixed_guard_first()[source]

      Tests multiple key=value guards mixed with explicit (flexible) guards with match=first option.

      -test_no_match()[source]
      +test_no_match()[source]

      Tests an xml entry with no match, i.e., no guards evaluating to True.

      -test_single_key_val_guard()[source]
      +test_single_key_val_guard()[source]

      Test xml entry values with single key=value guards

      @@ -2107,18 +2297,18 @@

      Submodules
      -class CIME.tests.test_unit_paramgen.TestParamGenYamlConstructor(methodName='runTest')[source]
      +class CIME.tests.test_unit_paramgen.TestParamGenYamlConstructor(methodName='runTest')[source]

      Bases: TestCase

      A unit test class for testing ParamGen’s yaml constructor.

      -test_input_data_list()[source]
      +test_input_data_list()[source]

      Test mom.input_data_list file generation via a subset of original input_data_list.yaml

      -test_mom_input()[source]
      +test_mom_input()[source]

      Test MOM_input file generation via a subset of original MOM_input.yaml

      @@ -2126,83 +2316,143 @@

      Submodules -

      CIME.tests.test_unit_system_tests module

      +

      CIME.tests.test_unit_system_tests module

      -
      -class CIME.tests.test_unit_system_tests.TestCaseSubmit(methodName='runTest')[source]
      +
      +class CIME.tests.test_unit_system_tests.TestUnitSystemTests(methodName='runTest')[source]

      Bases: TestCase

      -
      -test_dry_run()[source]
      +
      +test_check_for_memleak(get_latest_cpl_logs, _perf_get_memory, append_testlog, load_coupler_customization)[source]
      +
      + +
      +
      +test_check_for_memleak_found(get_latest_cpl_logs, _perf_get_memory, append_testlog, load_coupler_customization)[source]
      +
      + +
      +
      +test_check_for_memleak_not_enough_samples(get_latest_cpl_logs, _perf_get_memory, append_testlog, load_coupler_customization)[source]
      +
      + +
      +
      +test_check_for_memleak_runtime_error(get_latest_cpl_logs, _perf_get_memory, append_testlog, load_coupler_customization)[source]
      +
      + +
      +
      +test_compare_memory(append_testlog, perf_compare_memory_baseline)[source]
      +
      + +
      +
      +test_compare_memory_erorr_diff(append_testlog, perf_compare_memory_baseline)[source]
      +
      + +
      +
      +test_compare_memory_erorr_fail(append_testlog, perf_compare_memory_baseline)[source]
      +
      + +
      +
      +test_compare_throughput(append_testlog, perf_compare_throughput_baseline)[source]
      +
      + +
      +
      +test_compare_throughput_error_diff(append_testlog, perf_compare_throughput_baseline)[source]
      +
      + +
      +
      +test_compare_throughput_fail(append_testlog, perf_compare_throughput_baseline)[source]
      +
      + +
      +
      +test_dry_run()[source]
      +
      + +
      +
      +test_generate_baseline()[source]
      -
      -test_kwargs()[source]
      +
      +test_kwargs()[source]
      +
      +
      +CIME.tests.test_unit_system_tests.create_mock_case(tempdir, idx=None, cpllog_data=None)[source]
      +
      +

      -

      CIME.tests.test_unit_test_status module

      +

      CIME.tests.test_unit_test_status module

      -class CIME.tests.test_unit_test_status.TestTestStatus(methodName='runTest')[source]
      +class CIME.tests.test_unit_test_status.TestTestStatus(methodName='runTest')[source]

      Bases: CustomAssertionsTestStatus

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_current_is()[source]
      +test_current_is()[source]
      -test_get_latest_phase()[source]
      +test_get_latest_phase()[source]
      -test_psdump_corePhasesPass()[source]
      +test_psdump_corePhasesPass()[source]
      -test_psdump_oneCorePhaseFails()[source]
      +test_psdump_oneCorePhaseFails()[source]
      -test_psdump_oneCorePhaseFailsAbsentFromXFails()[source]
      +test_psdump_oneCorePhaseFailsAbsentFromXFails()[source]

      One phase fails. There is an expected fails list, but that phase is not in it.

      -test_psdump_oneCorePhaseFailsInXFails()[source]
      +test_psdump_oneCorePhaseFailsInXFails()[source]

      One phase fails. That phase is in the expected fails list.

      -test_psdump_oneCorePhasePassesInXFails()[source]
      +test_psdump_oneCorePhasePassesInXFails()[source]

      One phase passes despite being in the expected fails list.

      -test_psdump_skipPasses()[source]
      +test_psdump_skipPasses()[source]

      With the skip_passes argument, only non-passes should appear

      -test_psdump_unexpectedPass_shouldBePresent()[source]
      +test_psdump_unexpectedPass_shouldBePresent()[source]

      Even with the skip_passes argument, an unexpected PASS should be present

      @@ -2210,22 +2460,22 @@

      Submodules -

      CIME.tests.test_unit_two_link_to_case2_output module

      +

      CIME.tests.test_unit_two_link_to_case2_output module

      This module contains unit tests of the method SystemTestsCompareTwo._link_to_case2_output

      +class CIME.tests.test_unit_two_link_to_case2_output.SystemTestsCompareTwoFake(case1, run_two_suffix='test')[source]

      Bases: SystemTestsCompareTwo

      +class CIME.tests.test_unit_two_link_to_case2_output.TestLinkToCase2Output(methodName='runTest')[source]

      Bases: TestCase

      +create_file_in_rundir2(mytest, core_filename, run2_suffix)[source]

      Creates a file in rundir2 named CASE2.CORE_FILENAME.nc.RUN2_SUFFIX (where CASE2 is the casename of case2)

      Returns full path to the file created

      @@ -2233,51 +2483,51 @@

      Submodules +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      +setup_test_and_directories(casename1, run2_suffix)[source]

      Returns test object

      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      +test_basic()[source]
      +test_existing_link()[source]
      -

      CIME.tests.test_unit_user_mod_support module

      +

      CIME.tests.test_unit_user_mod_support module

      -class CIME.tests.test_unit_user_mod_support.TestUserModSupport(methodName='runTest')[source]
      +class CIME.tests.test_unit_user_mod_support.TestUserModSupport(methodName='runTest')[source]

      Bases: TestCase

      -assertResults(expected_user_nl_cpl, expected_shell_commands_result, expected_sourcemod, msg='')[source]
      +assertResults(expected_user_nl_cpl, expected_shell_commands_result, expected_sourcemod, msg='')[source]

      Asserts that the contents of the files in self._caseroot match expectations

      If msg is provided, it is printed for some failing assertions

      -createUserMod(name, include_dirs=None)[source]
      +createUserMod(name, include_dirs=None)[source]

      Create a user_mods directory with the given name.

      This directory is created within self._user_mods_parent_dir

      For name=’foo’, it will contain:

      @@ -2298,42 +2548,42 @@

      Submodules
      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_basic()[source]
      +test_basic()[source]
      -test_duplicate_includes()[source]
      +test_duplicate_includes()[source]

      Test multiple includes, where both include the same base mod.

      The base mod should only be included once.

      -test_include()[source]
      +test_include()[source]

      If there is an included mod, the main one should appear after the included one so that it takes precedence.

      -test_keepexe()[source]
      +test_keepexe()[source]
      -test_two_applications()[source]
      +test_two_applications()[source]

      If apply_user_mods is called twice, the second should appear after the first so that it takes precedence.

      @@ -2341,14 +2591,14 @@

      Submodules -

      CIME.tests.test_unit_user_nl_utils module

      +

      CIME.tests.test_unit_user_nl_utils module

      -class CIME.tests.test_unit_user_nl_utils.TestUserNLCopier(methodName='runTest')[source]
      +class CIME.tests.test_unit_user_nl_utils.TestUserNLCopier(methodName='runTest')[source]

      Bases: TestCase

      -assertFileContentsEqual(expected, filepath, msg=None)[source]
      +assertFileContentsEqual(expected, filepath, msg=None)[source]

      Asserts that the contents of the file given by ‘filepath’ are equal to the string given by ‘expected’. ‘msg’ gives an optional message to be printed if the assertion fails.

      @@ -2356,39 +2606,39 @@

      Submodules
      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_append()[source]
      +test_append()[source]
      -test_append_list()[source]
      +test_append_list()[source]
      -test_append_multiple_files()[source]
      +test_append_multiple_files()[source]
      -test_append_without_files_raises_exception()[source]
      +test_append_without_files_raises_exception()[source]
      -write_user_nl_file(component, contents, suffix='')[source]
      +write_user_nl_file(component, contents, suffix='')[source]

      Write contents to a user_nl file in the case directory. Returns the basename (i.e., not the full path) of the file that is created.

      For a component foo, with the default suffix of ‘’, the file name will @@ -2400,45 +2650,45 @@

      Submodules -

      CIME.tests.test_unit_utils module

      +

      CIME.tests.test_unit_utils module

      -class CIME.tests.test_unit_utils.MockTime[source]
      +class CIME.tests.test_unit_utils.MockTime[source]

      Bases: object

      -class CIME.tests.test_unit_utils.TestFileContainsPythonFunction(methodName='runTest')[source]
      +class CIME.tests.test_unit_utils.TestFileContainsPythonFunction(methodName='runTest')[source]

      Bases: TestCase

      Tests of file_contains_python_function

      -create_test_file(contents)[source]
      +create_test_file(contents)[source]

      Creates a test file with the given contents, and returns the path to that file

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -tearDown()[source]
      +tearDown()[source]

      Hook method for deconstructing the test fixture after testing it.

      -test_contains_correct_def_and_others()[source]
      +test_contains_correct_def_and_others()[source]

      Test file_contains_python_function with a correct def mixed with other defs

      -test_does_not_contain_correct_def()[source]
      +test_does_not_contain_correct_def()[source]

      Test file_contains_python_function without the correct def

      @@ -2446,18 +2696,18 @@

      Submodules
      -class CIME.tests.test_unit_utils.TestIndentStr(methodName='runTest')[source]
      +class CIME.tests.test_unit_utils.TestIndentStr(methodName='runTest')[source]

      Bases: TestCase

      Test the indent_string function.

      -test_indent_string_multiline()[source]
      +test_indent_string_multiline()[source]

      Test the indent_string function with a multi-line string

      -test_indent_string_singleline()[source]
      +test_indent_string_singleline()[source]

      Test the indent_string function with a single-line string

      @@ -2465,84 +2715,84 @@

      Submodules
      -class CIME.tests.test_unit_utils.TestLineDefinesPythonFunction(methodName='runTest')[source]
      +class CIME.tests.test_unit_utils.TestLineDefinesPythonFunction(methodName='runTest')[source]

      Bases: TestCase

      Tests of _line_defines_python_function

      -test_def_barfoo()[source]
      +test_def_barfoo()[source]

      Test of a def of a different function

      -test_def_foo()[source]
      +test_def_foo()[source]

      Test of a def of the function of interest

      -test_def_foo_indented()[source]
      +test_def_foo_indented()[source]

      Test of a def of the function of interest, but indented

      -test_def_foo_no_parens()[source]
      +test_def_foo_no_parens()[source]

      Test of a def of the function of interest, but without parentheses

      -test_def_foo_space()[source]
      +test_def_foo_space()[source]

      Test of a def of the function of interest, with an extra space before the parentheses

      -test_def_foobar()[source]
      +test_def_foobar()[source]

      Test of a def of a different function

      -test_import_barfoo()[source]
      +test_import_barfoo()[source]

      Test of an import of a different function

      -test_import_foo()[source]
      +test_import_foo()[source]

      Test of an import of the function of interest

      -test_import_foo_indented()[source]
      +test_import_foo_indented()[source]

      Test of an import of the function of interest, but indented

      -test_import_foo_space()[source]
      +test_import_foo_space()[source]

      Test of an import of the function of interest, with trailing spaces

      -test_import_foo_then_others()[source]
      +test_import_foo_then_others()[source]

      Test of an import of the function of interest, along with others

      -test_import_foobar()[source]
      +test_import_foobar()[source]

      Test of an import of a different function

      -test_import_others_then_foo()[source]
      +test_import_others_then_foo()[source]

      Test of an import of the function of interest, after others

      @@ -2550,303 +2800,323 @@

      Submodules
      -class CIME.tests.test_unit_utils.TestUtils(methodName='runTest')[source]
      +class CIME.tests.test_unit_utils.TestUtils(methodName='runTest')[source]

      Bases: TestCase

      -assertMatchAllLines(tempdir, test_lines)[source]
      +assertMatchAllLines(tempdir, test_lines)[source]
      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_copy_globs(safe_copy, glob)[source]
      +test_copy_globs(safe_copy, glob)[source]
      -test_import_and_run_sub_or_cmd()[source]
      +test_import_and_run_sub_or_cmd()[source]
      -test_import_and_run_sub_or_cmd_cime_py(importmodule)[source]
      +test_import_and_run_sub_or_cmd_cime_py(importmodule)[source]
      -test_import_and_run_sub_or_cmd_import(importmodule)[source]
      +test_import_and_run_sub_or_cmd_import(importmodule)[source]
      -test_import_and_run_sub_or_cmd_run(func, isfile)[source]
      +test_import_and_run_sub_or_cmd_run(func, isfile)[source]
      -test_import_from_file()[source]
      +test_import_from_file()[source]
      -test_run_and_log_case_status()[source]
      +test_run_and_log_case_status()[source]
      -test_run_and_log_case_status_case_submit_error_on_batch()[source]
      +test_run_and_log_case_status_case_submit_error_on_batch()[source]
      -test_run_and_log_case_status_case_submit_no_batch()[source]
      +test_run_and_log_case_status_case_submit_no_batch()[source]
      -test_run_and_log_case_status_case_submit_on_batch()[source]
      +test_run_and_log_case_status_case_submit_on_batch()[source]
      -test_run_and_log_case_status_custom_msg()[source]
      +test_run_and_log_case_status_custom_msg()[source]
      -test_run_and_log_case_status_custom_msg_error_on_batch()[source]
      +test_run_and_log_case_status_custom_msg_error_on_batch()[source]
      -test_run_and_log_case_status_error()[source]
      +test_run_and_log_case_status_error()[source]

      -CIME.tests.test_unit_utils.match_all_lines(data, lines)[source]
      +CIME.tests.test_unit_utils.match_all_lines(data, lines)[source]
      -

      CIME.tests.test_unit_xml_archive_base module

      +

      CIME.tests.test_unit_xml_archive_base module

      -class CIME.tests.test_unit_xml_archive_base.TestXMLArchiveBase(methodName='runTest')[source]
      +class CIME.tests.test_unit_xml_archive_base.TestXMLArchiveBase(methodName='runTest')[source]

      Bases: TestCase

      -test_exclude_testing()[source]
      +test_exclude_testing()[source]
      -test_extension_included()[source]
      +test_extension_included()[source]
      -test_match_files()[source]
      +test_match_files()[source]
      -test_suffix()[source]
      +test_suffix()[source]
      -

      CIME.tests.test_unit_xml_env_batch module

      +

      CIME.tests.test_unit_xml_env_batch module

      -class CIME.tests.test_unit_xml_env_batch.TestXMLEnvBatch(methodName='runTest')[source]
      +class CIME.tests.test_unit_xml_env_batch.TestXMLEnvBatch(methodName='runTest')[source]

      Bases: TestCase

      +
      +
      +test_get_job_deps()[source]
      +
      +
      -test_get_queue_specs(get)[source]
      +test_get_queue_specs(get)[source]
      -test_get_submit_args()[source]
      +test_get_submit_args()[source]
      -test_get_submit_args_job_queue()[source]
      +test_get_submit_args_job_queue()[source]
      -test_set_job_defaults(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      +test_set_job_defaults(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      -test_set_job_defaults_honor_walltimemax(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      +test_set_job_defaults_honor_walltimemax(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      -test_set_job_defaults_honor_walltimemin(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      +test_set_job_defaults_honor_walltimemin(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      -test_set_job_defaults_user_walltime(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      +test_set_job_defaults_user_walltime(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      -test_set_job_defaults_walltimedef(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      +test_set_job_defaults_walltimedef(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      -test_set_job_defaults_walltimemax_none(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      +test_set_job_defaults_walltimemax_none(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      -test_set_job_defaults_walltimemin_none(get_default_queue, select_best_queue, get_queue_specs, text)[source]
      +test_set_job_defaults_walltimemin_none(get_default_queue, select_best_queue, get_queue_specs, text)[source] +
      + +
      +
      +test_submit_jobs(_submit_single_job)[source]
      +
      + +
      +
      +test_submit_jobs_dependency(_submit_single_job, get_batch_script_for_job, isfile)[source]
      +
      + +
      +
      +test_submit_jobs_single(_submit_single_job, get_batch_script_for_job, isfile)[source]
      -

      CIME.tests.test_unit_xml_env_mach_specific module

      +

      CIME.tests.test_unit_xml_env_mach_specific module

      -class CIME.tests.test_unit_xml_env_mach_specific.TestXMLEnvMachSpecific(methodName='runTest')[source]
      +class CIME.tests.test_unit_xml_env_mach_specific.TestXMLEnvMachSpecific(methodName='runTest')[source]

      Bases: TestCase

      -test_aprun_get_args()[source]
      +test_aprun_get_args()[source]
      -test_cmd_path(text, get_optional_child)[source]
      +test_cmd_path(text, get_optional_child)[source]
      -test_find_best_mpirun_match()[source]
      +test_find_best_mpirun_match()[source]
      -test_get_aprun_mode_default()[source]
      +test_get_aprun_mode_default()[source]
      -test_get_aprun_mode_not_valid()[source]
      +test_get_aprun_mode_not_valid()[source]
      -test_get_aprun_mode_user_defined()[source]
      +test_get_aprun_mode_user_defined()[source]
      -test_get_mpirun()[source]
      +test_get_mpirun()[source]
      -test_init_path(text, get_optional_child)[source]
      +test_init_path(text, get_optional_child)[source]
      -

      CIME.tests.test_unit_xml_machines module

      +

      CIME.tests.test_unit_xml_machines module

      -class CIME.tests.test_unit_xml_machines.TestUnitXMLMachines(methodName='runTest')[source]
      +class CIME.tests.test_unit_xml_machines.TestUnitXMLMachines(methodName='runTest')[source]

      Bases: TestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_has_batch_system()[source]
      +test_has_batch_system()[source]
      -test_is_valid_MPIlib()[source]
      +test_is_valid_MPIlib()[source]
      -test_is_valid_compiler()[source]
      +test_is_valid_compiler()[source]
      -

      CIME.tests.test_unit_xml_namelist_definition module

      +

      CIME.tests.test_unit_xml_namelist_definition module

      -class CIME.tests.test_unit_xml_namelist_definition.TestXMLNamelistDefinition(methodName='runTest')[source]
      +class CIME.tests.test_unit_xml_namelist_definition.TestXMLNamelistDefinition(methodName='runTest')[source]

      Bases: TestCase

      -test_set_nodes()[source]
      +test_set_nodes()[source]
      -

      CIME.tests.test_unit_xml_tests module

      +

      CIME.tests.test_unit_xml_tests module

      -class CIME.tests.test_unit_xml_tests.TestXMLTests(methodName='runTest')[source]
      +class CIME.tests.test_unit_xml_tests.TestXMLTests(methodName='runTest')[source]

      Bases: TestCase

      -setUp()[source]
      +setUp()[source]

      Hook method for setting up the test fixture before exercising it.

      -test_support_single_exe(_setup_cases_if_not_yet_done)[source]
      +test_support_single_exe(_setup_cases_if_not_yet_done)[source]
      -test_support_single_exe_error(_setup_cases_if_not_yet_done)[source]
      +test_support_single_exe_error(_setup_cases_if_not_yet_done)[source]
      -

      CIME.tests.utils module

      +

      CIME.tests.utils module

      -class CIME.tests.utils.CMakeTester(parent, cmake_string)[source]
      +class CIME.tests.utils.CMakeTester(parent, cmake_string)[source]

      Bases: object

      Helper class for checking CMake output.

      Public methods: @@ -2856,7 +3126,7 @@

      Submodules
      -assert_variable_equals(var_name, value, env=None, var=None)[source]
      +assert_variable_equals(var_name, value, env=None, var=None)[source]

      Assert that a variable in the CMakeLists has a given value.

      Arguments: var_name - Name of variable to check. @@ -2867,7 +3137,7 @@

      Submodules
      -assert_variable_matches(var_name, regex, env=None, var=None)[source]
      +assert_variable_matches(var_name, regex, env=None, var=None)[source]

      Assert that a variable in the CMkeLists matches a regex.

      Arguments: var_name - Name of variable to check. @@ -2878,7 +3148,7 @@

      Submodules
      -query_var(var_name, env, var)[source]
      +query_var(var_name, env, var)[source]

      Request the value of a variable in Macros.cmake, as a string.

      Arguments: var_name - Name of the variable to query. @@ -2893,7 +3163,7 @@

      Submodules
      -class CIME.tests.utils.MakefileTester(parent, make_string)[source]
      +class CIME.tests.utils.MakefileTester(parent, make_string)[source]

      Bases: object

      Helper class for checking Makefile output.

      Public methods: @@ -2903,7 +3173,7 @@

      Submodules
      -assert_variable_equals(var_name, value, env=None, var=None)[source]
      +assert_variable_equals(var_name, value, env=None, var=None)[source]

      Assert that a variable in the Makefile has a given value.

      Arguments: var_name - Name of variable to check. @@ -2914,7 +3184,7 @@

      Submodules
      -assert_variable_matches(var_name, regex, env=None, var=None)[source]
      +assert_variable_matches(var_name, regex, env=None, var=None)[source]

      Assert that a variable in the Makefile matches a regex.

      Arguments: var_name - Name of variable to check. @@ -2925,7 +3195,7 @@

      Submodules
      -query_var(var_name, env, var)[source]
      +query_var(var_name, env, var)[source]

      Request the value of a variable in the Makefile, as a string.

      Arguments: var_name - Name of the variable to query. @@ -2946,40 +3216,40 @@

      Submodules
      -class CIME.tests.utils.MockMachines(name, os_)[source]
      +class CIME.tests.utils.MockMachines(name, os_)[source]

      Bases: object

      A mock version of the Machines object to simplify testing.

      -get_default_MPIlib(attributes=None)[source]
      +get_default_MPIlib(attributes=None)[source]
      -get_default_compiler()[source]
      +get_default_compiler()[source]
      -get_machine_name()[source]
      +get_machine_name()[source]

      Return the name we were given.

      -get_value(var_name)[source]
      +get_value(var_name)[source]

      Allow the operating system to be queried.

      -is_valid_MPIlib(_)[source]
      +is_valid_MPIlib(_)[source]

      Assume all MPILIB settings are valid.

      -is_valid_compiler(_)[source]
      +is_valid_compiler(_)[source]

      Assume all compilers are valid.

      @@ -2987,64 +3257,64 @@

      Submodules
      -class CIME.tests.utils.Mocker(ret=None, cmd=None, return_value=None, side_effect=None)[source]
      +class CIME.tests.utils.Mocker(ret=None, cmd=None, return_value=None, side_effect=None)[source]

      Bases: object

      -assert_called()[source]
      +assert_called()[source]
      -assert_called_with(i=None, args=None, kwargs=None)[source]
      +assert_called_with(i=None, args=None, kwargs=None)[source]
      -property calls
      +property calls
      -property method_calls
      +property method_calls
      -patch(module, method=None, ret=None, is_property=False, update_value_only=False)[source]
      +patch(module, method=None, ret=None, is_property=False, update_value_only=False)[source]
      -property ret
      +property ret
      -revert_mocks()[source]
      +revert_mocks()[source]

      -class CIME.tests.utils.TemporaryDirectory[source]
      +class CIME.tests.utils.TemporaryDirectory[source]

      Bases: object

      -CIME.tests.utils.make_fake_teststatus(path, testname, status, phase)[source]
      +CIME.tests.utils.make_fake_teststatus(path, testname, status, phase)[source]
      -CIME.tests.utils.parse_test_status(line)[source]
      +CIME.tests.utils.parse_test_status(line)[source]
      -

      Module contents

      +

      Module contents

      diff --git a/versions/master/html/CIME_api/modules.html b/versions/master/html/CIME_api/modules.html index 7b8181b6b6f..ad6d45e55f5 100644 --- a/versions/master/html/CIME_api/modules.html +++ b/versions/master/html/CIME_api/modules.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -90,7 +90,7 @@
      -

      CIME

      +

      CIME

      • CIME package
      • +
      • CIME.baselines package +
      • CIME.build_scripts package @@ -258,6 +264,7 @@

        CIME
      • CIME.tests.test_sys_user_concurrent_mods module
      • CIME.tests.test_sys_wait_for_tests module
      • CIME.tests.test_unit_aprun module
      • +
      • CIME.tests.test_unit_baselines_performance module
      • CIME.tests.test_unit_case module
      • CIME.tests.test_unit_case_fake module
      • CIME.tests.test_unit_case_setup module
      • @@ -297,8 +304,10 @@

        CIME

      • CIME.bless_test_results module
      • CIME.build module
          @@ -348,10 +357,12 @@

          CIME

      • CIME.config module @@ -546,6 +558,7 @@

        CIME

      • SharedArea
      • Timeout
      • +
      • add_flag_to_cmd()
      • add_mail_type_args()
      • analyze_build_log()
      • append_case_status()
      • diff --git a/versions/master/html/Tools_api/Tools.html b/versions/master/html/Tools_api/Tools.html index e1e9fbfdd19..096f049a52e 100644 --- a/versions/master/html/Tools_api/Tools.html +++ b/versions/master/html/Tools_api/Tools.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -111,46 +111,46 @@
        -

        Tools package

        +

        Tools package

        -

        Submodules

        +

        Submodules

        -

        Tools.generate_cylc_workflow module

        +

        Tools.generate_cylc_workflow module

        Generates a cylc workflow file for the case. See https://cylc.github.io for details about cylc

        -Tools.generate_cylc_workflow.cylc_batch_job_template(job, jobname, case, ensemble)[source]
        +Tools.generate_cylc_workflow.cylc_batch_job_template(job, jobname, case, ensemble)[source]
        -Tools.generate_cylc_workflow.cylc_get_case_path_string(case, ensemble)[source]
        +Tools.generate_cylc_workflow.cylc_get_case_path_string(case, ensemble)[source]
        -Tools.generate_cylc_workflow.cylc_get_ensemble_first_and_last(case, ensemble)[source]
        +Tools.generate_cylc_workflow.cylc_get_ensemble_first_and_last(case, ensemble)[source]
        -Tools.generate_cylc_workflow.cylc_script_job_template(job, case, ensemble)[source]
        +Tools.generate_cylc_workflow.cylc_script_job_template(job, case, ensemble)[source]
        -Tools.generate_cylc_workflow.parse_command_line(args, description)[source]
        +Tools.generate_cylc_workflow.parse_command_line(args, description)[source]
        -

        Tools.standard_script_setup module

        +

        Tools.standard_script_setup module

        Encapsulate the importing of python utils and logging setup, things that every script should do.

        -Tools.standard_script_setup.check_minimum_python_version(major, minor)[source]
        +Tools.standard_script_setup.check_minimum_python_version(major, minor)[source]

        Check your python version.

        >>> check_minimum_python_version(sys.version_info[0], sys.version_info[1])
         >>>
        @@ -160,21 +160,21 @@ 

        Submodules -

        Tools.testreporter module

        +

        Tools.testreporter module

        Simple script to populate CESM test database with test results.

        -Tools.testreporter.get_testreporter_xml(testroot, testid, tagname, testtype)[source]
        +Tools.testreporter.get_testreporter_xml(testroot, testid, tagname, testtype)[source]
        -Tools.testreporter.parse_command_line(args)[source]
        +Tools.testreporter.parse_command_line(args)[source]
        -

        Module contents

        +

        Module contents

        diff --git a/versions/master/html/Tools_api/modules.html b/versions/master/html/Tools_api/modules.html index e8b3c898be0..94a6c018fab 100644 --- a/versions/master/html/Tools_api/modules.html +++ b/versions/master/html/Tools_api/modules.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -90,7 +90,7 @@
        -

        Tools

        +

        Tools

        • Tools package
            diff --git a/versions/master/html/Tools_user/advanced-py-prof.html b/versions/master/html/Tools_user/advanced-py-prof.html index 314d3c2444a..c0a1d2b8746 100644 --- a/versions/master/html/Tools_user/advanced-py-prof.html +++ b/versions/master/html/Tools_user/advanced-py-prof.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
            -

            advanced-py-prof

            +

            advanced-py-prof

            advanced-py-prof is a script in CIMEROOT/CIME/Tools.

            @@ -150,9 +150,9 @@ Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code - File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/cProfile.py", line 191, in <module> + File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/cProfile.py", line 191, in <module> main() - File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/cProfile.py", line 171, in main + File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/cProfile.py", line 171, in main with io.open_code(progname) as fp: ^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'basename' diff --git a/versions/master/html/Tools_user/archive_metadata.html b/versions/master/html/Tools_user/archive_metadata.html index 09c6759cb74..0d7af8dae00 100644 --- a/versions/master/html/Tools_user/archive_metadata.html +++ b/versions/master/html/Tools_user/archive_metadata.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
            -

            archive_metadata

            +

            archive_metadata

            archive_metadata is a script in CIMEROOT/CIME/Tools.

            @@ -162,10 +162,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/r - unner/work/cime/cime/CIME/Tools/archive_metadata.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --user USER User name for SVN CESM developer access (required) --password Password for SVN CESM developer access (required) --caseroot CASEROOT Fully quailfied path to case root directory @@ -217,6 +213,12 @@ post argument defaults to posting metadata to the production expdb2.0 web application server at URL "http://csegweb.cgd.ucar.edu/expdb2.0" (optional). + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/r + unner/work/cime/cime/CIME/Tools/archive_metadata.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
        diff --git a/versions/master/html/Tools_user/bld_diff.html b/versions/master/html/Tools_user/bld_diff.html index 47491242429..d2544f881e5 100644 --- a/versions/master/html/Tools_user/bld_diff.html +++ b/versions/master/html/Tools_user/bld_diff.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
        -

        bld_diff

        +

        bld_diff

        bld_diff is a script in CIMEROOT/CIME/Tools.

        @@ -164,6 +164,10 @@ options: -h, --help show this help message and exit + -I, --ignore-includes + Ignore differences in include flags (default: False) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/bld_diff.log (default: False) @@ -171,8 +175,6 @@ (default: False) -s, --silent Print only warnings and error messages (default: False) - -I, --ignore-includes - Ignore differences in include flags (default: False)
      diff --git a/versions/master/html/Tools_user/bless_test_results.html b/versions/master/html/Tools_user/bless_test_results.html index 5914e7b64b7..5224cb102f3 100644 --- a/versions/master/html/Tools_user/bless_test_results.html +++ b/versions/master/html/Tools_user/bless_test_results.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,12 +142,12 @@
      -

      bless_test_results

      +

      bless_test_results

      bless_test_results is a script in CIMEROOT/CIME/Tools.

      $ ./bless_test_results --help
      -ERROR:  xmllint not found in PATH, xmllint is required for cime.  PATH=/opt/hostedtoolcache/Python/3.11.4/x64/bin:/opt/hostedtoolcache/Python/3.11.4/x64:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
      +ERROR:  xmllint not found in PATH, xmllint is required for cime.  PATH=/opt/hostedtoolcache/Python/3.11.5/x64/bin:/opt/hostedtoolcache/Python/3.11.5/x64:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
       
      diff --git a/versions/master/html/Tools_user/case.build.html b/versions/master/html/Tools_user/case.build.html index 6715493c7b8..70a6e3c4006 100644 --- a/versions/master/html/Tools_user/case.build.html +++ b/versions/master/html/Tools_user/case.build.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      case.build

      +

      case.build

      case.build is a script in CIMEROOT/CIME/Tools.

      @@ -202,9 +202,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.build.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --ninja Use ninja backed for CMake (instead of gmake). The ninja backend is better at scanning fortran dependencies but seems to be less reliable across different platforms and compilers. --separate-builds Build each component one at a time, separately, with output going to separate logs --skip-submit Sets the current test phase to RUN, skipping the SUBMIT phase. This may be useful if rebuilding the model while this test is in the batch queue. ONLY USE IF A TEST CASE, OTHERWISE IGNORED. @@ -225,6 +222,11 @@ Clean Depends and Srcfiles only. This allows you to rebuild after adding new files in the source tree or in SourceMods. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.build.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
      diff --git a/versions/master/html/Tools_user/case.cmpgen_namelists.html b/versions/master/html/Tools_user/case.cmpgen_namelists.html index 9cf690fe695..23530e3efd6 100644 --- a/versions/master/html/Tools_user/case.cmpgen_namelists.html +++ b/versions/master/html/Tools_user/case.cmpgen_namelists.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      case.cmpgen_namelists

      +

      case.cmpgen_namelists

      case.cmpgen_namelists is a script in CIMEROOT/CIME/Tools.

      @@ -162,9 +162,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.cmpgen_namelists.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages -c, --compare Force a namelist comparison against baselines. Default is to follow the case specification. -g, --generate Force a generation of namelist baselines. @@ -178,6 +175,11 @@ --baseline-root BASELINE_ROOT Root of baselines. Default is the case's BASELINE_ROOT. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.cmpgen_namelists.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
      diff --git a/versions/master/html/Tools_user/case.qstatus.html b/versions/master/html/Tools_user/case.qstatus.html index 993037f1f01..7973c7c6642 100644 --- a/versions/master/html/Tools_user/case.qstatus.html +++ b/versions/master/html/Tools_user/case.qstatus.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      case.qstatus

      +

      case.qstatus

      case.qstatus is a script in CIMEROOT/CIME/Tools.

      @@ -160,6 +160,8 @@ options: -h, --help show this help message and exit + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.qstatus.log -v, --verbose Add additional context (time and file) to log messages -s, --silent Print only warnings and error messages diff --git a/versions/master/html/Tools_user/case.setup.html b/versions/master/html/Tools_user/case.setup.html index d5755875c0c..3858bd303b9 100644 --- a/versions/master/html/Tools_user/case.setup.html +++ b/versions/master/html/Tools_user/case.setup.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      case.setup

      +

      case.setup

      case.setup is a script in CIMEROOT/CIME/Tools.

      @@ -169,9 +169,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.setup.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages -c, --clean Removes the batch run script for target machine. If the testmode argument is present then keep the test script if it is present - otherwise remove it. @@ -183,6 +180,11 @@ has already been run for this case. -k KEEP, --keep KEEP When cleaning/resetting a case, do not remove/refresh files in this list. Choices are batch script, env_mach_specific.xml, Macros.make, Macros.cmake. Use should use this if you have local modifications to these files that you want to keep. -N, --non-local Use when you've requested a machine that you aren't on. Will reduce errors for missing directories etc. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.setup.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
      diff --git a/versions/master/html/Tools_user/case.submit.html b/versions/master/html/Tools_user/case.submit.html index 467aa4975ed..8bdba4a972f 100644 --- a/versions/master/html/Tools_user/case.submit.html +++ b/versions/master/html/Tools_user/case.submit.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      case.submit

      +

      case.submit

      case.submit is a script in CIMEROOT/CIME/Tools.

      @@ -173,9 +173,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.submit.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --job JOB, -j JOB Name of the job to be submitted; can be any of the jobs listed in env_batch.xml. This will be the first job of any defined workflow. Default is case.run. @@ -204,6 +201,11 @@ -a BATCH_ARGS, --batch-args BATCH_ARGS Used to pass additional arguments to batch system. --chksum Verifies input data checksums. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case.submit.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
      diff --git a/versions/master/html/Tools_user/case_diff.html b/versions/master/html/Tools_user/case_diff.html index e3a610249d1..086cb889cdf 100644 --- a/versions/master/html/Tools_user/case_diff.html +++ b/versions/master/html/Tools_user/case_diff.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      case_diff

      +

      case_diff

      case_diff is a script in CIMEROOT/CIME/Tools.

      @@ -166,13 +166,15 @@ options: -h, --help show this help message and exit + -b, --show-binary Show binary diffs (default: False) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/case_diff.log (default: False) -v, --verbose Add additional context (time and file) to log messages (default: False) -s, --silent Print only warnings and error messages (default: False) - -b, --show-binary Show binary diffs (default: False)
      diff --git a/versions/master/html/Tools_user/check_case.html b/versions/master/html/Tools_user/check_case.html index 3ae4ef1ba78..5ce404462c8 100644 --- a/versions/master/html/Tools_user/check_case.html +++ b/versions/master/html/Tools_user/check_case.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      check_case

      +

      check_case

      check_case is a script in CIMEROOT/CIME/Tools.

      @@ -166,6 +166,8 @@ options: -h, --help show this help message and exit + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/check_case.log -v, --verbose Add additional context (time and file) to log messages -s, --silent Print only warnings and error messages diff --git a/versions/master/html/Tools_user/check_input_data.html b/versions/master/html/Tools_user/check_input_data.html index d69af48a024..f1f4f036d23 100644 --- a/versions/master/html/Tools_user/check_input_data.html +++ b/versions/master/html/Tools_user/check_input_data.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      check_input_data

      +

      check_input_data

      check_input_data is a script in CIMEROOT/CIME/Tools.

      @@ -171,9 +171,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/check_input_data.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --protocol PROTOCOL The input data protocol to download data. --server SERVER The input data repository from which to download data. -i INPUT_DATA_ROOT, --input-data-root INPUT_DATA_ROOT @@ -183,6 +180,11 @@ Where to find list of input files --download Attempt to download missing input files --chksum chksum inputfiles against inputdata_chksum.dat (if available) + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/check_input_data.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
      diff --git a/versions/master/html/Tools_user/check_lockedfiles.html b/versions/master/html/Tools_user/check_lockedfiles.html index 459ed2c9fd6..76fdddda097 100644 --- a/versions/master/html/Tools_user/check_lockedfiles.html +++ b/versions/master/html/Tools_user/check_lockedfiles.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      check_lockedfiles

      +

      check_lockedfiles

      check_lockedfiles is a script in CIMEROOT/CIME/Tools.

      @@ -160,14 +160,16 @@ options: -h, --help show this help message and exit + --caseroot CASEROOT Case directory to build (default: + /home/runner/work/cime/cime/CIME/Tools) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/ru nner/work/cime/cime/CIME/Tools/check_lockedfiles.log (default: False) -v, --verbose Add additional context (time and file) to log messages (default: False) -s, --silent Print only warnings and error messages (default: False) - --caseroot CASEROOT Case directory to build (default: - /home/runner/work/cime/cime/CIME/Tools)
      diff --git a/versions/master/html/Tools_user/cime_bisect.html b/versions/master/html/Tools_user/cime_bisect.html index 27e19e05354..e65b27202d6 100644 --- a/versions/master/html/Tools_user/cime_bisect.html +++ b/versions/master/html/Tools_user/cime_bisect.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
      -

      cime_bisect

      +

      cime_bisect

      cime_bisect is a script in CIMEROOT/CIME/Tools.

      @@ -186,6 +186,13 @@ options: -h, --help show this help message and exit + -B BAD, --bad BAD Name of bad commit, default is current HEAD. (default: + HEAD) + -a, --all-commits Test all commits, not just merges (default: False) + -S SCRIPT, --script SCRIPT + Use your own custom script instead (default: None) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/cime_bisect.log (default: False) @@ -193,11 +200,6 @@ (default: False) -s, --silent Print only warnings and error messages (default: False) - -B BAD, --bad BAD Name of bad commit, default is current HEAD. (default: - HEAD) - -a, --all-commits Test all commits, not just merges (default: False) - -S SCRIPT, --script SCRIPT - Use your own custom script instead (default: None)
  • diff --git a/versions/master/html/Tools_user/code_checker.html b/versions/master/html/Tools_user/code_checker.html index b7461ab6915..2f849b3a4da 100644 --- a/versions/master/html/Tools_user/code_checker.html +++ b/versions/master/html/Tools_user/code_checker.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    code_checker

    +

    code_checker

    code_checker is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/Tools_user/compare_namelists.html b/versions/master/html/Tools_user/compare_namelists.html index 7b600292e06..fb81d171403 100644 --- a/versions/master/html/Tools_user/compare_namelists.html +++ b/versions/master/html/Tools_user/compare_namelists.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    compare_namelists

    +

    compare_namelists

    compare_namelists is a script in CIMEROOT/CIME/Tools.

    @@ -165,6 +165,10 @@ options: -h, --help show this help message and exit + -c CASE, --case CASE The case base id (<TESTCASE>.<GRID>.<COMPSET>). Helps + us normalize data. (default: None) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/r unner/work/cime/cime/CIME/Tools/compare_namelists.log (default: False) @@ -172,8 +176,6 @@ (default: False) -s, --silent Print only warnings and error messages (default: False) - -c CASE, --case CASE The case base id (<TESTCASE>.<GRID>.<COMPSET>). Helps - us normalize data. (default: None)
    diff --git a/versions/master/html/Tools_user/compare_test_results.html b/versions/master/html/Tools_user/compare_test_results.html index fc40e9376b6..08756f8f76a 100644 --- a/versions/master/html/Tools_user/compare_test_results.html +++ b/versions/master/html/Tools_user/compare_test_results.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,12 +142,12 @@
    -

    compare_test_results

    +

    compare_test_results

    compare_test_results is a script in CIMEROOT/CIME/Tools.

    $ ./compare_test_results --help
    -ERROR:  xmllint not found in PATH, xmllint is required for cime.  PATH=/opt/hostedtoolcache/Python/3.11.4/x64/bin:/opt/hostedtoolcache/Python/3.11.4/x64:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    +ERROR:  xmllint not found in PATH, xmllint is required for cime.  PATH=/opt/hostedtoolcache/Python/3.11.5/x64/bin:/opt/hostedtoolcache/Python/3.11.5/x64:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
     
    diff --git a/versions/master/html/Tools_user/component_compare_baseline.html b/versions/master/html/Tools_user/component_compare_baseline.html index 5a950c691b2..aa1bf33826f 100644 --- a/versions/master/html/Tools_user/component_compare_baseline.html +++ b/versions/master/html/Tools_user/component_compare_baseline.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    component_compare_baseline

    +

    component_compare_baseline

    component_compare_baseline is a script in CIMEROOT/CIME/Tools.

    @@ -164,6 +164,10 @@ options: -h, --help show this help message and exit + -b BASELINE_DIR, --baseline-dir BASELINE_DIR + Use custom baseline dir (default: None) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/r unner/work/cime/cime/CIME/Tools/component_compare_base line.log (default: False) @@ -171,8 +175,6 @@ (default: False) -s, --silent Print only warnings and error messages (default: False) - -b BASELINE_DIR, --baseline-dir BASELINE_DIR - Use custom baseline dir (default: None)
    diff --git a/versions/master/html/Tools_user/component_compare_copy.html b/versions/master/html/Tools_user/component_compare_copy.html index 95a10686974..2f9e799e0f5 100644 --- a/versions/master/html/Tools_user/component_compare_copy.html +++ b/versions/master/html/Tools_user/component_compare_copy.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    component_compare_copy

    +

    component_compare_copy

    component_compare_copy is a script in CIMEROOT/CIME/Tools.

    @@ -165,13 +165,15 @@ options: -h, --help show this help message and exit + --suffix SUFFIX Suffix to append to hist files (default: None) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner /work/cime/cime/CIME/Tools/component_compare_copy.log (default: False) -v, --verbose Add additional context (time and file) to log messages (default: False) -s, --silent Print only warnings and error messages (default: False) - --suffix SUFFIX Suffix to append to hist files (default: None)
    diff --git a/versions/master/html/Tools_user/component_compare_test.html b/versions/master/html/Tools_user/component_compare_test.html index 8ffb2d42362..482f1dae331 100644 --- a/versions/master/html/Tools_user/component_compare_test.html +++ b/versions/master/html/Tools_user/component_compare_test.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    component_compare_test

    +

    component_compare_test

    component_compare_test is a script in CIMEROOT/CIME/Tools.

    @@ -166,6 +166,8 @@ options: -h, --help show this help message and exit + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/w ork/cime/cime/CIME/Tools/component_compare_test.log (default: False) diff --git a/versions/master/html/Tools_user/component_generate_baseline.html b/versions/master/html/Tools_user/component_generate_baseline.html index 51007eebf16..bf7e7de23ad 100644 --- a/versions/master/html/Tools_user/component_generate_baseline.html +++ b/versions/master/html/Tools_user/component_generate_baseline.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    component_generate_baseline

    +

    component_generate_baseline

    component_generate_baseline is a script in CIMEROOT/CIME/Tools.

    @@ -164,13 +164,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/r - unner/work/cime/cime/CIME/Tools/component_generate_bas - eline.log (default: False) - -v, --verbose Add additional context (time and file) to log messages - (default: False) - -s, --silent Print only warnings and error messages (default: - False) -b BASELINE_DIR, --baseline-dir BASELINE_DIR Use custom baseline dir (default: None) -o, --allow-baseline-overwrite @@ -178,6 +171,15 @@ baseline directory will raise an error. Specifying this option allows existing baseline directories to be silently overwritten. (default: False) + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/r + unner/work/cime/cime/CIME/Tools/component_generate_bas + eline.log (default: False) + -v, --verbose Add additional context (time and file) to log messages + (default: False) + -s, --silent Print only warnings and error messages (default: + False)
    diff --git a/versions/master/html/Tools_user/concat_daily_hist.csh.html b/versions/master/html/Tools_user/concat_daily_hist.csh.html index 4d0f759b9cc..71cb0b99e08 100644 --- a/versions/master/html/Tools_user/concat_daily_hist.csh.html +++ b/versions/master/html/Tools_user/concat_daily_hist.csh.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    concat_daily_hist.csh

    +

    concat_daily_hist.csh

    concat_daily_hist.csh is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/Tools_user/create_clone.html b/versions/master/html/Tools_user/create_clone.html index 8b9e46f4e90..08b2ff8bd0c 100644 --- a/versions/master/html/Tools_user/create_clone.html +++ b/versions/master/html/Tools_user/create_clone.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    create_clone

    +

    create_clone

    create_clone is a script in CIMEROOT/scripts.

    @@ -155,9 +155,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/create_clone.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --case CASE, -case CASE (required) Specify a new case name. If not a full pathname, the new case will be created under then current working directory. @@ -197,6 +194,11 @@ --cime-output-root CIME_OUTPUT_ROOT Specify the root output directory. The default is the setting in the original case directory. NOTE: create_clone will fail if this directory is not writable. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/create_clone.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/create_newcase.html b/versions/master/html/Tools_user/create_newcase.html index 815811aee71..10caa3ada4e 100644 --- a/versions/master/html/Tools_user/create_newcase.html +++ b/versions/master/html/Tools_user/create_newcase.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    create_newcase

    +

    create_newcase

    create_newcase is a script in CIMEROOT/scripts.

    @@ -165,9 +165,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/create_newcase.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --case CASENAME, -case CASENAME (required) Specify the case name. If this is simply a name (not a path), the case directory is created in the current working directory. @@ -253,6 +250,11 @@ --gpu-type GPU_TYPE Specify type of GPU hardware - currently supported are v100, a100, mi250 --gpu-offload GPU_OFFLOAD Specify gpu offload method - currently supported are openacc, openmp, combined + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/create_newcase.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/create_test.html b/versions/master/html/Tools_user/create_test.html index 685bffa89a5..f8a2400c283 100644 --- a/versions/master/html/Tools_user/create_test.html +++ b/versions/master/html/Tools_user/create_test.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    create_test

    +

    create_test

    create_test is a script in CIMEROOT/scripts.

    @@ -171,9 +171,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/create_test.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --no-run Do not run generated tests --no-build Do not build generated tests, implies --no-run --no-setup Do not setup generated tests, implies --no-build and --no-run @@ -281,6 +278,11 @@ -M MAIL_TYPE, --mail-type MAIL_TYPE When to send user email. Options are: never, all, begin, end, fail. You can specify multiple types with either comma-separated args or multiple -M flags. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/create_test.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/cs.status.html b/versions/master/html/Tools_user/cs.status.html index ee1db480d94..4398459f91e 100644 --- a/versions/master/html/Tools_user/cs.status.html +++ b/versions/master/html/Tools_user/cs.status.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    cs.status

    +

    cs.status

    cs.status is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/Tools_user/e3sm_check_env.html b/versions/master/html/Tools_user/e3sm_check_env.html index 873dc36c12e..fd5ce622fc2 100644 --- a/versions/master/html/Tools_user/e3sm_check_env.html +++ b/versions/master/html/Tools_user/e3sm_check_env.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    e3sm_check_env

    +

    e3sm_check_env

    e3sm_check_env is a script in CIMEROOT/CIME/Tools.

    @@ -158,6 +158,8 @@ options: -h, --help show this help message and exit + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/e3sm_check_env.log (default: False) diff --git a/versions/master/html/Tools_user/generate_cylc_workflow.py.html b/versions/master/html/Tools_user/generate_cylc_workflow.py.html index 77748d0caf2..966adc23068 100644 --- a/versions/master/html/Tools_user/generate_cylc_workflow.py.html +++ b/versions/master/html/Tools_user/generate_cylc_workflow.py.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    generate_cylc_workflow.py

    +

    generate_cylc_workflow.py

    generate_cylc_workflow.py is a script in CIMEROOT/CIME/Tools.

    @@ -159,13 +159,15 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/generate_cylc_workflow.py.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --cycles CYCLES The number of cycles to run, default is RESUBMIT --ensemble ENSEMBLE generate suite.rc for an ensemble of cases, the case name argument must end in an integer. for example: ./generate_cylc_workflow.py --ensemble 4 will generate a workflow file in the current case, if that case is named case.01,the workflow will include case.01, case.02, case.03 and case.04 + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/generate_cylc_workflow.py.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/getTiming.html b/versions/master/html/Tools_user/getTiming.html index 4b380467302..f476bbca89d 100644 --- a/versions/master/html/Tools_user/getTiming.html +++ b/versions/master/html/Tools_user/getTiming.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    getTiming

    +

    getTiming

    getTiming is a script in CIMEROOT/CIME/Tools.

    @@ -154,16 +154,18 @@ options: -h, --help show this help message and exit + -lid LID, --lid LID print using yymmdd-hhmmss format (default: + 999999-999999) + --caseroot CASEROOT Case directory to get timing for (default: + /home/runner/work/cime/cime/CIME/Tools) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/getTiming.log (default: False) -v, --verbose Add additional context (time and file) to log messages (default: False) -s, --silent Print only warnings and error messages (default: False) - -lid LID, --lid LID print using yymmdd-hhmmss format (default: - 999999-999999) - --caseroot CASEROOT Case directory to get timing for (default: - /home/runner/work/cime/cime/CIME/Tools)
    diff --git a/versions/master/html/Tools_user/get_case_env.html b/versions/master/html/Tools_user/get_case_env.html index 759ad2d196b..460df98d53d 100644 --- a/versions/master/html/Tools_user/get_case_env.html +++ b/versions/master/html/Tools_user/get_case_env.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    get_case_env

    +

    get_case_env

    get_case_env is a script in CIMEROOT/CIME/Tools.

    @@ -169,10 +169,12 @@ options: -h, --help show this help message and exit + -c CASE, --case CASE The case for which you want the env. Default=SMS.f09_g16.X + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/get_case_env.log -v, --verbose Add additional context (time and file) to log messages -s, --silent Print only warnings and error messages - -c CASE, --case CASE The case for which you want the env. Default=SMS.f09_g16.X
    diff --git a/versions/master/html/Tools_user/get_standard_makefile_args.html b/versions/master/html/Tools_user/get_standard_makefile_args.html index d2fa1de9661..582c8129e36 100644 --- a/versions/master/html/Tools_user/get_standard_makefile_args.html +++ b/versions/master/html/Tools_user/get_standard_makefile_args.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    get_standard_makefile_args

    +

    get_standard_makefile_args

    get_standard_makefile_args is a script in CIMEROOT/CIME/Tools.

    @@ -158,6 +158,8 @@ options: -h, --help show this help message and exit + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/get_standard_makefile_args.log -v, --verbose Add additional context (time and file) to log messages -s, --silent Print only warnings and error messages diff --git a/versions/master/html/Tools_user/index.html b/versions/master/html/Tools_user/index.html index c25bd2b575e..fdb05349418 100644 --- a/versions/master/html/Tools_user/index.html +++ b/versions/master/html/Tools_user/index.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -139,7 +139,7 @@
    -

    User Tools

    +

    User Tools

    CIME includes a number of user scripts. Some of these scripts are copied into the CASEROOT as part of create_newcase, create_test, create_clone, and case.setup.

    diff --git a/versions/master/html/Tools_user/jenkins_generic_job.html b/versions/master/html/Tools_user/jenkins_generic_job.html index 2f75c3ef4ba..92070b9610e 100644 --- a/versions/master/html/Tools_user/jenkins_generic_job.html +++ b/versions/master/html/Tools_user/jenkins_generic_job.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    jenkins_generic_job

    +

    jenkins_generic_job

    jenkins_generic_job is a script in CIMEROOT/CIME/Tools.

    @@ -166,13 +166,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/r - unner/work/cime/cime/CIME/Tools/jenkins_generic_job.lo - g (default: False) - -v, --verbose Add additional context (time and file) to log messages - (default: False) - -s, --silent Print only warnings and error messages (default: - False) -g, --generate-baselines Generate baselines (default: False) --baseline-compare Do baseline comparisons. Off by default. (default: @@ -242,6 +235,15 @@ env_mach_pes.xml format. (default: None) --jenkins-id JENKINS_ID Specify an 'id' for the Jenkins jobs. (default: None) + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/r + unner/work/cime/cime/CIME/Tools/jenkins_generic_job.lo + g (default: False) + -v, --verbose Add additional context (time and file) to log messages + (default: False) + -s, --silent Print only warnings and error messages (default: + False)
    diff --git a/versions/master/html/Tools_user/list_e3sm_tests.html b/versions/master/html/Tools_user/list_e3sm_tests.html index e99a38ee264..8ecd96e1417 100644 --- a/versions/master/html/Tools_user/list_e3sm_tests.html +++ b/versions/master/html/Tools_user/list_e3sm_tests.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    list_e3sm_tests

    +

    list_e3sm_tests

    list_e3sm_tests is a script in CIMEROOT/CIME/Tools.

    @@ -167,11 +167,16 @@ suites The tests suites to list. Test suites: cime_tiny, cime_test_only_pass, cime_test_only_slow_pass, cime_test_only, cime_test_all, cime_test_share, - cime_test_share2, cime_test_repeat, cime_test_time, - cime_test_multi_inherit, cime_developer + cime_test_share2, cime_test_perf, cime_test_repeat, + cime_test_time, cime_test_multi_inherit, + cime_developer options: -h, --help show this help message and exit + -t {compsets,grids,testcases,tests}, --thing-to-list {compsets,grids,testcases,tests} + The thing you want to list (default: tests) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/r unner/work/cime/cime/CIME/Tools/list_e3sm_tests.log (default: False) @@ -179,8 +184,6 @@ (default: False) -s, --silent Print only warnings and error messages (default: False) - -t {compsets,grids,testcases,tests}, --thing-to-list {compsets,grids,testcases,tests} - The thing you want to list (default: tests)
    diff --git a/versions/master/html/Tools_user/mkDepends.html b/versions/master/html/Tools_user/mkDepends.html index a3a3128ef98..b2b5e1c175a 100644 --- a/versions/master/html/Tools_user/mkDepends.html +++ b/versions/master/html/Tools_user/mkDepends.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    mkDepends

    +

    mkDepends

    mkDepends is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/Tools_user/mkSrcfiles.html b/versions/master/html/Tools_user/mkSrcfiles.html index f781d76555e..448f2985c14 100644 --- a/versions/master/html/Tools_user/mkSrcfiles.html +++ b/versions/master/html/Tools_user/mkSrcfiles.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    mkSrcfiles

    +

    mkSrcfiles

    mkSrcfiles is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/Tools_user/mvsource.html b/versions/master/html/Tools_user/mvsource.html index 4b0b87275d2..ab225f85532 100644 --- a/versions/master/html/Tools_user/mvsource.html +++ b/versions/master/html/Tools_user/mvsource.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    mvsource

    +

    mvsource

    mvsource is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/Tools_user/normalize_cases.html b/versions/master/html/Tools_user/normalize_cases.html index fcfd949c59c..31453d1c75c 100644 --- a/versions/master/html/Tools_user/normalize_cases.html +++ b/versions/master/html/Tools_user/normalize_cases.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    normalize_cases

    +

    normalize_cases

    normalize_cases is a script in CIMEROOT/CIME/Tools.

    @@ -165,6 +165,8 @@ options: -h, --help show this help message and exit + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/normalize_cases.log (default: False) diff --git a/versions/master/html/Tools_user/pelayout.html b/versions/master/html/Tools_user/pelayout.html index f8c92af3473..1ed5a9df32f 100644 --- a/versions/master/html/Tools_user/pelayout.html +++ b/versions/master/html/Tools_user/pelayout.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    pelayout

    +

    pelayout

    pelayout is a script in CIMEROOT/CIME/Tools.

    @@ -189,10 +189,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file - /home/runner/work/cime/cime/CIME/Tools/pelayout.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --set-ntasks SET_NTASKS Total number of tasks to set for the case --set-nthrds SET_NTHRDS, --set-nthreads SET_NTHRDS @@ -202,6 +198,12 @@ --header HEADER Custom header for PE layout display --no-header Do not print any PE layout header --caseroot CASEROOT Case directory to reference + +Logging options: + -d, --debug Print debug information (very verbose) to file + /home/runner/work/cime/cime/CIME/Tools/pelayout.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/preview_namelists.html b/versions/master/html/Tools_user/preview_namelists.html index 031e461053e..fc9295563e7 100644 --- a/versions/master/html/Tools_user/preview_namelists.html +++ b/versions/master/html/Tools_user/preview_namelists.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    preview_namelists

    +

    preview_namelists

    preview_namelists is a script in CIMEROOT/CIME/Tools.

    @@ -169,12 +169,14 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/preview_namelists.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --component COMPONENT Specify component's namelist to build. If not specified, generates namelists for all components. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/preview_namelists.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/preview_run.html b/versions/master/html/Tools_user/preview_run.html index 29c83639f96..31a0e32183c 100644 --- a/versions/master/html/Tools_user/preview_run.html +++ b/versions/master/html/Tools_user/preview_run.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    preview_run

    +

    preview_run

    preview_run is a script in CIMEROOT/CIME/Tools.

    @@ -169,11 +169,13 @@ options: -h, --help show this help message and exit + -j JOB, --job JOB The job you want to print. + Default is case.run (or case.test if this is a test). + +Logging options: -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/preview_run.log -v, --verbose Add additional context (time and file) to log messages -s, --silent Print only warnings and error messages - -j JOB, --job JOB The job you want to print. - Default is case.run (or case.test if this is a test).
    diff --git a/versions/master/html/Tools_user/query_config.html b/versions/master/html/Tools_user/query_config.html index cdf906b629f..023556cffc1 100644 --- a/versions/master/html/Tools_user/query_config.html +++ b/versions/master/html/Tools_user/query_config.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,12 +142,12 @@
    -

    query_config

    +

    query_config

    query_config is a script in CIMEROOT/scripts.

    $ ./query_config --help
    -ERROR:  xmllint not found in PATH, xmllint is required for cime.  PATH=/opt/hostedtoolcache/Python/3.11.4/x64/bin:/opt/hostedtoolcache/Python/3.11.4/x64:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    +ERROR:  xmllint not found in PATH, xmllint is required for cime.  PATH=/opt/hostedtoolcache/Python/3.11.5/x64/bin:/opt/hostedtoolcache/Python/3.11.5/x64:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
     
    diff --git a/versions/master/html/Tools_user/query_testlists.html b/versions/master/html/Tools_user/query_testlists.html index 95bb944f4d2..383fcb7134e 100644 --- a/versions/master/html/Tools_user/query_testlists.html +++ b/versions/master/html/Tools_user/query_testlists.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    query_testlists

    +

    query_testlists

    query_testlists is a script in CIMEROOT/scripts.

    @@ -157,9 +157,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/query_testlists.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --count Rather than listing tests, just give counts by category/machine/compiler. --list {category,categories,machine,machines,compiler,compilers} Rather than listing tests, list the available options for @@ -180,6 +177,11 @@ --xml-testlist XML_TESTLIST Path to testlist file from which tests are gathered; default is all files specified in config_files.xml. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/scripts/query_testlists.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/save_provenance.html b/versions/master/html/Tools_user/save_provenance.html index fc1592574ac..9d75737276d 100644 --- a/versions/master/html/Tools_user/save_provenance.html +++ b/versions/master/html/Tools_user/save_provenance.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    save_provenance

    +

    save_provenance

    save_provenance is a script in CIMEROOT/CIME/Tools.

    @@ -168,6 +168,10 @@ options: -h, --help show this help message and exit + -l LID, --lid LID Force system to save provenance with this LID + (default: None) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/r unner/work/cime/cime/CIME/Tools/save_provenance.log (default: False) @@ -175,8 +179,6 @@ (default: False) -s, --silent Print only warnings and error messages (default: False) - -l LID, --lid LID Force system to save provenance with this LID - (default: None)
    diff --git a/versions/master/html/Tools_user/simple-py-prof.html b/versions/master/html/Tools_user/simple-py-prof.html index 8c27dde9999..c85d4a6af4a 100644 --- a/versions/master/html/Tools_user/simple-py-prof.html +++ b/versions/master/html/Tools_user/simple-py-prof.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    simple-py-prof

    +

    simple-py-prof

    simple-py-prof is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/Tools_user/simple_compare.html b/versions/master/html/Tools_user/simple_compare.html index ac44fbd1a5b..085d2a563a0 100644 --- a/versions/master/html/Tools_user/simple_compare.html +++ b/versions/master/html/Tools_user/simple_compare.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    simple_compare

    +

    simple_compare

    simple_compare is a script in CIMEROOT/CIME/Tools.

    @@ -165,6 +165,10 @@ options: -h, --help show this help message and exit + -c CASE, --case CASE The case base id (<TESTCASE>.<GRID>.<COMPSET>). Helps + us normalize data. (default: None) + +Logging options: -d, --debug Print debug information (very verbose) to file /home/r unner/work/cime/cime/CIME/Tools/simple_compare.log (default: False) @@ -172,8 +176,6 @@ (default: False) -s, --silent Print only warnings and error messages (default: False) - -c CASE, --case CASE The case base id (<TESTCASE>.<GRID>.<COMPSET>). Helps - us normalize data. (default: None)
    diff --git a/versions/master/html/Tools_user/testreporter.py.html b/versions/master/html/Tools_user/testreporter.py.html index 2ec4ee6ac01..986e9aa3efb 100644 --- a/versions/master/html/Tools_user/testreporter.py.html +++ b/versions/master/html/Tools_user/testreporter.py.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    testreporter.py

    +

    testreporter.py

    testreporter.py is a script in CIMEROOT/CIME/Tools.

    @@ -153,16 +153,18 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/ru - nner/work/cime/cime/CIME/Tools/testreporter.py.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --tagname TAGNAME Name of the tag being tested. --testid TESTID Test id, ie c2_0_a6g_ing,c2_0_b6g_gnu. --testroot TESTROOT Root directory for tests to populate the database. --testtype TESTTYPE Type of test, prealpha or prebeta. --dryrun Do a dry run, database will not be populated. --dumpxml Dump XML test results to sceen. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/ru + nner/work/cime/cime/CIME/Tools/testreporter.py.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/wait_for_tests.html b/versions/master/html/Tools_user/wait_for_tests.html index c3939bcf3db..cdc49bcce82 100644 --- a/versions/master/html/Tools_user/wait_for_tests.html +++ b/versions/master/html/Tools_user/wait_for_tests.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    wait_for_tests

    +

    wait_for_tests

    wait_for_tests is a script in CIMEROOT/CIME/Tools.

    @@ -171,13 +171,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/r - unner/work/cime/cime/CIME/Tools/wait_for_tests.log - (default: False) - -v, --verbose Add additional context (time and file) to log messages - (default: False) - -s, --silent Print only warnings and error messages (default: - False) -n, --no-wait Do not wait for tests to finish (default: False) --no-run Do not expect run phase to be completed (default: False) @@ -205,6 +198,15 @@ --timeout TIMEOUT Timeout wait in seconds. (default: None) --update-success Record test success in baselines. Only the nightly process should use this in general. (default: False) + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/r + unner/work/cime/cime/CIME/Tools/wait_for_tests.log + (default: False) + -v, --verbose Add additional context (time and file) to log messages + (default: False) + -s, --silent Print only warnings and error messages (default: + False)
    diff --git a/versions/master/html/Tools_user/xmlchange.html b/versions/master/html/Tools_user/xmlchange.html index 84f2bb55ce7..c6653e53e90 100644 --- a/versions/master/html/Tools_user/xmlchange.html +++ b/versions/master/html/Tools_user/xmlchange.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    xmlchange

    +

    xmlchange

    xmlchange is a script in CIMEROOT/CIME/Tools.

    @@ -202,9 +202,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/xmlchange.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --caseroot CASEROOT Case directory to change. Default is current directory. --append, -append Append to the existing value rather than overwriting it. @@ -232,6 +229,11 @@ -f, --force Ignore typing checks and store value. -N, --non-local Use when you've requested a machine that you aren't on. Will reduce errors for missing directories etc. -loglevel LOGLEVEL Ignored, only for backwards compatibility. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/xmlchange.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/xmlquery.html b/versions/master/html/Tools_user/xmlquery.html index b8108459a3e..3cbcee8e563 100644 --- a/versions/master/html/Tools_user/xmlquery.html +++ b/versions/master/html/Tools_user/xmlquery.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    xmlquery

    +

    xmlquery

    xmlquery is a script in CIMEROOT/CIME/Tools.

    @@ -254,9 +254,6 @@ options: -h, --help show this help message and exit - -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/xmlquery.log - -v, --verbose Add additional context (time and file) to log messages - -s, --silent Print only warnings and error messages --caseroot CASEROOT, -caseroot CASEROOT Case directory to reference. Default is current directory. @@ -281,6 +278,11 @@ --get-group Print the group associated with each variable. --type Print the data type associated with each variable. --valid-values Print the valid values associated with each variable, if defined. + +Logging options: + -d, --debug Print debug information (very verbose) to file /home/runner/work/cime/cime/CIME/Tools/xmlquery.log + -v, --verbose Add additional context (time and file) to log messages + -s, --silent Print only warnings and error messages
    diff --git a/versions/master/html/Tools_user/xmltestentry.html b/versions/master/html/Tools_user/xmltestentry.html index d77fb1eb30c..bc0e1cb4b90 100644 --- a/versions/master/html/Tools_user/xmltestentry.html +++ b/versions/master/html/Tools_user/xmltestentry.html @@ -12,11 +12,11 @@ - - - - - + + + + + @@ -142,7 +142,7 @@
    -

    xmltestentry

    +

    xmltestentry

    xmltestentry is a script in CIMEROOT/CIME/Tools.

    diff --git a/versions/master/html/_modules/CIME/BuildTools/configure.html b/versions/master/html/_modules/CIME/BuildTools/configure.html index 5705095edaa..8f3ef9c77c9 100644 --- a/versions/master/html/_modules/CIME/BuildTools/configure.html +++ b/versions/master/html/_modules/CIME/BuildTools/configure.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -119,7 +119,9 @@

    Source code for CIME.BuildTools.configure

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]def configure( +
    +[docs] +def configure( machobj, output_dir, macros_format, @@ -198,7 +200,10 @@

    Source code for CIME.BuildTools.configure

         )
    -
    [docs]def copy_depends_files(machine_name, machines_dir, output_dir, compiler): + +
    +[docs] +def copy_depends_files(machine_name, machines_dir, output_dir, compiler): """ Copy any system or compiler Depends files if they do not exist in the output directory If there is a match for Depends.machine_name.compiler copy that and ignore the others @@ -221,7 +226,10 @@

    Source code for CIME.BuildTools.configure

                         safe_copy(dfile, outputdfile)
    -
    [docs]class FakeCase(object): + +
    +[docs] +class FakeCase(object): def __init__(self, compiler, mpilib, debug, comp_interface, threading=False): # PIO_VERSION is needed to parse config_machines.xml but isn't otherwise used # by FakeCase @@ -236,26 +244,41 @@

    Source code for CIME.BuildTools.configure

                 "SRCROOT": get_src_root(),
             }
     
    -
    [docs] def get_build_threaded(self): +
    +[docs] + def get_build_threaded(self): return self.get_value("SMP_PRESENT")
    -
    [docs] def get_case_root(self): + +
    +[docs] + def get_case_root(self): """Returns the root directory for this case.""" return self.get_value("CASEROOT")
    -
    [docs] def get_value(self, attrib): + +
    +[docs] + def get_value(self, attrib): expect( attrib in self._vals, "FakeCase does not support getting value of '%s'" % attrib, ) return self._vals[attrib]
    -
    [docs] def set_value(self, attrib, value): + +
    +[docs] + def set_value(self, attrib, value): """Sets a given variable value for the case""" - self._vals[attrib] = value
    + self._vals[attrib] = value
    +
    -
    [docs]def generate_env_mach_specific( + +
    +[docs] +def generate_env_mach_specific( output_dir, machobj, compiler, @@ -303,6 +326,7 @@

    Source code for CIME.BuildTools.configure

                     shell_file.write("setenv MPILIB {}\n".format(mpilib))
                     shell_file.write("setenv DEBUG {}\n".format(repr(debug).upper()))
                     shell_file.write("setenv OS {}\n".format(sysos))
    +
    diff --git a/versions/master/html/_modules/CIME/Servers/ftp.html b/versions/master/html/_modules/CIME/Servers/ftp.html index 21582bf41b9..f9ee647704c 100644 --- a/versions/master/html/_modules/CIME/Servers/ftp.html +++ b/versions/master/html/_modules/CIME/Servers/ftp.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,7 +98,9 @@

    Source code for CIME.Servers.ftp

     logger = logging.getLogger(__name__)
     # I think that multiple inheritence would be useful here, but I couldnt make it work
     # in a py2/3 compatible way.
    -
    [docs]class FTP(GenericServer): +
    +[docs] +class FTP(GenericServer): def __init__(self, address, user="", passwd="", server=None): if not user: user = "" @@ -132,7 +134,9 @@

    Source code for CIME.Servers.ftp

                 )
                 return None
     
    -
    [docs] @classmethod +
    +[docs] + @classmethod def ftp_login(cls, address, user="", passwd=""): ftp_server, root_address = address.split("/", 1) logger.info("server address {} root path {}".format(ftp_server, root_address)) @@ -154,7 +158,10 @@

    Source code for CIME.Servers.ftp

     
             return result
    -
    [docs] def fileexists(self, rel_path): + +
    +[docs] + def fileexists(self, rel_path): try: stat = self.ftp.nlst(rel_path) except all_ftp_errors: @@ -169,7 +176,10 @@

    Source code for CIME.Servers.ftp

                     return False
             return True
    -
    [docs] def getfile(self, rel_path, full_path): + +
    +[docs] + def getfile(self, rel_path, full_path): try: stat = self.ftp.retrbinary( "RETR {}".format(rel_path), open(full_path, "wb").write @@ -189,7 +199,10 @@

    Source code for CIME.Servers.ftp

                 return False
             return True
    -
    [docs] def getdirectory(self, rel_path, full_path): + +
    +[docs] + def getdirectory(self, rel_path, full_path): try: stat = self.ftp.nlst(rel_path) except all_ftp_errors: @@ -197,7 +210,9 @@

    Source code for CIME.Servers.ftp

                 return False
     
             for _file in stat:
    -            self.getfile(_file, full_path + os.sep + os.path.basename(_file))
    + self.getfile(_file, full_path + os.sep + os.path.basename(_file))
    +
    +
    diff --git a/versions/master/html/_modules/CIME/Servers/generic_server.html b/versions/master/html/_modules/CIME/Servers/generic_server.html index 5cc49f6d3dd..3d82fd7a0ae 100644 --- a/versions/master/html/_modules/CIME/Servers/generic_server.html +++ b/versions/master/html/_modules/CIME/Servers/generic_server.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,20 +97,29 @@

    Source code for CIME.Servers.generic_server

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class GenericServer(object): +
    +[docs] +class GenericServer(object): def __init__( self, host=" ", user=" ", passwd=" ", acct=" ", timeout=_GLOBAL_DEFAULT_TIMEOUT ): raise NotImplementedError -
    [docs] def fileexists(self, rel_path): +
    +[docs] + def fileexists(self, rel_path): """Returns True if rel_path exists on server""" raise NotImplementedError
    -
    [docs] def getfile(self, rel_path, full_path): + +
    +[docs] + def getfile(self, rel_path, full_path): """Get file from rel_path on server and place in location full_path on client fail if full_path already exists on client, return True if successful""" - raise NotImplementedError
    + raise NotImplementedError
    +
    +
    diff --git a/versions/master/html/_modules/CIME/Servers/gftp.html b/versions/master/html/_modules/CIME/Servers/gftp.html index 0b56d25aa65..904d324cec4 100644 --- a/versions/master/html/_modules/CIME/Servers/gftp.html +++ b/versions/master/html/_modules/CIME/Servers/gftp.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,11 +95,15 @@

    Source code for CIME.Servers.gftp

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class GridFTP(GenericServer): +
    +[docs] +class GridFTP(GenericServer): def __init__(self, address, user="", passwd=""): self._root_address = address -
    [docs] def fileexists(self, rel_path): +
    +[docs] + def fileexists(self, rel_path): stat, out, err = run_cmd( "globus-url-copy -list {}".format( os.path.join(self._root_address, os.path.dirname(rel_path)) + os.sep @@ -112,7 +116,10 @@

    Source code for CIME.Servers.gftp

                 return False
             return True
    -
    [docs] def getfile(self, rel_path, full_path): + +
    +[docs] + def getfile(self, rel_path, full_path): stat, _, err = run_cmd( "globus-url-copy -v {} file://{}".format( os.path.join(self._root_address, rel_path), full_path @@ -128,7 +135,10 @@

    Source code for CIME.Servers.gftp

                 return False
             return True
    -
    [docs] def getdirectory(self, rel_path, full_path): + +
    +[docs] + def getdirectory(self, rel_path, full_path): stat, _, err = run_cmd( "globus-url-copy -v -r {}{} file://{}{}".format( os.path.join(self._root_address, rel_path), os.sep, full_path, os.sep @@ -142,7 +152,9 @@

    Source code for CIME.Servers.gftp

                     )
                 )
                 return False
    -        return True
    + return True
    +
    +
    diff --git a/versions/master/html/_modules/CIME/Servers/svn.html b/versions/master/html/_modules/CIME/Servers/svn.html index 13441d43ee4..94255958956 100644 --- a/versions/master/html/_modules/CIME/Servers/svn.html +++ b/versions/master/html/_modules/CIME/Servers/svn.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.Servers.svn

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class SVN(GenericServer): +
    +[docs] +class SVN(GenericServer): def __init__(self, address, user="", passwd=""): self._args = "" if user: @@ -120,7 +122,9 @@

    Source code for CIME.Servers.svn

                 )
                 return None
     
    -
    [docs] def fileexists(self, rel_path): +
    +[docs] + def fileexists(self, rel_path): full_url = os.path.join(self._svn_loc, rel_path) stat, out, err = run_cmd( "svn --non-interactive --trust-server-cert {} ls {}".format( @@ -136,7 +140,10 @@

    Source code for CIME.Servers.svn

                 return False
             return True
    -
    [docs] def getfile(self, rel_path, full_path): + +
    +[docs] + def getfile(self, rel_path, full_path): if not rel_path: return False full_url = os.path.join(self._svn_loc, rel_path) @@ -156,7 +163,10 @@

    Source code for CIME.Servers.svn

                 logging.info("SUCCESS\n")
                 return True
    -
    [docs] def getdirectory(self, rel_path, full_path): + +
    +[docs] + def getdirectory(self, rel_path, full_path): full_url = os.path.join(self._svn_loc, rel_path) stat, output, errput = run_cmd( "svn --non-interactive --trust-server-cert {} export --force {} {}".format( @@ -172,7 +182,9 @@

    Source code for CIME.Servers.svn

                 return False
             else:
                 logging.info("SUCCESS\n")
    -            return True
    + return True
    +
    +
    diff --git a/versions/master/html/_modules/CIME/Servers/wget.html b/versions/master/html/_modules/CIME/Servers/wget.html index 1e50460daa1..d8ef961b4d2 100644 --- a/versions/master/html/_modules/CIME/Servers/wget.html +++ b/versions/master/html/_modules/CIME/Servers/wget.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.Servers.wget

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class WGET(GenericServer): +
    +[docs] +class WGET(GenericServer): def __init__(self, address, user="", passwd=""): self._args = "--no-check-certificate " if user: @@ -103,7 +105,9 @@

    Source code for CIME.Servers.wget

                 self._args += "--password {} ".format(passwd)
             self._server_loc = address
     
    -
    [docs] @classmethod +
    +[docs] + @classmethod def wget_login(cls, address, user="", passwd=""): args = "--no-check-certificate " if user: @@ -131,7 +135,10 @@

    Source code for CIME.Servers.wget

     
             return cls(address, user=user, passwd=passwd)
    -
    [docs] def fileexists(self, rel_path): + +
    +[docs] + def fileexists(self, rel_path): full_url = os.path.join(self._server_loc, rel_path) stat, out, err = run_cmd("wget {} --spider {}".format(self._args, full_url)) @@ -144,7 +151,10 @@

    Source code for CIME.Servers.wget

                 return False
             return True
    -
    [docs] def getfile(self, rel_path, full_path): + +
    +[docs] + def getfile(self, rel_path, full_path): full_url = os.path.join(self._server_loc, rel_path) stat, output, errput = run_cmd( "wget {} {} -nc --output-document {}".format( @@ -165,7 +175,10 @@

    Source code for CIME.Servers.wget

                 logging.info("SUCCESS\n")
                 return True
    -
    [docs] def getdirectory(self, rel_path, full_path): + +
    +[docs] + def getdirectory(self, rel_path, full_path): full_url = os.path.join(self._server_loc, rel_path) stat, output, errput = run_cmd( "wget {} {} -r -N --no-directories ".format(self._args, full_url + os.sep), @@ -185,7 +198,9 @@

    Source code for CIME.Servers.wget

                 return False
             else:
                 logging.info("SUCCESS\n")
    -            return True
    + return True
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/dae.html b/versions/master/html/_modules/CIME/SystemTests/dae.html index 150ba73962b..abddb49ba40 100644 --- a/versions/master/html/_modules/CIME/SystemTests/dae.html +++ b/versions/master/html/_modules/CIME/SystemTests/dae.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -101,7 +101,9 @@

    Source code for CIME.SystemTests.dae

     from CIME.utils import expect
     
     ###############################################################################
    -
    [docs]class DAE(SystemTestsCompareTwo): +
    +[docs] +class DAE(SystemTestsCompareTwo): ############################################################################### """ Implementation of the CIME data assimilation test: @@ -173,7 +175,9 @@

    Source code for CIME.SystemTests.dae

             self._case.flush()
     
         ###########################################################################
    -
    [docs] def run_phase(self): # pylint: disable=arguments-differ +
    +[docs] + def run_phase(self): # pylint: disable=arguments-differ ########################################################################### # Clean up any da.log files in case this is a re-run. self._activate_case2() @@ -296,7 +300,9 @@

    Source code for CIME.SystemTests.dae

                         ),
                     )
                 # End with
    -            cycle_num = cycle_num + 1
    + cycle_num = cycle_num + 1
    +
    + # End for
    diff --git a/versions/master/html/_modules/CIME/SystemTests/eri.html b/versions/master/html/_modules/CIME/SystemTests/eri.html index 1576a774f22..6ed34f9ac41 100644 --- a/versions/master/html/_modules/CIME/SystemTests/eri.html +++ b/versions/master/html/_modules/CIME/SystemTests/eri.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -123,7 +123,9 @@

    Source code for CIME.SystemTests.eri

             safe_copy(item, rundir)
     
     
    -
    [docs]class ERI(SystemTestsCommon): +
    +[docs] +class ERI(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the ERI system test @@ -131,7 +133,9 @@

    Source code for CIME.SystemTests.eri

             SystemTestsCommon.__init__(self, case, **kwargs)
             self._testname = "ERI"
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): caseroot = self._case.get_value("CASEROOT") clone1_path = "{}.ref1".format(caseroot) clone2_path = "{}.ref2".format(caseroot) @@ -354,7 +358,9 @@

    Source code for CIME.SystemTests.eri

             self.run_indv(suffix="rest")
     
             self._component_compare_test("base", "hybrid")
    -        self._component_compare_test("base", "rest")
    + self._component_compare_test("base", "rest")
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/erio.html b/versions/master/html/_modules/CIME/SystemTests/erio.html index 062a84f81cf..5a289aaea5f 100644 --- a/versions/master/html/_modules/CIME/SystemTests/erio.html +++ b/versions/master/html/_modules/CIME/SystemTests/erio.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.SystemTests.erio

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ERIO(SystemTestsCommon): +
    +[docs] +class ERIO(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to file env_test.xml in the case directory @@ -156,7 +158,9 @@

    Source code for CIME.SystemTests.erio

             # Compare restart file
             self._component_compare_test(other_pio_type, suffix)
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): for idx, pio_type1 in enumerate(self._pio_types): if pio_type1 != "default" and pio_type1 != "nothing": @@ -165,7 +169,9 @@

    Source code for CIME.SystemTests.erio

                     for pio_type2 in self._pio_types[idx + 1 :]:
                         if pio_type2 != "default" and pio_type2 != "nothing":
                             self._case.set_value("PIO_TYPENAME", pio_type2)
    -                        self._restart_run(pio_type2, pio_type1)
    + self._restart_run(pio_type2, pio_type1)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/erp.html b/versions/master/html/_modules/CIME/SystemTests/erp.html index 229461ecc25..3939c7d1ade 100644 --- a/versions/master/html/_modules/CIME/SystemTests/erp.html +++ b/versions/master/html/_modules/CIME/SystemTests/erp.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -100,7 +100,9 @@

    Source code for CIME.SystemTests.erp

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ERP(RestartTest): +
    +[docs] +class ERP(RestartTest): def __init__(self, case, **kwargs): """ initialize a test object @@ -135,6 +137,7 @@

    Source code for CIME.SystemTests.erp

     
         def _case_one_custom_postrun_action(self):
             self.copy_case1_restarts_to_case2()
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/err.html b/versions/master/html/_modules/CIME/SystemTests/err.html index 43e9b5110ce..bc85656f263 100644 --- a/versions/master/html/_modules/CIME/SystemTests/err.html +++ b/versions/master/html/_modules/CIME/SystemTests/err.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.SystemTests.err

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ERR(RestartTest): +
    +[docs] +class ERR(RestartTest): def __init__(self, case, **kwargs): # pylint: disable=super-init-not-called """ initialize an object interface to the ERR system test @@ -141,6 +143,7 @@

    Source code for CIME.SystemTests.err

                 orig_file = case_file[: -(1 + len(self._run_one_suffix))]
                 if not os.path.isfile(orig_file):
                     safe_copy(case_file, orig_file)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/erri.html b/versions/master/html/_modules/CIME/SystemTests/erri.html index 490f76d7539..c89626066a5 100644 --- a/versions/master/html/_modules/CIME/SystemTests/erri.html +++ b/versions/master/html/_modules/CIME/SystemTests/erri.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.SystemTests.erri

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ERRI(ERR): +
    +[docs] +class ERRI(ERR): def __init__(self, case, **kwargs): """ initialize an object interface to the ERU system test @@ -113,6 +115,7 @@

    Source code for CIME.SystemTests.erri

                 with gzip.open(logname_gz, "rb") as f_in, open(logname, "w") as f_out:
                     shutil.copyfileobj(f_in, f_out)
                 os.remove(logname_gz)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/ers.html b/versions/master/html/_modules/CIME/SystemTests/ers.html index b007a594740..d206d53a954 100644 --- a/versions/master/html/_modules/CIME/SystemTests/ers.html +++ b/versions/master/html/_modules/CIME/SystemTests/ers.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.SystemTests.ers

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ERS(SystemTestsCommon): +
    +[docs] +class ERS(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the ERS system test @@ -146,9 +148,13 @@

    Source code for CIME.SystemTests.ers

             # Compare restart file
             self._component_compare_test("base", "rest")
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): self._ers_first_phase() - self._ers_second_phase()
    + self._ers_second_phase()
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/ers2.html b/versions/master/html/_modules/CIME/SystemTests/ers2.html index 71876ea78e9..e6e203f7b44 100644 --- a/versions/master/html/_modules/CIME/SystemTests/ers2.html +++ b/versions/master/html/_modules/CIME/SystemTests/ers2.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -93,7 +93,9 @@

    Source code for CIME.SystemTests.ers2

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ERS2(SystemTestsCommon): +
    +[docs] +class ERS2(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the ERS2 system test @@ -146,9 +148,13 @@

    Source code for CIME.SystemTests.ers2

             # Compare restart file
             self._component_compare_test("base", "rest")
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): self._ers2_first_phase() - self._ers2_second_phase()
    + self._ers2_second_phase()
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/ert.html b/versions/master/html/_modules/CIME/SystemTests/ert.html index 13fd55e50ba..35b7ace8f36 100644 --- a/versions/master/html/_modules/CIME/SystemTests/ert.html +++ b/versions/master/html/_modules/CIME/SystemTests/ert.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.SystemTests.ert

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ERT(SystemTestsCommon): +
    +[docs] +class ERT(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the ERT system test @@ -130,9 +132,13 @@

    Source code for CIME.SystemTests.ert

             # Compare restart file
             self._component_compare_test("base", "rest")
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): self._ert_first_phase() - self._ert_second_phase()
    + self._ert_second_phase()
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/funit.html b/versions/master/html/_modules/CIME/SystemTests/funit.html index 73e71136133..461e42f04dc 100644 --- a/versions/master/html/_modules/CIME/SystemTests/funit.html +++ b/versions/master/html/_modules/CIME/SystemTests/funit.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.SystemTests.funit

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class FUNIT(SystemTestsCommon): +
    +[docs] +class FUNIT(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the FUNIT system test @@ -105,7 +107,9 @@

    Source code for CIME.SystemTests.funit

             SystemTestsCommon.__init__(self, case, **kwargs)
             case.load_env()
     
    -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): if not sharedlib_only: exeroot = self._case.get_value("EXEROOT") logfile = os.path.join(exeroot, "funit.bldlog") @@ -114,13 +118,19 @@

    Source code for CIME.SystemTests.funit

     
                 post_build(self._case, [logfile], build_complete=True)
    -
    [docs] def get_test_spec_dir(self): + +
    +[docs] + def get_test_spec_dir(self): """ Override this to change what gets tested. """ return get_cime_root()
    -
    [docs] def run_phase(self): + +
    +[docs] + def run_phase(self): rundir = self._case.get_value("RUNDIR") exeroot = self._case.get_value("EXEROOT") @@ -148,6 +158,7 @@

    Source code for CIME.SystemTests.funit

     
             expect(stat == 0, "RUN FAIL for FUNIT")
    + # Funit is a bit of an oddball test since it's not really running the E3SM model # We need to override some methods to make the core infrastructure work. @@ -158,6 +169,7 @@

    Source code for CIME.SystemTests.funit

         def _compare_baseline(self):
             with self._test_status:
                 self._test_status.set_status(BASELINE_PHASE, TEST_PASS_STATUS)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/homme.html b/versions/master/html/_modules/CIME/SystemTests/homme.html index 2f47866f19b..8570e293b03 100644 --- a/versions/master/html/_modules/CIME/SystemTests/homme.html +++ b/versions/master/html/_modules/CIME/SystemTests/homme.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -87,10 +87,13 @@

    Source code for CIME.SystemTests.homme

     from CIME.SystemTests.hommebaseclass import HommeBase
     
     
    -
    [docs]class HOMME(HommeBase): +
    +[docs] +class HOMME(HommeBase): def __init__(self, case, **kwargs): HommeBase.__init__(self, case, **kwargs) self.cmakesuffix = ""
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/hommebaseclass.html b/versions/master/html/_modules/CIME/SystemTests/hommebaseclass.html index bbe8f3a9aeb..568e65e6307 100644 --- a/versions/master/html/_modules/CIME/SystemTests/hommebaseclass.html +++ b/versions/master/html/_modules/CIME/SystemTests/hommebaseclass.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -99,7 +99,9 @@

    Source code for CIME.SystemTests.hommebaseclass

    < logger = logging.getLogger(__name__) -
    [docs]class HommeBase(SystemTestsCommon): +
    +[docs] +class HommeBase(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the SMS system test @@ -109,7 +111,9 @@

    Source code for CIME.SystemTests.hommebaseclass

    < self.csnd = "not defined" self.cmakesuffix = self.csnd -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): if not sharedlib_only: # Build HOMME srcroot = self._case.get_value("SRCROOT") @@ -156,7 +160,10 @@

    Source code for CIME.SystemTests.hommebaseclass

    < self._case, [os.path.join(exeroot, "homme.bldlog")], build_complete=True )
    -
    [docs] def run_phase(self): + +
    +[docs] + def run_phase(self): rundir = self._case.get_value("RUNDIR") exeroot = self._case.get_value("EXEROOT") @@ -219,6 +226,7 @@

    Source code for CIME.SystemTests.hommebaseclass

    < expect(stat == 0, "RUN FAIL for HOMME")
    + # Homme is a bit of an oddball test since it's not really running the E3SM model # We need to override some methods to make the core infrastructure work. @@ -229,6 +237,7 @@

    Source code for CIME.SystemTests.hommebaseclass

    < def _compare_baseline(self): with self._test_status: self._test_status.set_status(BASELINE_PHASE, TEST_PASS_STATUS)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/hommebfb.html b/versions/master/html/_modules/CIME/SystemTests/hommebfb.html index 251b32f6820..0b4f1c05412 100644 --- a/versions/master/html/_modules/CIME/SystemTests/hommebfb.html +++ b/versions/master/html/_modules/CIME/SystemTests/hommebfb.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -87,10 +87,13 @@

    Source code for CIME.SystemTests.hommebfb

     from CIME.SystemTests.hommebaseclass import HommeBase
     
     
    -
    [docs]class HOMMEBFB(HommeBase): +
    +[docs] +class HOMMEBFB(HommeBase): def __init__(self, case, **kwargs): HommeBase.__init__(self, case, **kwargs) self.cmakesuffix = "-bfb"
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/icp.html b/versions/master/html/_modules/CIME/SystemTests/icp.html index 1da308df199..e2d3631a733 100644 --- a/versions/master/html/_modules/CIME/SystemTests/icp.html +++ b/versions/master/html/_modules/CIME/SystemTests/icp.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -91,24 +91,33 @@

    Source code for CIME.SystemTests.icp

     from CIME.SystemTests.system_tests_common import SystemTestsCommon
     
     
    -
    [docs]class ICP(SystemTestsCommon): +
    +[docs] +class ICP(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to file env_test.xml in the case directory """ SystemTestsCommon.__init__(self, case, **kwargs) -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): self._case.set_value("CICE_AUTO_DECOMP", "false")
    -
    [docs] def run_phase(self): + +
    +[docs] + def run_phase(self): self._case.set_value("CONTINUE_RUN", False) self._case.set_value("REST_OPTION", "none") self._case.set_value("HIST_OPTION", "$STOP_OPTION") self._case.set_value("HIST_N", "$STOP_N") self._case.flush() - self.run_indv(self)
    + self.run_indv(self)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/irt.html b/versions/master/html/_modules/CIME/SystemTests/irt.html index 9f4b7d09e50..d48730827f9 100644 --- a/versions/master/html/_modules/CIME/SystemTests/irt.html +++ b/versions/master/html/_modules/CIME/SystemTests/irt.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -104,7 +104,9 @@

    Source code for CIME.SystemTests.irt

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class IRT(RestartTest): +
    +[docs] +class IRT(RestartTest): def __init__(self, case, **kwargs): RestartTest.__init__( self, @@ -129,6 +131,7 @@

    Source code for CIME.SystemTests.irt

             self._case2.restore_from_archive(
                 rest_dir=os.path.abspath(os.path.join(dout_s_root, "rest", restart_list[0]))
             )
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/ldsta.html b/versions/master/html/_modules/CIME/SystemTests/ldsta.html index 894b5844fcd..f24954e63b0 100644 --- a/versions/master/html/_modules/CIME/SystemTests/ldsta.html +++ b/versions/master/html/_modules/CIME/SystemTests/ldsta.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -115,14 +115,18 @@

    Source code for CIME.SystemTests.ldsta

         )
     
     
    -
    [docs]class LDSTA(SystemTestsCommon): +
    +[docs] +class LDSTA(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the SMS system test """ SystemTestsCommon.__init__(self, case, **kwargs) -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): archive_dir = self._case.get_value("DOUT_S_ROOT") if os.path.isdir(archive_dir): shutil.rmtree(archive_dir) @@ -162,7 +166,9 @@

    Source code for CIME.SystemTests.ldsta

                     )
                 num_days = random.randint(1, min(3, days_left))
                 days_left -= num_days
    -            current_date += num_days * delta_day
    + current_date += num_days * delta_day
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/mcc.html b/versions/master/html/_modules/CIME/SystemTests/mcc.html index 92033137707..fc3b985ee6a 100644 --- a/versions/master/html/_modules/CIME/SystemTests/mcc.html +++ b/versions/master/html/_modules/CIME/SystemTests/mcc.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.SystemTests.mcc

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class MCC(SystemTestsCompareTwo): +
    +[docs] +class MCC(SystemTestsCompareTwo): def __init__(self, case, **kwargs): self._comp_classes = [] self._test_instances = 3 @@ -118,6 +120,7 @@

    Source code for CIME.SystemTests.mcc

     
         def _case_two_setup(self):
             self._case.set_value("NINST", 1)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/mvk.html b/versions/master/html/_modules/CIME/SystemTests/mvk.html index f13c7057d27..5509b42c9c8 100644 --- a/versions/master/html/_modules/CIME/SystemTests/mvk.html +++ b/versions/master/html/_modules/CIME/SystemTests/mvk.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -113,7 +113,9 @@

    Source code for CIME.SystemTests.mvk

     NINST = 30
     
     
    -
    [docs]class MVK(SystemTestsCommon): +
    +[docs] +class MVK(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the MVK test @@ -133,7 +135,9 @@

    Source code for CIME.SystemTests.mvk

             else:
                 self._case.set_value("COMPARE_BASELINE", False)
     
    -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): # Only want this to happen once. It will impact the sharedlib build # so it has to happen there. if not model_only: @@ -162,6 +166,7 @@

    Source code for CIME.SystemTests.mvk

     
             self.build_indv(sharedlib_only=sharedlib_only, model_only=model_only)
    + def _generate_baseline(self): """ generate a new baseline case based on the current test @@ -290,6 +295,7 @@

    Source code for CIME.SystemTests.mvk

                 )
     
                 CIME.utils.append_testlog(comments, self._orig_caseroot)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/nck.html b/versions/master/html/_modules/CIME/SystemTests/nck.html index 5b08446e71f..ec7cfebf877 100644 --- a/versions/master/html/_modules/CIME/SystemTests/nck.html +++ b/versions/master/html/_modules/CIME/SystemTests/nck.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -100,7 +100,9 @@

    Source code for CIME.SystemTests.nck

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class NCK(SystemTestsCompareTwo): +
    +[docs] +class NCK(SystemTestsCompareTwo): def __init__(self, case, **kwargs): self._comp_classes = [] SystemTestsCompareTwo.__init__( @@ -148,6 +150,7 @@

    Source code for CIME.SystemTests.nck

                     self._case.set_value("ROOTPE_{}".format(comp), int(rootpe - ntasks))
                 self._case.set_value("NTASKS_{}".format(comp), ntasks * 2)
             self._case.case_setup(test_mode=True, reset=True)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/ncr.html b/versions/master/html/_modules/CIME/SystemTests/ncr.html index d23d214a383..6958073b3ae 100644 --- a/versions/master/html/_modules/CIME/SystemTests/ncr.html +++ b/versions/master/html/_modules/CIME/SystemTests/ncr.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -100,7 +100,9 @@

    Source code for CIME.SystemTests.ncr

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class NCR(SystemTestsCompareTwo): +
    +[docs] +class NCR(SystemTestsCompareTwo): def __init__(self, case, **kwargs): """ initialize an NCR test @@ -153,6 +155,7 @@

    Source code for CIME.SystemTests.ncr

             for comp in self._comp_classes():
                 self._case.set_value("NINST_{}".format(comp), str(1))
                 self._case.set_value("ROOTPE_{}".format(comp), 0)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/nodefail.html b/versions/master/html/_modules/CIME/SystemTests/nodefail.html index 52961094248..03c63b525b6 100644 --- a/versions/master/html/_modules/CIME/SystemTests/nodefail.html +++ b/versions/master/html/_modules/CIME/SystemTests/nodefail.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.SystemTests.nodefail

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class NODEFAIL(ERS): +
    +[docs] +class NODEFAIL(ERS): def __init__(self, case, **kwargs): """ initialize an object interface to the ERS system test @@ -162,10 +164,14 @@

    Source code for CIME.SystemTests.nodefail

             env_mach_specific.set_value("run_exe", prev_run_exe)
             self._case.flush(flushall=True)
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): self._ers_first_phase() self._restart_fake_phase() - self._ers_second_phase()
    + self._ers_second_phase()
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/pea.html b/versions/master/html/_modules/CIME/SystemTests/pea.html index 8bc0ee9e32d..09db241dd45 100644 --- a/versions/master/html/_modules/CIME/SystemTests/pea.html +++ b/versions/master/html/_modules/CIME/SystemTests/pea.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -99,7 +99,9 @@

    Source code for CIME.SystemTests.pea

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class PEA(SystemTestsCompareTwo): +
    +[docs] +class PEA(SystemTestsCompareTwo): def __init__(self, case, **kwargs): SystemTestsCompareTwo.__init__( self, @@ -135,6 +137,7 @@

    Source code for CIME.SystemTests.pea

             if os.path.isfile("Macros"):
                 os.remove("Macros")
             self._case.case_setup(test_mode=True, reset=True)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/pem.html b/versions/master/html/_modules/CIME/SystemTests/pem.html index fc092bcd671..655b6464b80 100644 --- a/versions/master/html/_modules/CIME/SystemTests/pem.html +++ b/versions/master/html/_modules/CIME/SystemTests/pem.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -100,7 +100,9 @@

    Source code for CIME.SystemTests.pem

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class PEM(SystemTestsCompareTwo): +
    +[docs] +class PEM(SystemTestsCompareTwo): def __init__(self, case, **kwargs): build_separately = False # cice, pop require separate builds @@ -129,6 +131,7 @@

    Source code for CIME.SystemTests.pem

                     self._case.set_value("NTASKS_{}".format(comp), int(ntasks / 2))
                     self._case.set_value("ROOTPE_{}".format(comp), int(rootpe / 2))
             self._case.case_setup(test_mode=True, reset=True)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/pet.html b/versions/master/html/_modules/CIME/SystemTests/pet.html index 6c9e06509f3..ed37b391a97 100644 --- a/versions/master/html/_modules/CIME/SystemTests/pet.html +++ b/versions/master/html/_modules/CIME/SystemTests/pet.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,7 +98,9 @@

    Source code for CIME.SystemTests.pet

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class PET(SystemTestsCompareTwo): +
    +[docs] +class PET(SystemTestsCompareTwo): def __init__(self, case, **kwargs): """ initialize a test object @@ -129,6 +131,7 @@

    Source code for CIME.SystemTests.pet

     
             # Need to redo case_setup because we may have changed the number of threads
             self._case.case_setup(reset=True, test_mode=True)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/pfs.html b/versions/master/html/_modules/CIME/SystemTests/pfs.html index 42bd7ee7362..2ecf8769fd8 100644 --- a/versions/master/html/_modules/CIME/SystemTests/pfs.html +++ b/versions/master/html/_modules/CIME/SystemTests/pfs.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,16 +96,22 @@

    Source code for CIME.SystemTests.pfs

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class PFS(SystemTestsCommon): +
    +[docs] +class PFS(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the PFS system test """ SystemTestsCommon.__init__(self, case, **kwargs) -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): logger.info("doing an 20 day initial test, no restarts written") - self.run_indv(suffix=None)
    + self.run_indv(suffix=None)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/pgn.html b/versions/master/html/_modules/CIME/SystemTests/pgn.html index 6e59eb80d9a..c5b50962d80 100644 --- a/versions/master/html/_modules/CIME/SystemTests/pgn.html +++ b/versions/master/html/_modules/CIME/SystemTests/pgn.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -135,7 +135,9 @@

    Source code for CIME.SystemTests.pgn

     INSTANCE_FILE_TEMPLATE = "{}{}_{:04d}.h0.0001-01-01-00000{}.nc"
     
     
    -
    [docs]class PGN(SystemTestsCommon): +
    +[docs] +class PGN(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the PGN test @@ -152,7 +154,9 @@

    Source code for CIME.SystemTests.pgn

                 self.atmmodIC = "cam"
                 self.lndmodIC = "clm2"
     
    -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): ninst = NUMBER_INITIAL_CONDITIONS * len(PERTURBATIONS) logger.debug("PGN_INFO: number of instance: " + str(ninst)) @@ -218,7 +222,10 @@

    Source code for CIME.SystemTests.pgn

             self._case.set_value("STOP_OPTION", "nsteps")
             self.build_indv(sharedlib_only=sharedlib_only, model_only=model_only)
    -
    [docs] def get_var_list(self): + +
    +[docs] + def get_var_list(self): """ Get variable list for pergro specific output vars """ @@ -235,6 +242,7 @@

    Source code for CIME.SystemTests.pgn

     
             return list(map(str.strip, var_list))
    + def _compare_baseline(self): """ Compare baselines in the pergro test sense. That is, @@ -340,7 +348,9 @@

    Source code for CIME.SystemTests.pgn

     
                 CIME.utils.append_testlog(comments, self._orig_caseroot)
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): logger.debug("PGN_INFO: RUN PHASE") self.run_indv() @@ -381,6 +391,7 @@

    Source code for CIME.SystemTests.pgn

     
             logger.debug("PGN_INFO: RUN PHASE ENDS")
    + def _generate_baseline(self): super(PGN, self)._generate_baseline() @@ -436,6 +447,7 @@

    Source code for CIME.SystemTests.pgn

     
             logger.debug("PGN_INFO:copy:{} to {}".format(FCLD_NC, basegen_dir))
             shutil.copy(os.path.join(rundir, FCLD_NC), basegen_dir)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/pre.html b/versions/master/html/_modules/CIME/SystemTests/pre.html index 28b188aecce..b4d71e16bce 100644 --- a/versions/master/html/_modules/CIME/SystemTests/pre.html +++ b/versions/master/html/_modules/CIME/SystemTests/pre.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -101,7 +101,9 @@

    Source code for CIME.SystemTests.pre

     from CIME.hist_utils import cprnc
     
     ###############################################################################
    -
    [docs]class PRE(SystemTestsCompareTwo): +
    +[docs] +class PRE(SystemTestsCompareTwo): ############################################################################### """ Implementation of the CIME pause/resume test: Tests having driver @@ -158,7 +160,9 @@

    Source code for CIME.SystemTests.pre

             self._case.flush()
     
         ###########################################################################
    -
    [docs] def run_phase(self): # pylint: disable=arguments-differ +
    +[docs] + def run_phase(self): # pylint: disable=arguments-differ ########################################################################### self._activate_case2() should_match = self._case.get_value("DESP_MODE") == "NOCHANGE" @@ -229,7 +233,9 @@

    Source code for CIME.SystemTests.pre

                 "Not all restart files {}".format(
                     "matched" if should_match else "failed to match"
                 ),
    -        )
    + )
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/rep.html b/versions/master/html/_modules/CIME/SystemTests/rep.html index 7e1d368f6ee..7e1ec4e9126 100644 --- a/versions/master/html/_modules/CIME/SystemTests/rep.html +++ b/versions/master/html/_modules/CIME/SystemTests/rep.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -93,7 +93,9 @@

    Source code for CIME.SystemTests.rep

     from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo
     
     
    -
    [docs]class REP(SystemTestsCompareTwo): +
    +[docs] +class REP(SystemTestsCompareTwo): def __init__(self, case, **kwargs): SystemTestsCompareTwo.__init__( self, case, separate_builds=False, run_two_suffix="rep2", **kwargs @@ -104,6 +106,7 @@

    Source code for CIME.SystemTests.rep

     
         def _case_two_setup(self):
             pass
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/restart_tests.html b/versions/master/html/_modules/CIME/SystemTests/restart_tests.html index 55c420ce2b9..adda55ed8a1 100644 --- a/versions/master/html/_modules/CIME/SystemTests/restart_tests.html +++ b/versions/master/html/_modules/CIME/SystemTests/restart_tests.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.SystemTests.restart_tests

    logger = logging.getLogger(__name__) -

    [docs]class RestartTest(SystemTestsCompareTwo): +
    +[docs] +class RestartTest(SystemTestsCompareTwo): def __init__( self, case, @@ -136,6 +138,7 @@

    Source code for CIME.SystemTests.restart_tests

    self._case.set_value("STOP_N", stop_new) self._case.set_value("CONTINUE_RUN", True) self._case.set_value("REST_OPTION", "never")

    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/reuseinitfiles.html b/versions/master/html/_modules/CIME/SystemTests/reuseinitfiles.html index 5be539c5bee..8f28e1cd513 100644 --- a/versions/master/html/_modules/CIME/SystemTests/reuseinitfiles.html +++ b/versions/master/html/_modules/CIME/SystemTests/reuseinitfiles.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -105,7 +105,9 @@

    Source code for CIME.SystemTests.reuseinitfiles

    < from CIME.SystemTests.system_tests_common import INIT_GENERATED_FILES_DIRNAME -
    [docs]class REUSEINITFILES(SystemTestsCompareTwo): +
    +[docs] +class REUSEINITFILES(SystemTestsCompareTwo): def __init__(self, case, **kwargs): SystemTestsCompareTwo.__init__( self, @@ -145,6 +147,7 @@

    Source code for CIME.SystemTests.reuseinitfiles

    < shutil.rmtree(case2_igf_dir) shutil.copytree(case1_igf_dir, case2_igf_dir)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/seq.html b/versions/master/html/_modules/CIME/SystemTests/seq.html index ce6bb57765d..b065271c165 100644 --- a/versions/master/html/_modules/CIME/SystemTests/seq.html +++ b/versions/master/html/_modules/CIME/SystemTests/seq.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -93,7 +93,9 @@

    Source code for CIME.SystemTests.seq

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class SEQ(SystemTestsCompareTwo): +
    +[docs] +class SEQ(SystemTestsCompareTwo): def __init__(self, case, **kwargs): """ initialize an object interface to file env_test.xml in the case directory @@ -136,6 +138,7 @@

    Source code for CIME.SystemTests.seq

     
             self._case.flush()
             self._case.case_setup(test_mode=True, reset=True)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/sms.html b/versions/master/html/_modules/CIME/SystemTests/sms.html index ea31f03d525..94a0d5fa84a 100644 --- a/versions/master/html/_modules/CIME/SystemTests/sms.html +++ b/versions/master/html/_modules/CIME/SystemTests/sms.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,12 +95,15 @@

    Source code for CIME.SystemTests.sms

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class SMS(SystemTestsCommon): +
    +[docs] +class SMS(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the SMS system test """ SystemTestsCommon.__init__(self, case, **kwargs)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/system_tests_common.html b/versions/master/html/_modules/CIME/SystemTests/system_tests_common.html index 09f80e66e0d..f66f8022768 100644 --- a/versions/master/html/_modules/CIME/SystemTests/system_tests_common.html +++ b/versions/master/html/_modules/CIME/SystemTests/system_tests_common.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -112,6 +112,14 @@

    Source code for CIME.SystemTests.system_tests_common

    from CIME.config import Config from CIME.provenance import save_test_time, get_test_success from CIME.locked_files import LOCKED_DIR, lock_file, is_locked +from CIME.baselines.performance import ( + get_latest_cpl_logs, + _perf_get_memory, + perf_compare_memory_baseline, + perf_compare_throughput_baseline, + perf_write_baseline, + load_coupler_customization, +) import CIME.build as build import glob, gzip, time, traceback, os @@ -123,7 +131,9 @@

    Source code for CIME.SystemTests.system_tests_common

    INIT_GENERATED_FILES_DIRNAME = "init_generated_files" -
    [docs]def fix_single_exe_case(case): +
    +[docs] +def fix_single_exe_case(case): """Fixes cases created with --single-exe. When tests are created using --single-exe, the test_scheduler will set @@ -149,7 +159,10 @@

    Source code for CIME.SystemTests.system_tests_common

    return False
    -
    [docs]def is_single_exe_case(case): + +
    +[docs] +def is_single_exe_case(case): """Determines if the case was created with the --single-exe option. If `CASEROOT` is not part of `EXEROOT` and the `TEST` variable is True, @@ -168,7 +181,10 @@

    Source code for CIME.SystemTests.system_tests_common

    return caseroot not in exeroot and test
    -
    [docs]class SystemTestsCommon(object): + +
    +[docs] +class SystemTestsCommon(object): def __init__( self, case, expected=None, **kwargs ): # pylint: disable=unused-argument @@ -233,7 +249,9 @@

    Source code for CIME.SystemTests.system_tests_common

    self._case.case_setup(reset=True, test_mode=True) fix_single_exe_case(self._case) -
    [docs] def build( +
    +[docs] + def build( self, sharedlib_only=False, model_only=False, @@ -303,7 +321,10 @@

    Source code for CIME.SystemTests.system_tests_common

    return success
    -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): + +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): """ This is the default build phase implementation, it just does an individual build. This is the subclass' extension point if they need to define a custom build @@ -313,7 +334,10 @@

    Source code for CIME.SystemTests.system_tests_common

    """ self.build_indv(sharedlib_only=sharedlib_only, model_only=model_only)
    -
    [docs] def build_indv(self, sharedlib_only=False, model_only=False): + +
    +[docs] + def build_indv(self, sharedlib_only=False, model_only=False): """ Perform an individual build """ @@ -330,12 +354,18 @@

    Source code for CIME.SystemTests.system_tests_common

    ) logger.info("build_indv complete")
    -
    [docs] def clean_build(self, comps=None): + +
    +[docs] + def clean_build(self, comps=None): if comps is None: comps = [x.lower() for x in self._case.get_values("COMP_CLASSES")] build.clean(self._case, cleanlist=comps)
    -
    [docs] def run(self, skip_pnl=False): + +
    +[docs] + def run(self, skip_pnl=False): """ Do NOT override this method, this method is the framework that controls the run phase. run_phase is the extension point that subclasses should use. @@ -485,7 +515,10 @@

    Source code for CIME.SystemTests.system_tests_common

    # with this return value. return success
    -
    [docs] def run_phase(self): + +
    +[docs] + def run_phase(self): """ This is the default run phase implementation, it just does an individual run. This is the subclass' extension point if they need to define a custom run phase. @@ -494,6 +527,7 @@

    Source code for CIME.SystemTests.system_tests_common

    """ self.run_indv()
    + def _get_caseroot(self): """ Returns the current CASEROOT value @@ -508,7 +542,9 @@

    Source code for CIME.SystemTests.system_tests_common

    self._case.load_env(reset=True) self._caseroot = case.get_value("CASEROOT") -
    [docs] def run_indv( +
    +[docs] + def run_indv( self, suffix="base", st_archive=False, @@ -527,6 +563,15 @@

    Source code for CIME.SystemTests.system_tests_common

    stop_option = self._case.get_value("STOP_OPTION") run_type = self._case.get_value("RUN_TYPE") rundir = self._case.get_value("RUNDIR") + try: + self._case.check_all_input_data() + except CIMEError: + caseroot = self._case.get_value("CASEROOT") + raise CIMEError( + "Could not find all inputdata on any server, try " + "manually running `./check_input_data --download " + f"--versbose` from {caseroot!r}." + ) from None if submit_resubmits is None: do_resub = self._case.get_value("BATCH_SYSTEM") != "none" else: @@ -569,8 +614,9 @@

    Source code for CIME.SystemTests.system_tests_common

    if st_archive: self._case.case_st_archive(resubmit=True)
    + def _coupler_log_indicates_run_complete(self): - newestcpllogfiles = self._get_latest_cpl_logs() + newestcpllogfiles = get_latest_cpl_logs(self._case) logger.debug("Latest Coupler log file(s) {}".format(newestcpllogfiles)) # Exception is raised if the file is not compressed allgood = len(newestcpllogfiles) @@ -675,43 +721,6 @@

    Source code for CIME.SystemTests.system_tests_common

    else: self._test_status.set_status(STARCHIVE_PHASE, TEST_FAIL_STATUS) - def _get_mem_usage(self, cpllog): - """ - Examine memory usage as recorded in the cpl log file and look for unexpected - increases. - """ - memlist = [] - meminfo = re.compile( - r".*model date =\s+(\w+).*memory =\s+(\d+\.?\d+).*highwater" - ) - if cpllog is not None and os.path.isfile(cpllog): - if ".gz" == cpllog[-3:]: - fopen = gzip.open - else: - fopen = open - with fopen(cpllog, "rb") as f: - for line in f: - m = meminfo.match(line.decode("utf-8")) - if m: - memlist.append((float(m.group(1)), float(m.group(2)))) - # Remove the last mem record, it's sometimes artificially high - if len(memlist) > 0: - memlist.pop() - return memlist - - def _get_throughput(self, cpllog): - """ - Examine memory usage as recorded in the cpl log file and look for unexpected - increases. - """ - if cpllog is not None and os.path.isfile(cpllog): - with gzip.open(cpllog, "rb") as f: - cpltext = f.read().decode("utf-8") - m = re.search(r"# simulated years / cmp-day =\s+(\d+\.\d+)\s", cpltext) - if m: - return float(m.group(1)) - return None - def _phase_modifying_call(self, phase, function): """ Ensures that unexpected exceptions from phases will result in a FAIL result @@ -738,49 +747,33 @@

    Source code for CIME.SystemTests.system_tests_common

    Examine memory usage as recorded in the cpl log file and look for unexpected increases. """ + config = load_coupler_customization(self._case) + + # default to 0.1 + tolerance = self._case.get_value("TEST_MEMLEAK_TOLERANCE") or 0.1 + + expect(tolerance > 0.0, "Bad value for memleak tolerance in test") + with self._test_status: - latestcpllogs = self._get_latest_cpl_logs() - for cpllog in latestcpllogs: - memlist = self._get_mem_usage(cpllog) + try: + memleak, comment = config.perf_check_for_memory_leak( + self._case, tolerance + ) + except AttributeError: + memleak, comment = perf_check_for_memory_leak(self._case, tolerance) - if len(memlist) < 3: - self._test_status.set_status( - MEMLEAK_PHASE, - TEST_PASS_STATUS, - comments="insuffiencient data for memleak test", - ) - else: - finaldate = int(memlist[-1][0]) - originaldate = int( - memlist[1][0] - ) # skip first day mem record, it can be too low while initializing - finalmem = float(memlist[-1][1]) - originalmem = float(memlist[1][1]) - memdiff = -1 - if originalmem > 0: - memdiff = (finalmem - originalmem) / originalmem - tolerance = self._case.get_value("TEST_MEMLEAK_TOLERANCE") - if tolerance is None: - tolerance = 0.1 - expect(tolerance > 0.0, "Bad value for memleak tolerance in test") - if memdiff < 0: - self._test_status.set_status( - MEMLEAK_PHASE, - TEST_PASS_STATUS, - comments="data for memleak test is insuffiencient", - ) - elif memdiff < tolerance: - self._test_status.set_status(MEMLEAK_PHASE, TEST_PASS_STATUS) - else: - comment = "memleak detected, memory went from {:f} to {:f} in {:d} days".format( - originalmem, finalmem, finaldate - originaldate - ) - append_testlog(comment, self._orig_caseroot) - self._test_status.set_status( - MEMLEAK_PHASE, TEST_FAIL_STATUS, comments=comment - ) + if memleak: + append_testlog(comment, self._orig_caseroot) -
    [docs] def compare_env_run(self, expected=None): + status = TEST_FAIL_STATUS + else: + status = TEST_PASS_STATUS + + self._test_status.set_status(MEMLEAK_PHASE, status, comments=comment) + +
    +[docs] + def compare_env_run(self, expected=None): """ Compare env_run file to original and warn about differences """ @@ -805,121 +798,46 @@

    Source code for CIME.SystemTests.system_tests_common

    return False return True
    - def _get_latest_cpl_logs(self): + + def _compare_memory(self): """ - find and return the latest cpl log file in the run directory + Compares current test memory usage to baseline. """ - coupler_log_path = self._case.get_value("RUNDIR") - cpllogs = glob.glob( - os.path.join(coupler_log_path, "{}*.log.*".format(self._cpllog)) - ) - lastcpllogs = [] - if cpllogs: - lastcpllogs.append(max(cpllogs, key=os.path.getctime)) - basename = os.path.basename(lastcpllogs[0]) - suffix = basename.split(".", 1)[1] - for log in cpllogs: - if log in lastcpllogs: - continue - - if log.endswith(suffix): - lastcpllogs.append(log) + with self._test_status: + below_tolerance, comment = perf_compare_memory_baseline(self._case) - return lastcpllogs + if below_tolerance is not None: + append_testlog(comment, self._orig_caseroot) - def _compare_memory(self): - with self._test_status: - # compare memory usage to baseline - baseline_name = self._case.get_value("BASECMP_CASE") - basecmp_dir = os.path.join( - self._case.get_value("BASELINE_ROOT"), baseline_name - ) - newestcpllogfiles = self._get_latest_cpl_logs() - if len(newestcpllogfiles) > 0: - memlist = self._get_mem_usage(newestcpllogfiles[0]) - for cpllog in newestcpllogfiles: - m = re.search(r"/({}.*.log).*.gz".format(self._cpllog), cpllog) - if m is not None: - baselog = os.path.join(basecmp_dir, m.group(1)) + ".gz" - if baselog is None or not os.path.isfile(baselog): - # for backward compatibility - baselog = os.path.join(basecmp_dir, self._cpllog + ".log") - if os.path.isfile(baselog) and len(memlist) > 3: - blmem = self._get_mem_usage(baselog) - blmem = 0 if blmem == [] else blmem[-1][1] - curmem = memlist[-1][1] - diff = 0.0 if blmem == 0 else (curmem - blmem) / blmem - tolerance = self._case.get_value("TEST_MEMLEAK_TOLERANCE") - if tolerance is None: - tolerance = 0.1 - if ( - diff < tolerance - and self._test_status.get_status(MEMCOMP_PHASE) is None - ): - self._test_status.set_status(MEMCOMP_PHASE, TEST_PASS_STATUS) - elif ( - self._test_status.get_status(MEMCOMP_PHASE) != TEST_FAIL_STATUS - ): - comment = "Error: Memory usage increase >{:d}% from baseline's {:f} to {:f}".format( - int(tolerance * 100), blmem, curmem - ) - self._test_status.set_status( - MEMCOMP_PHASE, TEST_FAIL_STATUS, comments=comment - ) - append_testlog(comment, self._orig_caseroot) + if ( + below_tolerance + and self._test_status.get_status(MEMCOMP_PHASE) is None + ): + self._test_status.set_status(MEMCOMP_PHASE, TEST_PASS_STATUS) + elif self._test_status.get_status(MEMCOMP_PHASE) != TEST_FAIL_STATUS: + self._test_status.set_status( + MEMCOMP_PHASE, TEST_FAIL_STATUS, comments=comment + ) def _compare_throughput(self): + """ + Compares current test throughput to baseline. + """ with self._test_status: - # compare memory usage to baseline - baseline_name = self._case.get_value("BASECMP_CASE") - basecmp_dir = os.path.join( - self._case.get_value("BASELINE_ROOT"), baseline_name - ) - newestcpllogfiles = self._get_latest_cpl_logs() - for cpllog in newestcpllogfiles: - m = re.search(r"/({}.*.log).*.gz".format(self._cpllog), cpllog) - if m is not None: - baselog = os.path.join(basecmp_dir, m.group(1)) + ".gz" - if baselog is None or not os.path.isfile(baselog): - # for backward compatibility - baselog = os.path.join(basecmp_dir, self._cpllog) - - if os.path.isfile(baselog): - # compare throughput to baseline - current = self._get_throughput(cpllog) - baseline = self._get_throughput(baselog) - # comparing ypd so bigger is better - if baseline is not None and current is not None: - diff = (baseline - current) / baseline - tolerance = self._case.get_value("TEST_TPUT_TOLERANCE") - if tolerance is None: - tolerance = 0.1 - expect( - tolerance > 0.0, - "Bad value for throughput tolerance in test", - ) - comment = "TPUTCOMP: Computation time changed by {:.2f}% relative to baseline".format( - diff * 100 - ) - append_testlog(comment, self._orig_caseroot) - if ( - diff < tolerance - and self._test_status.get_status(THROUGHPUT_PHASE) is None - ): - self._test_status.set_status( - THROUGHPUT_PHASE, TEST_PASS_STATUS - ) - elif ( - self._test_status.get_status(THROUGHPUT_PHASE) - != TEST_FAIL_STATUS - ): - comment = "Error: TPUTCOMP: Computation time increase > {:d}% from baseline".format( - int(tolerance * 100) - ) - self._test_status.set_status( - THROUGHPUT_PHASE, TEST_FAIL_STATUS, comments=comment - ) - append_testlog(comment, self._orig_caseroot) + below_tolerance, comment = perf_compare_throughput_baseline(self._case) + + if below_tolerance is not None: + append_testlog(comment, self._orig_caseroot) + + if ( + below_tolerance + and self._test_status.get_status(THROUGHPUT_PHASE) is None + ): + self._test_status.set_status(THROUGHPUT_PHASE, TEST_PASS_STATUS) + elif self._test_status.get_status(THROUGHPUT_PHASE) != TEST_FAIL_STATUS: + self._test_status.set_status( + THROUGHPUT_PHASE, TEST_FAIL_STATUS, comments=comment + ) def _compare_baseline(self): """ @@ -961,20 +879,67 @@

    Source code for CIME.SystemTests.system_tests_common

    ) # copy latest cpl log to baseline # drop the date so that the name is generic - newestcpllogfiles = self._get_latest_cpl_logs() + newestcpllogfiles = get_latest_cpl_logs(self._case) with SharedArea(): + # TODO ever actually more than one cpl log? for cpllog in newestcpllogfiles: m = re.search(r"/({}.*.log).*.gz".format(self._cpllog), cpllog) + if m is not None: baselog = os.path.join(basegen_dir, m.group(1)) + ".gz" + safe_copy( cpllog, os.path.join(basegen_dir, baselog), preserve_meta=False, - )
    + ) + + perf_write_baseline(self._case, basegen_dir, cpllog)
    + + + +
    +[docs] +def perf_check_for_memory_leak(case, tolerance): + leak = False + comment = "" + + latestcpllogs = get_latest_cpl_logs(case) + + for cpllog in latestcpllogs: + try: + memlist = _perf_get_memory(case, cpllog) + except RuntimeError: + return False, "insufficient data for memleak test" + + # last day - second day, skip first day, can be too low while initializing + elapsed_days = int(memlist[-1][0]) - int(memlist[1][0]) + finalmem, originalmem = float(memlist[-1][1]), float(memlist[1][1]) -
    [docs]class FakeTest(SystemTestsCommon): + memdiff = -1 if originalmem <= 0 else (finalmem - originalmem) / originalmem + + if memdiff < 0: + leak = False + comment = "data for memleak test is insufficient" + elif memdiff < tolerance: + leak = False + comment = "" + else: + leak = True + comment = ( + "memleak detected, memory went from {:f} to {:f} in {:d} days".format( + originalmem, finalmem, elapsed_days + ) + ) + + return leak, comment
    + + + +
    +[docs] +class FakeTest(SystemTestsCommon): """ Inheriters of the FakeTest Class are intended to test the code. @@ -999,7 +964,9 @@

    Source code for CIME.SystemTests.system_tests_common

    super(FakeTest, self)._resetup_case(phase, reset=reset) self._case.set_value("run_exe", run_exe) -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): if self._requires_exe: super(FakeTest, self).build_phase( sharedlib_only=sharedlib_only, model_only=model_only @@ -1029,7 +996,10 @@

    Source code for CIME.SystemTests.system_tests_common

    ) )
    -
    [docs] def run_indv( + +
    +[docs] + def run_indv( self, suffix="base", st_archive=False, @@ -1042,11 +1012,17 @@

    Source code for CIME.SystemTests.system_tests_common

    os.environ["MPI_SHEPHERD"] = "true" super(FakeTest, self).run_indv( suffix, st_archive=st_archive, submit_resubmits=submit_resubmits - )
    + )
    +
    + -
    [docs]class TESTRUNPASS(FakeTest): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] +class TESTRUNPASS(FakeTest): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): rundir = self._case.get_value("RUNDIR") cimeroot = self._case.get_value("CIMEROOT") case = self._case.get_value("CASE") @@ -1058,10 +1034,14 @@

    Source code for CIME.SystemTests.system_tests_common

    rundir=rundir, log=self._cpllog, root=cimeroot, case=case ) self._set_script(script) - FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    + FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    +
    + -
    [docs]class TESTRUNDIFF(FakeTest): +
    +[docs] +class TESTRUNDIFF(FakeTest): """ You can generate a diff with this test as follows: 1) Run the test and generate a baseline @@ -1070,7 +1050,9 @@

    Source code for CIME.SystemTests.system_tests_common

    3.a) This should give you a DIFF """ -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): rundir = self._case.get_value("RUNDIR") cimeroot = self._case.get_value("CIMEROOT") case = self._case.get_value("CASE") @@ -1086,15 +1068,24 @@

    Source code for CIME.SystemTests.system_tests_common

    rundir=rundir, log=self._cpllog, root=cimeroot, case=case ) self._set_script(script) - FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    + FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    +
    -
    [docs]class TESTRUNDIFFRESUBMIT(TESTRUNDIFF): + +
    +[docs] +class TESTRUNDIFFRESUBMIT(TESTRUNDIFF): pass
    -
    [docs]class TESTTESTDIFF(FakeTest): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): + +
    +[docs] +class TESTTESTDIFF(FakeTest): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): rundir = self._case.get_value("RUNDIR") cimeroot = self._case.get_value("CIMEROOT") case = self._case.get_value("CASE") @@ -1111,13 +1102,22 @@

    Source code for CIME.SystemTests.system_tests_common

    sharedlib_only=sharedlib_only, model_only=model_only )
    -
    [docs] def run_phase(self): + +
    +[docs] + def run_phase(self): super(TESTTESTDIFF, self).run_phase() - self._component_compare_test("base", "rest")
    + self._component_compare_test("base", "rest")
    +
    -
    [docs]class TESTRUNFAIL(FakeTest): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): + +
    +[docs] +class TESTRUNFAIL(FakeTest): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): rundir = self._case.get_value("RUNDIR") cimeroot = self._case.get_value("CIMEROOT") case = self._case.get_value("CASE") @@ -1135,10 +1135,14 @@

    Source code for CIME.SystemTests.system_tests_common

    rundir=rundir, log=self._cpllog, root=cimeroot, case=case ) self._set_script(script) - FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    + FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    +
    + -
    [docs]class TESTRUNFAILRESET(TESTRUNFAIL): +
    +[docs] +class TESTRUNFAILRESET(TESTRUNFAIL): """This fake test can fail for two reasons: 1. As in the TESTRUNFAIL test: If the environment variable TESTRUNFAIL_PASS is *not* set 2. Even if that environment variable *is* set, it will fail if STOP_N differs from the @@ -1148,7 +1152,9 @@

    Source code for CIME.SystemTests.system_tests_common

    rerun after an initial failure. """ -
    [docs] def run_indv( +
    +[docs] + def run_indv( self, suffix="base", st_archive=False, @@ -1171,21 +1177,36 @@

    Source code for CIME.SystemTests.system_tests_common

    super(TESTRUNFAILRESET, self).run_indv( suffix=suffix, st_archive=st_archive, submit_resubmits=submit_resubmits - )
    + )
    +
    -
    [docs]class TESTRUNFAILEXC(TESTRUNPASS): -
    [docs] def run_phase(self): - raise RuntimeError("Exception from run_phase")
    + +
    +[docs] +class TESTRUNFAILEXC(TESTRUNPASS): +
    +[docs] + def run_phase(self): + raise RuntimeError("Exception from run_phase")
    +
    -
    [docs]class TESTRUNSTARCFAIL(TESTRUNPASS): + +
    +[docs] +class TESTRUNSTARCFAIL(TESTRUNPASS): def _st_archive_case_test(self): raise RuntimeError("Exception from st archive")
    -
    [docs]class TESTBUILDFAIL(TESTRUNPASS): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): + +
    +[docs] +class TESTBUILDFAIL(TESTRUNPASS): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): if "TESTBUILDFAIL_PASS" in os.environ: TESTRUNPASS.build_phase(self, sharedlib_only, model_only) else: @@ -1198,17 +1219,26 @@

    Source code for CIME.SystemTests.system_tests_common

    with open(bldlog, "w") as fd: fd.write("BUILD FAIL: Intentional fail for testing infrastructure") - expect(False, "BUILD FAIL: Intentional fail for testing infrastructure")
    + expect(False, "BUILD FAIL: Intentional fail for testing infrastructure")
    +
    + -
    [docs]class TESTBUILDFAILEXC(FakeTest): +
    +[docs] +class TESTBUILDFAILEXC(FakeTest): def __init__(self, case, **kwargs): FakeTest.__init__(self, case, **kwargs) raise RuntimeError("Exception from init")
    -
    [docs]class TESTRUNUSERXMLCHANGE(FakeTest): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): + +
    +[docs] +class TESTRUNUSERXMLCHANGE(FakeTest): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): caseroot = self._case.get_value("CASEROOT") modelexe = self._case.get_value("run_exe") new_stop_n = self._case.get_value("STOP_N") * 2 @@ -1231,12 +1261,21 @@

    Source code for CIME.SystemTests.system_tests_common

    self._set_script(script, requires_exe=True) FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    -
    [docs] def run_phase(self): - self.run_indv(submit_resubmits=True)
    + +
    +[docs] + def run_phase(self): + self.run_indv(submit_resubmits=True)
    +
    + -
    [docs]class TESTRUNSLOWPASS(FakeTest): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] +class TESTRUNSLOWPASS(FakeTest): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): rundir = self._case.get_value("RUNDIR") cimeroot = self._case.get_value("CIMEROOT") case = self._case.get_value("CASE") @@ -1249,11 +1288,17 @@

    Source code for CIME.SystemTests.system_tests_common

    rundir=rundir, log=self._cpllog, root=cimeroot, case=case ) self._set_script(script) - FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    + FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    +
    -
    [docs]class TESTMEMLEAKFAIL(FakeTest): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): + +
    +[docs] +class TESTMEMLEAKFAIL(FakeTest): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): rundir = self._case.get_value("RUNDIR") cimeroot = self._case.get_value("CIMEROOT") case = self._case.get_value("CASE") @@ -1266,11 +1311,17 @@

    Source code for CIME.SystemTests.system_tests_common

    testfile=testfile, rundir=rundir, log=self._cpllog, root=cimeroot, case=case ) self._set_script(script) - FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    + FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    +
    + -
    [docs]class TESTMEMLEAKPASS(FakeTest): -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] +class TESTMEMLEAKPASS(FakeTest): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): rundir = self._case.get_value("RUNDIR") cimeroot = self._case.get_value("CIMEROOT") case = self._case.get_value("CASE") @@ -1283,7 +1334,9 @@

    Source code for CIME.SystemTests.system_tests_common

    testfile=testfile, rundir=rundir, log=self._cpllog, root=cimeroot, case=case ) self._set_script(script) - FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    + FakeTest.build_phase(self, sharedlib_only=sharedlib_only, model_only=model_only)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_n.html b/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_n.html index 08b99ddf43a..02fe6322090 100644 --- a/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_n.html +++ b/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_n.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -136,7 +136,9 @@

    Source code for CIME.SystemTests.system_tests_compare_n

    logger = logging.getLogger(__name__) -
    [docs]class SystemTestsCompareN(SystemTestsCommon): +
    +[docs] +class SystemTestsCompareN(SystemTestsCommon): def __init__( self, case, @@ -266,7 +268,9 @@

    Source code for CIME.SystemTests.system_tests_compare_n

    # Main public methods # ======================================================================== -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): # Subtle issue: base case is already in a writeable state since it tends to be opened # with a with statement in all the API entrances in CIME. subsequent cases were # created via clone, not a with statement, so it's not in a writeable state, @@ -314,7 +318,10 @@

    Source code for CIME.SystemTests.system_tests_compare_n

    # despite sharing the build (e.g., to change NTHRDS) self._cases[i].set_value("BUILD_COMPLETE", True)
    -
    [docs] def run_phase(self, success_change=False): # pylint: disable=arguments-differ + +
    +[docs] + def run_phase(self, success_change=False): # pylint: disable=arguments-differ """ Runs all phases of the N-phase test and compares base results with subsequent ones If success_change is True, success requires some files to be different @@ -391,6 +398,7 @@

    Source code for CIME.SystemTests.system_tests_compare_n

    ignore_fieldlist_diffs=self._ignore_fieldlist_diffs, )
    + # ======================================================================== # Private methods # ======================================================================== @@ -652,6 +660,7 @@

    Source code for CIME.SystemTests.system_tests_compare_n

    pass else: os.symlink(one_file, one_link)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_two.html b/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_two.html index 0396be0edc6..d4028ed3546 100644 --- a/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_two.html +++ b/versions/master/html/_modules/CIME/SystemTests/system_tests_compare_two.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -141,7 +141,9 @@

    Source code for CIME.SystemTests.system_tests_compare_two

    logger = logging.getLogger(__name__) -
    [docs]class SystemTestsCompareTwo(SystemTestsCommon): +
    +[docs] +class SystemTestsCompareTwo(SystemTestsCommon): def __init__( self, case, @@ -294,7 +296,9 @@

    Source code for CIME.SystemTests.system_tests_compare_two

    # Main public methods # ======================================================================== -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): # Subtle issue: case1 is already in a writeable state since it tends to be opened # with a with statement in all the API entrances in CIME. case2 was created via clone, # not a with statement, so it's not in a writeable state, so we need to use a with @@ -330,7 +334,10 @@

    Source code for CIME.SystemTests.system_tests_compare_two

    # despite sharing the build (e.g., to change NTHRDS) self._case2.set_value("BUILD_COMPLETE", True)
    -
    [docs] def run_phase(self, success_change=False): # pylint: disable=arguments-differ + +
    +[docs] + def run_phase(self, success_change=False): # pylint: disable=arguments-differ """ Runs both phases of the two-phase test and compares their results If success_change is True, success requires some files to be different @@ -410,7 +417,10 @@

    Source code for CIME.SystemTests.system_tests_compare_two

    ignore_fieldlist_diffs=self._ignore_fieldlist_diffs, )
    -
    [docs] def copy_case1_restarts_to_case2(self): + +
    +[docs] + def copy_case1_restarts_to_case2(self): """ Makes a copy (or symlink) of restart files and related files (necessary history files, rpointer files) from case1 to case2. @@ -426,6 +436,7 @@

    Source code for CIME.SystemTests.system_tests_compare_two

    link_to_restart_files=True, )
    + # ======================================================================== # Private methods # ======================================================================== @@ -689,6 +700,7 @@

    Source code for CIME.SystemTests.system_tests_compare_two

    pass else: os.symlink(one_file, one_link)
    +
    diff --git a/versions/master/html/_modules/CIME/SystemTests/test_utils/user_nl_utils.html b/versions/master/html/_modules/CIME/SystemTests/test_utils/user_nl_utils.html index c65e88f908b..0af30bb9fad 100644 --- a/versions/master/html/_modules/CIME/SystemTests/test_utils/user_nl_utils.html +++ b/versions/master/html/_modules/CIME/SystemTests/test_utils/user_nl_utils.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -92,7 +92,9 @@

    Source code for CIME.SystemTests.test_utils.user_nl_utils

    import glob -
    [docs]def append_to_user_nl_files(caseroot, component, contents): +
    +[docs] +def append_to_user_nl_files(caseroot, component, contents): """ Append the string(s) given by 'contents' to the end of each user_nl file for the given component (there may be multiple such user_nl files in the case of @@ -130,6 +132,7 @@

    Source code for CIME.SystemTests.test_utils.user_nl_utils

    user_nl_file.write(c + "\n")
    + def _get_list_of_user_nl_files(path, component): """Get a list of all user_nl files in the current path for the component of interest. For a component 'foo', we match all files of the form diff --git a/versions/master/html/_modules/CIME/SystemTests/tsc.html b/versions/master/html/_modules/CIME/SystemTests/tsc.html index cf32673da91..0fb94200c31 100644 --- a/versions/master/html/_modules/CIME/SystemTests/tsc.html +++ b/versions/master/html/_modules/CIME/SystemTests/tsc.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -134,7 +134,9 @@

    Source code for CIME.SystemTests.tsc

     P_THRESHOLD = 0.005
     
     
    -
    [docs]class TSC(SystemTestsCommon): +
    +[docs] +class TSC(SystemTestsCommon): def __init__(self, case, **kwargs): """ initialize an object interface to the TSC test @@ -151,7 +153,9 @@

    Source code for CIME.SystemTests.tsc

                 self.atmmodIC = "cam"
                 self.lndmodIC = "clm2"
     
    -
    [docs] def build_phase(self, sharedlib_only=False, model_only=False): +
    +[docs] + def build_phase(self, sharedlib_only=False, model_only=False): # Only want this to happen once. It will impact the sharedlib build # so it has to happen there. if not model_only: @@ -170,6 +174,7 @@

    Source code for CIME.SystemTests.tsc

     
             self.build_indv(sharedlib_only=sharedlib_only, model_only=model_only)
    + def _run_with_specified_dtime(self, dtime=2): """ Conduct one multi-instance run with a specified time step size. @@ -231,12 +236,15 @@

    Source code for CIME.SystemTests.tsc

     
             rename_all_hist_files(self._case, suffix="DT{:04d}".format(dtime))
     
    -
    [docs] def run_phase(self): +
    +[docs] + def run_phase(self): self._run_with_specified_dtime(dtime=2) if self._case.get_value("GENERATE_BASELINE"): self._run_with_specified_dtime(dtime=1)
    + def _compare_baseline(self): with self._test_status as ts: ts.set_status( @@ -358,6 +366,7 @@

    Source code for CIME.SystemTests.tsc

                         os.remove(baseline)
     
                     CIME.utils.safe_copy(hist, baseline, preserve_meta=False)
    +
    diff --git a/versions/master/html/_modules/CIME/Tools/generate_cylc_workflow.html b/versions/master/html/_modules/CIME/Tools/generate_cylc_workflow.html index 1338bbd89a0..1d428423563 100644 --- a/versions/master/html/_modules/CIME/Tools/generate_cylc_workflow.html +++ b/versions/master/html/_modules/CIME/Tools/generate_cylc_workflow.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -104,7 +104,9 @@

    Source code for CIME.Tools.generate_cylc_workflow

    logger = logging.getLogger(__name__) ############################################################################### -
    [docs]def parse_command_line(args, description): +
    +[docs] +def parse_command_line(args, description): ############################################################################### parser = argparse.ArgumentParser( description=description, formatter_class=argparse.RawTextHelpFormatter @@ -138,7 +140,10 @@

    Source code for CIME.Tools.generate_cylc_workflow

    return args.caseroot, args.cycles, int(args.ensemble)
    -
    [docs]def cylc_get_ensemble_first_and_last(case, ensemble): + +
    +[docs] +def cylc_get_ensemble_first_and_last(case, ensemble): if ensemble == 1: return 1, None casename = case.get_value("CASE") @@ -148,7 +153,10 @@

    Source code for CIME.Tools.generate_cylc_workflow

    return minval, maxval
    -
    [docs]def cylc_get_case_path_string(case, ensemble): + +
    +[docs] +def cylc_get_case_path_string(case, ensemble): caseroot = case.get_value("CASEROOT") casename = case.get_value("CASE") if ensemble == 1: @@ -166,7 +174,10 @@

    Source code for CIME.Tools.generate_cylc_workflow

    )
    -
    [docs]def cylc_batch_job_template(job, jobname, case, ensemble): + +
    +[docs] +def cylc_batch_job_template(job, jobname, case, ensemble): env_batch = case.get_env("batch") batch_system_type = env_batch.get_batch_system_type() @@ -194,7 +205,10 @@

    Source code for CIME.Tools.generate_cylc_workflow

    )
    -
    [docs]def cylc_script_job_template(job, case, ensemble): + +
    +[docs] +def cylc_script_job_template(job, case, ensemble): case_path_string = cylc_get_case_path_string(case, ensemble) return """ [[{job}<member>]] @@ -204,6 +218,7 @@

    Source code for CIME.Tools.generate_cylc_workflow

    )
    + ############################################################################### def _main_func(description): ############################################################################### diff --git a/versions/master/html/_modules/CIME/Tools/standard_script_setup.html b/versions/master/html/_modules/CIME/Tools/standard_script_setup.html index d76beeb9a3c..e8ca4e1270d 100644 --- a/versions/master/html/_modules/CIME/Tools/standard_script_setup.html +++ b/versions/master/html/_modules/CIME/Tools/standard_script_setup.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.Tools.standard_script_setup

    import __main__ as main -
    [docs]def check_minimum_python_version(major, minor): +
    +[docs] +def check_minimum_python_version(major, minor): """ Check your python version. @@ -116,6 +118,7 @@

    Source code for CIME.Tools.standard_script_setup

    ), msg
    + check_minimum_python_version(3, 6) real_file_dir = os.path.dirname(os.path.realpath(__file__)) diff --git a/versions/master/html/_modules/CIME/Tools/testreporter.html b/versions/master/html/_modules/CIME/Tools/testreporter.html index ffa0c693518..d1b8742a17d 100644 --- a/versions/master/html/_modules/CIME/Tools/testreporter.html +++ b/versions/master/html/_modules/CIME/Tools/testreporter.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -106,7 +106,9 @@

    Source code for CIME.Tools.testreporter

     import glob
     
     ###############################################################################
    -
    [docs]def parse_command_line(args): +
    +[docs] +def parse_command_line(args): ############################################################################### parser = argparse.ArgumentParser() @@ -142,8 +144,11 @@

    Source code for CIME.Tools.testreporter

         )
    + ############################################################################### -
    [docs]def get_testreporter_xml(testroot, testid, tagname, testtype): +
    +[docs] +def get_testreporter_xml(testroot, testid, tagname, testtype): ############################################################################### os.chdir(testroot) @@ -318,6 +323,7 @@

    Source code for CIME.Tools.testreporter

         return testxml
    + ############################################################################## def _main_func(): ############################################################################### diff --git a/versions/master/html/_modules/CIME/XML/archive.html b/versions/master/html/_modules/CIME/XML/archive.html index e934f933e26..40e6e8662a0 100644 --- a/versions/master/html/_modules/CIME/XML/archive.html +++ b/versions/master/html/_modules/CIME/XML/archive.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.XML.archive

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Archive(ArchiveBase): +
    +[docs] +class Archive(ArchiveBase): def __init__(self, infile=None, files=None): """ initialize an object @@ -107,7 +109,9 @@

    Source code for CIME.XML.archive

             schema = files.get_schema("ARCHIVE_SPEC_FILE")
             super(Archive, self).__init__(infile, schema)
     
    -
    [docs] def setup(self, env_archive, components, files=None): +
    +[docs] + def setup(self, env_archive, components, files=None): if files is None: files = Files() @@ -153,7 +157,10 @@

    Source code for CIME.XML.archive

                     logger.debug("adding archive spec for {}".format(comp))
                     env_archive.add_child(specs, root=components_node)
    -
    [docs] def get_all_config_archive_files(self, files): + +
    +[docs] + def get_all_config_archive_files(self, files): """ Returns the list of ARCHIVE_SPEC_FILES that exist on disk as defined in config_files.xml """ @@ -175,7 +182,9 @@

    Source code for CIME.XML.archive

                     config_archive_files.append(compval)
     
             config_archive_files = list(set(config_archive_files))
    -        return config_archive_files
    + return config_archive_files
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/archive_base.html b/versions/master/html/_modules/CIME/XML/archive_base.html index a478a225e64..bcfa6bc7ee1 100644 --- a/versions/master/html/_modules/CIME/XML/archive_base.html +++ b/versions/master/html/_modules/CIME/XML/archive_base.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,8 +94,12 @@

    Source code for CIME.XML.archive_base

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ArchiveBase(GenericXML): -
    [docs] def exclude_testing(self, compname): +
    +[docs] +class ArchiveBase(GenericXML): +
    +[docs] + def exclude_testing(self, compname): """ Checks if component should be excluded from testing. """ @@ -106,6 +110,7 @@

    Source code for CIME.XML.archive_base

     
             return convert_to_type(value, "logical")
    + def _get_attribute(self, compname, attr_name): attrib = self.get_entry_attributes(compname) @@ -114,7 +119,9 @@

    Source code for CIME.XML.archive_base

     
             return attrib.get(attr_name, None)
     
    -
    [docs] def get_entry_attributes(self, compname): +
    +[docs] + def get_entry_attributes(self, compname): entry = self.get_entry(compname) if entry is None: @@ -122,7 +129,10 @@

    Source code for CIME.XML.archive_base

     
             return self.attrib(entry)
    -
    [docs] def get_entry(self, compname): + +
    +[docs] + def get_entry(self, compname): """ Returns an xml node corresponding to compname in comp_archive_spec """ @@ -130,6 +140,7 @@

    Source code for CIME.XML.archive_base

                 "comp_archive_spec", attributes={"compname": compname}
             )
    + def _get_file_node_text(self, attnames, archive_entry): """ get the xml text associated with each of the attnames @@ -145,7 +156,9 @@

    Source code for CIME.XML.archive_base

                 textvals.append(self.text(node))
             return textvals
     
    -
    [docs] def get_rest_file_extensions(self, archive_entry): +
    +[docs] + def get_rest_file_extensions(self, archive_entry): """ get the xml text associated with each of the rest_file_extensions based at root archive_entry (root is based on component name) @@ -154,7 +167,10 @@

    Source code for CIME.XML.archive_base

             """
             return self._get_file_node_text(["rest_file_extension"], archive_entry)
    -
    [docs] def get_hist_file_extensions(self, archive_entry): + +
    +[docs] + def get_hist_file_extensions(self, archive_entry): """ get the xml text associated with each of the hist_file_extensions based at root archive_entry (root is based on component name) @@ -163,7 +179,10 @@

    Source code for CIME.XML.archive_base

             """
             return self._get_file_node_text(["hist_file_extension"], archive_entry)
    -
    [docs] def get_hist_file_ext_regexes(self, archive_entry): + +
    +[docs] + def get_hist_file_ext_regexes(self, archive_entry): """ get the xml text associated with each of the hist_file_ext_regex entries based at root archive_entry (root is based on component name) @@ -172,7 +191,10 @@

    Source code for CIME.XML.archive_base

             """
             return self._get_file_node_text(["hist_file_ext_regex"], archive_entry)
    -
    [docs] def get_entry_value(self, name, archive_entry): + +
    +[docs] + def get_entry_value(self, name, archive_entry): """ get the xml text associated with name under root archive_entry returns None if no entry is found, expects only one entry @@ -182,7 +204,10 @@

    Source code for CIME.XML.archive_base

                 return self.text(node)
             return None
    -
    [docs] def get_latest_hist_files( + +
    +[docs] + def get_latest_hist_files( self, casename, model, from_dir, suffix="", ref_case=None ): """ @@ -204,7 +229,10 @@

    Source code for CIME.XML.archive_base

                 histlist.append(latest_files[key])
             return histlist
    -
    [docs] def get_all_hist_files(self, casename, model, from_dir, suffix="", ref_case=None): + +
    +[docs] + def get_all_hist_files(self, casename, model, from_dir, suffix="", ref_case=None): """ gets all history files in directory from_dir with suffix (if provided) ignores files with ref_case in the name if ref_case is provided @@ -232,7 +260,7 @@

    Source code for CIME.XML.archive_base

                 string = model + r"\d?_?(\d{4})?\." + ext
                 if has_suffix:
                     if not suffix in string:
    -                    string += r".*\." + suffix + "$"
    +                    string += r"\." + suffix + "$"
     
                     if not string.endswith("$"):
                         string += "$"
    @@ -270,6 +298,7 @@ 

    Source code for CIME.XML.archive_base

     
             return hist_files
    + @staticmethod def _get_compname(model): """ @@ -281,6 +310,7 @@

    Source code for CIME.XML.archive_base

             return model
    + def _get_extension(model, filepath, ext_regexes): r""" For a hist file for the given model, return what we call the "extension" diff --git a/versions/master/html/_modules/CIME/XML/batch.html b/versions/master/html/_modules/CIME/XML/batch.html index d79361cf6db..bfae0878d0f 100644 --- a/versions/master/html/_modules/CIME/XML/batch.html +++ b/versions/master/html/_modules/CIME/XML/batch.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,7 +98,9 @@

    Source code for CIME.XML.batch

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Batch(GenericXML): +
    +[docs] +class Batch(GenericXML): def __init__( self, batch_system=None, @@ -146,13 +148,18 @@

    Source code for CIME.XML.batch

             if self.batch_system is not None:
                 self.set_batch_system(self.batch_system, machine=machine)
     
    -
    [docs] def get_batch_system(self): +
    +[docs] + def get_batch_system(self): """ Return the name of the batch system """ return self.batch_system
    -
    [docs] def get_optional_batch_node(self, nodename, attributes=None): + +
    +[docs] + def get_optional_batch_node(self, nodename, attributes=None): """ Return data on a node for a batch system """ @@ -176,7 +183,10 @@

    Source code for CIME.XML.batch

                     nodename, attributes, root=self.batch_system_node
                 )
    -
    [docs] def set_batch_system(self, batch_system, machine=None): + +
    +[docs] + def set_batch_system(self, batch_system, machine=None): """ Sets the batch system block in the Batch object """ @@ -198,8 +208,11 @@

    Source code for CIME.XML.batch

     
             return batch_system
    + # pylint: disable=arguments-differ -
    [docs] def get_value(self, name, attribute=None, resolved=True, subgroup=None): +
    +[docs] + def get_value(self, name, attribute=None, resolved=True, subgroup=None): """ Get Value of fields in the config_batch.xml file """ @@ -222,7 +235,10 @@

    Source code for CIME.XML.batch

     
             return value
    -
    [docs] def get_batch_jobs(self): + +
    +[docs] + def get_batch_jobs(self): """ Return a list of jobs with the first element the name of the case script and the second a dict of qualifiers for the job @@ -239,7 +255,9 @@

    Source code for CIME.XML.batch

     
                         jobs.append((name, jdict))
     
    -        return jobs
    + return jobs
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/component.html b/versions/master/html/_modules/CIME/XML/component.html index 995c4d4a0be..11714e6c91a 100644 --- a/versions/master/html/_modules/CIME/XML/component.html +++ b/versions/master/html/_modules/CIME/XML/component.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.XML.component

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Component(EntryID): +
    +[docs] +class Component(EntryID): def __init__(self, infile, comp_class): """ initialize a Component obect from the component xml file in infile @@ -118,11 +120,16 @@

    Source code for CIME.XML.component

                 self.validate_xml_file(infile, schema)
     
         # pylint: disable=arguments-differ
    -
    [docs] def get_value(self, name, attribute=None, resolved=False, subgroup=None): +
    +[docs] + def get_value(self, name, attribute=None, resolved=False, subgroup=None): expect(subgroup is None, "This class does not support subgroups") return EntryID.get_value(self, name, attribute, resolved)
    -
    [docs] def get_valid_model_components(self): + +
    +[docs] + def get_valid_model_components(self): """ return a list of all possible valid generic (e.g. atm, clm, ...) model components from the entries in the model CONFIG_CPL_FILE @@ -133,6 +140,7 @@

    Source code for CIME.XML.component

             components = comps.split(",")
             return components
    + def _get_value_match(self, node, attributes=None, exact_match=False): """ return the best match for the node <values> entries @@ -217,18 +225,24 @@

    Source code for CIME.XML.component

             return match_value
     
         # pylint: disable=arguments-differ
    -
    [docs] def get_description(self, compsetname): +
    +[docs] + def get_description(self, compsetname): if self.get_version() == 3.0: return self._get_description_v3(compsetname, self._comp_class) else: return self._get_description_v2(compsetname)
    -
    [docs] def get_forcing_description(self, compsetname): + +
    +[docs] + def get_forcing_description(self, compsetname): if self.get_version() == 3.0: return self._get_description_v3(compsetname, "forcing") else: return ""
    + def _get_description_v3(self, compsetname, comp_class): """ version 3 of the config_component.xml file has the description section at the top of the file @@ -402,7 +416,9 @@

    Source code for CIME.XML.component

     
             return desc
     
    -
    [docs] def print_values(self): +
    +[docs] + def print_values(self): """ print values for help and description in target config_component.xml file """ @@ -415,7 +431,10 @@

    Source code for CIME.XML.component

                 text = self.text(self.get_child("desc", root=entry))
                 logger.info("   {:20s} : {}".format(name, text.encode("utf-8")))
    -
    [docs] def return_values(self): + +
    +[docs] + def return_values(self): """ return a list of hashes from target config_component.xml file This routine is used by external tools in https://github.com/NCAR/CESM_xml2html @@ -449,7 +468,9 @@

    Source code for CIME.XML.component

                 items.append(item)
             entry_dict = {"items": items}
     
    -        return helptext, entry_dict
    + return helptext, entry_dict
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/compsets.html b/versions/master/html/_modules/CIME/XML/compsets.html index 88b70ebeb4e..c4b5d0a2c1a 100644 --- a/versions/master/html/_modules/CIME/XML/compsets.html +++ b/versions/master/html/_modules/CIME/XML/compsets.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,14 +96,18 @@

    Source code for CIME.XML.compsets

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Compsets(GenericXML): +
    +[docs] +class Compsets(GenericXML): def __init__(self, infile=None, files=None): if files is None: files = Files() schema = files.get_schema("COMPSETS_SPEC_FILE") GenericXML.__init__(self, infile, schema=schema) -
    [docs] def get_compset_match(self, name): +
    +[docs] + def get_compset_match(self, name): """ science support is used in cesm to determine if this compset and grid is scientifically supported. science_support is returned as an array of grids for this compset @@ -127,7 +131,10 @@

    Source code for CIME.XML.compsets

                     return (lname, alias, science_support)
             return (None, None, [False])
    -
    [docs] def get_compset_var_settings(self, compset, grid): + +
    +[docs] + def get_compset_var_settings(self, compset, grid): """ Variables can be set in config_compsets.xml in entry id settings with compset and grid attributes find and return id value pairs here @@ -147,8 +154,11 @@

    Source code for CIME.XML.compsets

     
             return result
    + # pylint: disable=arguments-differ -
    [docs] def get_value(self, name, attribute=None, resolved=False, subgroup=None): +
    +[docs] + def get_value(self, name, attribute=None, resolved=False, subgroup=None): expect(subgroup is None, "This class does not support subgroups") if name == "help": rootnode = self.get_child("help") @@ -171,7 +181,10 @@

    Source code for CIME.XML.compsets

                     compsets[alias] = lname
                 return compsets
    -
    [docs] def print_values(self, arg_help=True): + +
    +[docs] + def print_values(self, arg_help=True): help_text = self.get_value(name="help") compsets = self.get_children("compset") if arg_help: @@ -188,12 +201,17 @@

    Source code for CIME.XML.compsets

                     )
                 )
    -
    [docs] def get_compset_longnames(self): + +
    +[docs] + def get_compset_longnames(self): compset_nodes = self.get_children("compset") longnames = [] for comp in compset_nodes: longnames.append(self.text(self.get_child("lname", root=comp))) - return longnames
    + return longnames
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/entry_id.html b/versions/master/html/_modules/CIME/XML/entry_id.html index 46c285b96e6..b1dd7629f59 100644 --- a/versions/master/html/_modules/CIME/XML/entry_id.html +++ b/versions/master/html/_modules/CIME/XML/entry_id.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,12 +96,16 @@

    Source code for CIME.XML.entry_id

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class EntryID(GenericXML): +
    +[docs] +class EntryID(GenericXML): def __init__(self, infile=None, schema=None, read_only=True): GenericXML.__init__(self, infile, schema, read_only=read_only) self.groups = {} -
    [docs] def get_default_value(self, node, attributes=None): +
    +[docs] + def get_default_value(self, node, attributes=None): """ Set the value of an entry to the default value for that entry """ @@ -118,7 +122,10 @@

    Source code for CIME.XML.entry_id

     
             return value
    -
    [docs] def set_default_value(self, vid, val): + +
    +[docs] + def set_default_value(self, vid, val): node = self.get_optional_child("entry", {"id": vid}) if node is not None: val = self.set_element_text("default_value", val, root=node) @@ -129,7 +136,10 @@

    Source code for CIME.XML.entry_id

     
             return val
    -
    [docs] def get_value_match( + +
    +[docs] + def get_value_match( self, vid, attributes=None, @@ -173,6 +183,7 @@

    Source code for CIME.XML.entry_id

             logger.debug("(get_value_match) vid {} value {}".format(vid, value))
             return value
    + def _get_value_match( self, node, attributes=None, exact_match=False, replacement_for_none=None ): @@ -254,13 +265,16 @@

    Source code for CIME.XML.entry_id

                 text = replacement_for_none
             return text
     
    -
    [docs] def get_node_element_info(self, vid, element_name): +
    +[docs] + def get_node_element_info(self, vid, element_name): node = self.get_optional_child("entry", {"id": vid}) if node is None: return None else: return self._get_node_element_info(node, element_name)
    + def _get_node_element_info(self, node, element_name): return self.get_element_text(element_name, root=node) @@ -272,26 +286,37 @@

    Source code for CIME.XML.entry_id

                 return "char"
             return val
     
    -
    [docs] def get_type_info(self, vid): +
    +[docs] + def get_type_info(self, vid): vid, _, _ = self.check_if_comp_var(vid) node = self.scan_optional_child("entry", {"id": vid}) return self._get_type_info(node)
    + # pylint: disable=unused-argument -
    [docs] def check_if_comp_var(self, vid, attribute=None, node=None): +
    +[docs] + def check_if_comp_var(self, vid, attribute=None, node=None): # handled in classes return vid, None, False
    + def _get_default(self, node): return self._get_node_element_info(node, "default_value") # Get description , expect child with tag "description" for parent node -
    [docs] def get_description(self, node): +
    +[docs] + def get_description(self, node): return self._get_node_element_info(node, "desc")
    + # Get group , expect node with tag "group" # entry id nodes are children of group nodes -
    [docs] def get_groups(self, node): +
    +[docs] + def get_groups(self, node): groups = self.get_children("group") result = [] nodes = [] @@ -303,12 +328,16 @@

    Source code for CIME.XML.entry_id

     
             return result
    -
    [docs] def get_valid_values(self, vid): + +
    +[docs] + def get_valid_values(self, vid): node = self.scan_optional_child("entry", {"id": vid}) if node is None: return None return self._get_valid_values(node)
    + def _get_valid_values(self, node): valid_values = self.get_element_text("valid_values", root=node) valid_values_list = [] @@ -316,15 +345,21 @@

    Source code for CIME.XML.entry_id

                 valid_values_list = [item.lstrip() for item in valid_values.split(",")]
             return valid_values_list
     
    -
    [docs] def set_valid_values(self, vid, new_valid_values): +
    +[docs] + def set_valid_values(self, vid, new_valid_values): node = self.scan_optional_child("entry", {"id": vid}) if node is None: return None return self._set_valid_values(node, new_valid_values)
    -
    [docs] def get_nodes_by_id(self, vid): + +
    +[docs] + def get_nodes_by_id(self, vid): return self.scan_children("entry", {"id": vid})
    + def _set_valid_values(self, node, new_valid_values): old_vv = self._get_valid_values(node) if old_vv is None: @@ -364,7 +399,9 @@

    Source code for CIME.XML.entry_id

             self.set(node, "value", str_value)
             return value
     
    -
    [docs] def get_valid_value_string(self, node, value, vid=None, ignore_type=False): +
    +[docs] + def get_valid_value_string(self, node, value, vid=None, ignore_type=False): valid_values = self._get_valid_values(node) if ignore_type: expect( @@ -385,7 +422,10 @@

    Source code for CIME.XML.entry_id

                 )
             return str_value
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=False): + +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=False): """ Set the value of an entry-id field to value Returns the value or None if not found @@ -402,7 +442,10 @@

    Source code for CIME.XML.entry_id

                 val = self._set_value(node, value, vid, subgroup, ignore_type)
             return val
    -
    [docs] def get_values(self, vid, attribute=None, resolved=True, subgroup=None): + +
    +[docs] + def get_values(self, vid, attribute=None, resolved=True, subgroup=None): """ Same functionality as get_value but it returns a list, if the value in xml contains commas the list have multiple elements split on @@ -426,8 +469,11 @@

    Source code for CIME.XML.entry_id

                     results.append(convert_to_type(result, type_str, vid))
             return results
    + # pylint: disable=arguments-differ -
    [docs] def get_value(self, vid, attribute=None, resolved=True, subgroup=None): +
    +[docs] + def get_value(self, vid, attribute=None, resolved=True, subgroup=None): """ Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided @@ -455,6 +501,7 @@

    Source code for CIME.XML.entry_id

                 type_str = self._get_type_info(node)
                 return convert_to_type(val, type_str, vid)
    + def _get_value(self, node, attribute=None, resolved=True, subgroup=None): """ internal get_value, does not convert to type @@ -484,14 +531,19 @@

    Source code for CIME.XML.entry_id

     
             return val
     
    -
    [docs] def get_child_content(self, vid, childname): +
    +[docs] + def get_child_content(self, vid, childname): val = None node = self.get_optional_child("entry", {"id": vid}) if node is not None: val = self.get_element_text(childname, root=node) return val
    -
    [docs] def get_elements_from_child_content(self, childname, childcontent): + +
    +[docs] + def get_elements_from_child_content(self, childname, childcontent): nodes = self.get_children("entry") elements = [] for node in nodes: @@ -505,7 +557,10 @@

    Source code for CIME.XML.entry_id

     
             return elements
    -
    [docs] def add_elements_by_group(self, srcobj, attributes=None, infile=None): + +
    +[docs] + def add_elements_by_group(self, srcobj, attributes=None, infile=None): """ Add elements from srcobj to self under the appropriate group element, entries to be added must have a child element @@ -551,13 +606,19 @@

    Source code for CIME.XML.entry_id

     
             return nodelist
    -
    [docs] def cleanupnode(self, node): + +
    +[docs] + def cleanupnode(self, node): """ in env_base.py, not expected to get here """ expect(False, " Not expected to be here {}".format(self.get(node, "id")))
    -
    [docs] def compare_xml(self, other, root=None, otherroot=None): + +
    +[docs] + def compare_xml(self, other, root=None, otherroot=None): xmldiffs = {} if root is not None: expect(otherroot is not None, " inconsistant request") @@ -618,7 +679,10 @@

    Source code for CIME.XML.entry_id

                                                     ]
             return xmldiffs
    -
    [docs] def overwrite_existing_entries(self): + +
    +[docs] + def overwrite_existing_entries(self): # if there exist two nodes with the same id delete the first one. for node in self.get_children("entry"): vid = self.get(node, "id") @@ -635,10 +699,12 @@

    Source code for CIME.XML.entry_id

                     self.remove_child(samenodes[0])
                     self.read_only = read_only
    + def __iter__(self): for node in self.scan_children("entry"): vid = self.get(node, "id") yield vid, self.get_value(vid)
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_archive.html b/versions/master/html/_modules/CIME/XML/env_archive.html index 098a4b5522c..631ebba8cc7 100644 --- a/versions/master/html/_modules/CIME/XML/env_archive.html +++ b/versions/master/html/_modules/CIME/XML/env_archive.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.XML.env_archive

     
     logger = logging.getLogger(__name__)
     # pylint: disable=super-init-not-called
    -
    [docs]class EnvArchive(ArchiveBase, EnvBase): +
    +[docs] +class EnvArchive(ArchiveBase, EnvBase): def __init__(self, case_root=None, infile="env_archive.xml", read_only=False): """ initialize an object interface to file env_archive.xml in the case directory @@ -102,15 +104,23 @@

    Source code for CIME.XML.env_archive

             schema = os.path.join(utils.get_schema_path(), "env_archive.xsd")
             EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)
     
    -
    [docs] def get_entries(self): +
    +[docs] + def get_entries(self): return self.get_children("comp_archive_spec")
    -
    [docs] def get_entry_info(self, archive_entry): + +
    +[docs] + def get_entry_info(self, archive_entry): compname = self.get(archive_entry, "compname") compclass = self.get(archive_entry, "compclass") return compname, compclass
    -
    [docs] def get_rpointer_contents(self, archive_entry): + +
    +[docs] + def get_rpointer_contents(self, archive_entry): rpointer_items = [] rpointer_nodes = self.get_children("rpointer", root=archive_entry) for rpointer_node in rpointer_nodes: @@ -119,8 +129,13 @@

    Source code for CIME.XML.env_archive

                 rpointer_items.append([self.text(file_node), self.text(content_node)])
             return rpointer_items
    -
    [docs] def get_type_info(self, vid): - return "char"
    + +
    +[docs] + def get_type_info(self, vid): + return "char"
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_base.html b/versions/master/html/_modules/CIME/XML/env_base.html index f740150d549..9d19314b2e4 100644 --- a/versions/master/html/_modules/CIME/XML/env_base.html +++ b/versions/master/html/_modules/CIME/XML/env_base.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.env_base

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class EnvBase(EntryID): +
    +[docs] +class EnvBase(EntryID): def __init__(self, case_root, infile, schema=None, read_only=False): if case_root is None: case_root = os.getcwd() @@ -145,12 +147,17 @@

    Source code for CIME.XML.env_base

     
             self.lock()
     
    -
    [docs] def change_file(self, newfile, copy=False): +
    +[docs] + def change_file(self, newfile, copy=False): self.unlock() EntryID.change_file(self, newfile, copy=copy) self._setup_cache()
    -
    [docs] def get_children(self, name=None, attributes=None, root=None): + +
    +[docs] + def get_children(self, name=None, attributes=None, root=None): if ( self.locked and name == "entry" @@ -185,7 +192,10 @@

    Source code for CIME.XML.env_base

                     self, name=name, attributes=attributes, root=root
                 )
    -
    [docs] def scan_children(self, nodename, attributes=None, root=None): + +
    +[docs] + def scan_children(self, nodename, attributes=None, root=None): if ( self.locked and nodename == "entry" @@ -200,12 +210,18 @@

    Source code for CIME.XML.env_base

                     self, nodename, attributes=attributes, root=root
                 )
    -
    [docs] def set_components(self, components): + +
    +[docs] + def set_components(self, components): if hasattr(self, "_components"): # pylint: disable=attribute-defined-outside-init self._components = components
    -
    [docs] def check_if_comp_var(self, vid, attribute=None, node=None): + +
    +[docs] + def check_if_comp_var(self, vid, attribute=None, node=None): comp = None if node is None: nodes = self.scan_children("entry", {"id": vid}) @@ -242,7 +258,10 @@

    Source code for CIME.XML.env_base

     
             return vid, None, False
    -
    [docs] def get_value(self, vid, attribute=None, resolved=True, subgroup=None): + +
    +[docs] + def get_value(self, vid, attribute=None, resolved=True, subgroup=None): """ Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided @@ -279,7 +298,10 @@

    Source code for CIME.XML.env_base

                 self, vid, attribute=attribute, resolved=resolved, subgroup=subgroup
             )
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=False): + +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=False): """ Set the value of an entry-id field to value Returns the value or None if not found @@ -306,6 +328,7 @@

    Source code for CIME.XML.env_base

                     )
             return val
    + # pylint: disable=arguments-differ def _set_value( self, node, value, vid=None, subgroup=None, ignore_type=False, compclass=None @@ -325,11 +348,16 @@

    Source code for CIME.XML.env_base

                 val = EntryID._set_value(self, node, value, vid, subgroup, ignore_type)
             return val
     
    -
    [docs] def get_nodes_by_id(self, varid): +
    +[docs] + def get_nodes_by_id(self, varid): varid, _, _ = self.check_if_comp_var(varid, None) return EntryID.get_nodes_by_id(self, varid)
    -
    [docs] def cleanupnode(self, node): + +
    +[docs] + def cleanupnode(self, node): """ Remove the <group>, <file>, <values> and <value> childnodes from node """ @@ -362,7 +390,9 @@

    Source code for CIME.XML.env_base

                 if len(compclassatt) == 0:
                     self.remove_child(vnode, root=node)
     
    -        return node
    + return node
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_batch.html b/versions/master/html/_modules/CIME/XML/env_batch.html index 556b26ee025..39dafa24bdf 100644 --- a/versions/master/html/_modules/CIME/XML/env_batch.html +++ b/versions/master/html/_modules/CIME/XML/env_batch.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -101,6 +101,7 @@

    Source code for CIME.XML.env_batch

         get_batch_script_for_job,
         get_logging_options,
         format_time,
    +    add_flag_to_cmd,
     )
     from CIME.locked_files import lock_file, unlock_file
     from collections import OrderedDict
    @@ -112,7 +113,9 @@ 

    Source code for CIME.XML.env_batch

     # pragma pylint: disable=attribute-defined-outside-init
     
     
    -
    [docs]class EnvBatch(EnvBase): +
    +[docs] +class EnvBatch(EnvBase): def __init__(self, case_root=None, infile="env_batch.xml", read_only=False): """ initialize an object interface to file env_batch.xml in the case directory @@ -127,7 +130,9 @@

    Source code for CIME.XML.env_batch

             self._batchtype = self.get_batch_system_type()
     
         # pylint: disable=arguments-differ
    -
    [docs] def set_value(self, item, value, subgroup=None, ignore_type=False): +
    +[docs] + def set_value(self, item, value, subgroup=None, ignore_type=False): """ Override the entry_id set_value function with some special cases for this class """ @@ -158,8 +163,11 @@

    Source code for CIME.XML.env_batch

     
             return val
    + # pylint: disable=arguments-differ -
    [docs] def get_value(self, item, attribute=None, resolved=True, subgroup=None): +
    +[docs] + def get_value(self, item, attribute=None, resolved=True, subgroup=None): """ Must default subgroup to something in order to provide single return value """ @@ -182,7 +190,10 @@

    Source code for CIME.XML.env_batch

     
             return value
    -
    [docs] def get_type_info(self, vid): + +
    +[docs] + def get_type_info(self, vid): gnodes = self.get_children("group") for gnode in gnodes: nodes = self.get_children("entry", {"id": vid}, root=gnode) @@ -200,7 +211,10 @@

    Source code for CIME.XML.env_batch

                         )
             return type_info
    -
    [docs] def get_jobs(self): + +
    +[docs] + def get_jobs(self): groups = self.get_children("group") results = [] for group in groups: @@ -209,7 +223,10 @@

    Source code for CIME.XML.env_batch

     
             return results
    -
    [docs] def create_job_groups(self, batch_jobs, is_test): + +
    +[docs] + def create_job_groups(self, batch_jobs, is_test): # Subtle: in order to support dynamic batch jobs, we need to remove the # job_submission group and replace with job-based groups @@ -245,7 +262,10 @@

    Source code for CIME.XML.env_batch

                     for child in childnodes:
                         self.add_child(self.copy(child), root=new_job_group)
    -
    [docs] def cleanupnode(self, node): + +
    +[docs] + def cleanupnode(self, node): if self.get(node, "id") == "batch_system": fnode = self.get_child(name="file", root=node) self.remove_child(fnode, root=node) @@ -258,7 +278,10 @@

    Source code for CIME.XML.env_batch

                 node = super(EnvBatch, self).cleanupnode(node)
             return node
    -
    [docs] def set_batch_system(self, batchobj, batch_system_type=None): + +
    +[docs] + def set_batch_system(self, batchobj, batch_system_type=None): if batch_system_type is not None: self.set_batch_system_type(batch_system_type) @@ -283,7 +306,10 @@

    Source code for CIME.XML.env_batch

             if os.path.exists(os.path.join(self._caseroot, "LockedFiles")):
                 lock_file(os.path.basename(batchobj.filename), caseroot=self._caseroot)
    -
    [docs] def get_job_overrides(self, job, case): + +
    +[docs] + def get_job_overrides(self, job, case): env_workflow = case.get_env("workflow") ( total_tasks, @@ -310,7 +336,10 @@

    Source code for CIME.XML.env_batch

             overrides["mpirun"] = case.get_mpirun_cmd(job=job, overrides=overrides)
             return overrides
    -
    [docs] def make_batch_script(self, input_template, job, case, outfile=None): + +
    +[docs] + def make_batch_script(self, input_template, job, case, outfile=None): expect( os.path.exists(input_template), "input file '{}' does not exist".format(input_template), @@ -348,7 +377,10 @@

    Source code for CIME.XML.env_batch

                 os.stat(output_name).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH,
             )
    -
    [docs] def set_job_defaults(self, batch_jobs, case): + +
    +[docs] + def set_job_defaults(self, batch_jobs, case): if self._batchtype is None: self._batchtype = self.get_batch_system_type() @@ -521,6 +553,7 @@

    Source code for CIME.XML.env_batch

                     "Job {} queue {} walltime {}".format(job, self.text(queue), walltime)
                 )
    + def _match_attribs(self, attribs, case, queue): # check for matches with case-vars for attrib in attribs: @@ -560,7 +593,9 @@

    Source code for CIME.XML.env_batch

             )
             return result
     
    -
    [docs] def get_batch_directives(self, case, job, overrides=None, output_format="default"): +
    +[docs] + def get_batch_directives(self, case, job, overrides=None, output_format="default"): """ """ result = [] directive_prefix = None @@ -641,7 +676,10 @@

    Source code for CIME.XML.env_batch

     
             return "\n".join(result)
    -
    [docs] def get_submit_args(self, case, job, resolve=True): + +
    +[docs] + def get_submit_args(self, case, job, resolve=True): """ return a list of touples (flag, name) """ @@ -653,6 +691,7 @@

    Source code for CIME.XML.env_batch

     
             return submitargs
    + def _get_arg_nodes(self, case, bs_nodes): submit_arg_nodes = [] @@ -693,6 +732,7 @@

    Source code for CIME.XML.env_batch

                     flag, name = self._get_argument(case, arg)
                 except ValueError:
                     continue
    +
                 if self._batchtype == "cobalt" and job == "case.st_archive":
                     if flag == "-n":
                         name = "task_count"
    @@ -712,7 +752,7 @@ 

    Source code for CIME.XML.env_batch

                             if len(rflag) > len(flag):
                                 submitargs += " {}".format(rflag)
                         else:
    -                        submitargs += " {} {}".format(flag, name)
    +                        submitargs += " " + add_flag_to_cmd(flag, name)
                     else:
                         submitargs += " {}".format(flag)
                 else:
    @@ -722,7 +762,7 @@ 

    Source code for CIME.XML.env_batch

                         except ValueError:
                             continue
                     else:
    -                    submitargs += " {} {}".format(flag, name)
    +                    submitargs += " " + add_flag_to_cmd(flag, name)
     
             return submitargs
     
    @@ -788,17 +828,14 @@ 

    Source code for CIME.XML.env_batch

                 if flag == "-q" and rval == "batch" and case.get_value("MACH") == "blues":
                     # Special case. Do not provide '-q batch' for blues
                     raise ValueError()
    -            if (
    -                flag.rfind("=", len(flag) - 1, len(flag)) >= 0
    -                or flag.rfind(":", len(flag) - 1, len(flag)) >= 0
    -            ):
    -                submitargs = " {}{}".format(flag, str(rval).strip())
    -            else:
    -                submitargs = " {} {}".format(flag, str(rval).strip())
    +
    +            submitargs = " " + add_flag_to_cmd(flag, rval)
     
             return submitargs
     
    -
    [docs] def submit_jobs( +
    +[docs] + def submit_jobs( self, case, no_batch=False, @@ -884,20 +921,10 @@

    Source code for CIME.XML.env_batch

             batch_job_id = None
             for _ in range(num_submit):
                 for job, dependency in jobs:
    -                if dependency is not None:
    -                    deps = dependency.split()
    -                else:
    -                    deps = []
    -                dep_jobs = []
    -                if user_prereq is not None:
    -                    dep_jobs.append(user_prereq)
    -                for dep in deps:
    -                    if dep in depid.keys() and depid[dep] is not None:
    -                        dep_jobs.append(str(depid[dep]))
    -                if prev_job is not None:
    -                    dep_jobs.append(prev_job)
    +                dep_jobs = get_job_deps(dependency, depid, prev_job, user_prereq)
     
                     logger.debug("job {} depends on {}".format(job, dep_jobs))
    +
                     result = self._submit_single_job(
                         case,
                         job,
    @@ -928,6 +955,7 @@ 

    Source code for CIME.XML.env_batch

             else:
                 return depid
    + @staticmethod def _get_supported_args(job, no_batch): """ @@ -1197,7 +1225,9 @@

    Source code for CIME.XML.env_batch

                 logger.info("Submitted job id is {}".format(jobid))
                 return jobid
     
    -
    [docs] def get_batch_mail_type(self, mail_type): +
    +[docs] + def get_batch_mail_type(self, mail_type): raw = self.get_value("batch_mail_type", subgroup=None) mail_types = [ item.strip() for item in raw.split(",") @@ -1206,7 +1236,10 @@

    Source code for CIME.XML.env_batch

     
             return mail_types[idx] if idx < len(mail_types) else None
    -
    [docs] def get_batch_system_type(self): + +
    +[docs] + def get_batch_system_type(self): nodes = self.get_children("batch_system") for node in nodes: type_ = self.get(node, "type") @@ -1214,10 +1247,16 @@

    Source code for CIME.XML.env_batch

                     self._batchtype = type_
             return self._batchtype
    -
    [docs] def set_batch_system_type(self, batchtype): + +
    +[docs] + def set_batch_system_type(self, batchtype): self._batchtype = batchtype
    -
    [docs] def get_job_id(self, output): + +
    +[docs] + def get_job_id(self, output): jobid_pattern = self.get_value("jobid_pattern", subgroup=None) if self._batchtype and self._batchtype != "none": expect( @@ -1236,7 +1275,10 @@

    Source code for CIME.XML.env_batch

             jobid = search_match.group(1)
             return jobid
    -
    [docs] def queue_meets_spec(self, queue, num_nodes, num_tasks, walltime=None, job=None): + +
    +[docs] + def queue_meets_spec(self, queue, num_nodes, num_tasks, walltime=None, job=None): specs = self.get_queue_specs(queue) nodemin, nodemax, jobname, _, _, walltimemax, jobmin, jobmax, strict = specs @@ -1265,6 +1307,7 @@

    Source code for CIME.XML.env_batch

     
             return True
    + def _get_all_queue_names(self): all_queues = [] all_queues = self.get_all_queues() @@ -1275,7 +1318,9 @@

    Source code for CIME.XML.env_batch

     
             return queue_names
     
    -
    [docs] def select_best_queue( +
    +[docs] + def select_best_queue( self, num_nodes, num_tasks, name=None, walltime=None, job=None ): logger.debug( @@ -1297,7 +1342,10 @@

    Source code for CIME.XML.env_batch

     
             return None
    -
    [docs] def get_queue_specs(self, qnode): + +
    +[docs] + def get_queue_specs(self, qnode): """ Get queue specifications from node. @@ -1340,7 +1388,10 @@

    Source code for CIME.XML.env_batch

                 strict,
             )
    -
    [docs] def get_default_queue(self): + +
    +[docs] + def get_default_queue(self): bs_nodes = self.get_children("batch_system") node = None for bsnode in bs_nodes: @@ -1355,7 +1406,10 @@

    Source code for CIME.XML.env_batch

             expect(node is not None, "No queues found")
             return node
    -
    [docs] def get_all_queues(self, name=None): + +
    +[docs] + def get_all_queues(self, name=None): bs_nodes = self.get_children("batch_system") nodes = [] default_idx = None @@ -1377,7 +1431,10 @@

    Source code for CIME.XML.env_batch

     
             return nodes
    -
    [docs] def get_children(self, name=None, attributes=None, root=None): + +
    +[docs] + def get_children(self, name=None, attributes=None, root=None): if name == "PROJECT_REQUIRED": nodes = super(EnvBatch, self).get_children( "entry", attributes={"id": name}, root=root @@ -1389,7 +1446,10 @@

    Source code for CIME.XML.env_batch

     
             return nodes
    -
    [docs] def get_status(self, jobid): + +
    +[docs] + def get_status(self, jobid): batch_query = self.get_optional_child("batch_query") if batch_query is None: logger.warning("Batch queries not supported on this platform") @@ -1408,7 +1468,10 @@

    Source code for CIME.XML.env_batch

                 else:
                     return out.strip()
    -
    [docs] def cancel_job(self, jobid): + +
    +[docs] + def cancel_job(self, jobid): batch_cancel = self.get_optional_child("batch_cancel") if batch_cancel is None: logger.warning("Batch cancellation not supported on this platform") @@ -1426,7 +1489,10 @@

    Source code for CIME.XML.env_batch

                 else:
                     return True
    -
    [docs] def compare_xml(self, other): + +
    +[docs] + def compare_xml(self, other): xmldiffs = {} f1batchnodes = self.get_children("batch_system") for bnode in f1batchnodes: @@ -1461,7 +1527,10 @@

    Source code for CIME.XML.env_batch

                 )
             return xmldiffs
    -
    [docs] def make_all_batch_files(self, case): + +
    +[docs] + def make_all_batch_files(self, case): machdir = case.get_value("MACHDIR") env_workflow = case.get_env("workflow") logger.info("Creating batch scripts") @@ -1487,7 +1556,50 @@

    Source code for CIME.XML.env_batch

                         "Input template file {} for job {} does not exist or cannot be read.".format(
                             input_batch_script, job
                         )
    -                )
    + )
    +
    + + + +
    +[docs] +def get_job_deps(dependency, depid, prev_job=None, user_prereq=None): + """ + Gather list of job batch ids that a job depends on. + + Parameters + ---------- + dependency : str + List of dependent job names. + depid : dict + Lookup where keys are job names and values are the batch id. + user_prereq : str + User requested dependency. + + Returns + ------- + list + List of batch ids that job depends on. + """ + deps = [] + dep_jobs = [] + + if user_prereq is not None: + dep_jobs.append(user_prereq) + + if dependency is not None: + # Match all words, excluding "and" and "or" + deps = re.findall(r"\b(?!and\b|or\b)\w+(?:\.\w+)?\b", dependency) + + for dep in deps: + if dep in depid and depid[dep] is not None: + dep_jobs.append(str(depid[dep])) + + if prev_job is not None: + dep_jobs.append(prev_job) + + return dep_jobs
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_build.html b/versions/master/html/_modules/CIME/XML/env_build.html index 9416c153199..5aa88d30f43 100644 --- a/versions/master/html/_modules/CIME/XML/env_build.html +++ b/versions/master/html/_modules/CIME/XML/env_build.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.env_build

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class EnvBuild(EnvBase): +
    +[docs] +class EnvBuild(EnvBase): # pylint: disable=unused-argument def __init__( self, case_root=None, infile="env_build.xml", components=None, read_only=False @@ -107,7 +109,9 @@

    Source code for CIME.XML.env_build

             self._caseroot = case_root
             EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)
     
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=False): +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=False): """ Set the value of an entry-id field to value Returns the value or None if not found @@ -119,7 +123,9 @@

    Source code for CIME.XML.env_build

     
             return super(EnvBuild, self).set_value(
                 vid, value, subgroup=subgroup, ignore_type=ignore_type
    -        )
    + )
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_case.html b/versions/master/html/_modules/CIME/XML/env_case.html index 27bc1c4366c..80357bbab5b 100644 --- a/versions/master/html/_modules/CIME/XML/env_case.html +++ b/versions/master/html/_modules/CIME/XML/env_case.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.env_case

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class EnvCase(EnvBase): +
    +[docs] +class EnvCase(EnvBase): # pylint: disable=unused-argument def __init__( self, case_root=None, infile="env_case.xml", components=None, read_only=False @@ -105,6 +107,7 @@

    Source code for CIME.XML.env_case

             """
             schema = os.path.join(utils.get_schema_path(), "env_entry_id.xsd")
             EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_mach_pes.html b/versions/master/html/_modules/CIME/XML/env_mach_pes.html index eddb15ee0cb..68439b6c28b 100644 --- a/versions/master/html/_modules/CIME/XML/env_mach_pes.html +++ b/versions/master/html/_modules/CIME/XML/env_mach_pes.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.env_mach_pes

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class EnvMachPes(EnvBase): +
    +[docs] +class EnvMachPes(EnvBase): def __init__( self, case_root=None, @@ -113,7 +115,9 @@

    Source code for CIME.XML.env_mach_pes

             schema = os.path.join(utils.get_schema_path(), "env_mach_pes.xsd")
             EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)
     
    -
    [docs] def add_comment(self, comment): +
    +[docs] + def add_comment(self, comment): if comment is not None: node = self.make_child("comment", text=comment) # make_child adds to the end of the file but we want it to follow the header @@ -121,7 +125,10 @@

    Source code for CIME.XML.env_mach_pes

                 self.remove_child(node)
                 self.add_child(node, position=1)
    -
    [docs] def get_value( + +
    +[docs] + def get_value( self, vid, attribute=None, @@ -160,7 +167,10 @@

    Source code for CIME.XML.env_mach_pes

                 value = self.get_value("NINST")
             return value
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=False): + +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=False): """ Set the value of an entry-id field to value Returns the value or None if not found @@ -186,7 +196,10 @@

    Source code for CIME.XML.env_mach_pes

                 self, vid, value, subgroup=subgroup, ignore_type=ignore_type
             )
    -
    [docs] def get_max_thread_count(self, comp_classes): + +
    +[docs] + def get_max_thread_count(self, comp_classes): """Find the maximum number of openmp threads for any component in the case""" max_threads = 1 for comp in comp_classes: @@ -199,7 +212,10 @@

    Source code for CIME.XML.env_mach_pes

                     max_threads = threads
             return max_threads
    -
    [docs] def get_total_tasks(self, comp_classes, async_interface=False): + +
    +[docs] + def get_total_tasks(self, comp_classes, async_interface=False): total_tasks = 0 maxinst = self.get_value("NINST") asyncio_ntasks = 0 @@ -256,7 +272,10 @@

    Source code for CIME.XML.env_mach_pes

             logger.debug("asyncio_tasks {}".format(asyncio_tasks))
             return total_tasks
    -
    [docs] def get_tasks_per_node(self, total_tasks, max_thread_count): + +
    +[docs] + def get_tasks_per_node(self, total_tasks, max_thread_count): expect( total_tasks > 0, "totaltasks > 0 expected, totaltasks = {}".format(total_tasks), @@ -282,7 +301,10 @@

    Source code for CIME.XML.env_mach_pes

                     )
             return tasks_per_node if tasks_per_node > 0 else 1
    -
    [docs] def get_total_nodes(self, total_tasks, max_thread_count): + +
    +[docs] + def get_total_nodes(self, total_tasks, max_thread_count): """ Return (num_active_nodes, num_spare_nodes) """ @@ -293,7 +315,10 @@

    Source code for CIME.XML.env_mach_pes

             num_nodes = int(math.ceil(float(total_tasks) / tasks_per_node))
             return num_nodes, self.get_spare_nodes(num_nodes)
    -
    [docs] def get_spare_nodes(self, num_nodes): + +
    +[docs] + def get_spare_nodes(self, num_nodes): force_spare_nodes = self.get_value("FORCE_SPARE_NODES") if force_spare_nodes != -999: return force_spare_nodes @@ -307,7 +332,9 @@

    Source code for CIME.XML.env_mach_pes

                 else:
                     return ten_pct
             else:
    -            return 0
    + return 0
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_mach_specific.html b/versions/master/html/_modules/CIME/XML/env_mach_specific.html index 3a7fe1ef3ee..e5d6c6fdd7d 100644 --- a/versions/master/html/_modules/CIME/XML/env_mach_specific.html +++ b/versions/master/html/_modules/CIME/XML/env_mach_specific.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -99,7 +99,9 @@

    Source code for CIME.XML.env_mach_specific

     
     # Is not of type EntryID but can use functions from EntryID (e.g
     # get_type) otherwise need to implement own functions and make GenericXML parent class
    -
    [docs]class EnvMachSpecific(EnvBase): +
    +[docs] +class EnvMachSpecific(EnvBase): # pylint: disable=unused-argument def __init__( self, @@ -132,7 +134,9 @@

    Source code for CIME.XML.env_mach_specific

             self._unit_testing = unit_testing
             self._standalone_configure = standalone_configure
     
    -
    [docs] def populate(self, machobj, attributes=None): +
    +[docs] + def populate(self, machobj, attributes=None): """Add entries to the file using information from a Machines object. mpilib must match attributes if set """ @@ -195,6 +199,7 @@

    Source code for CIME.XML.env_mach_specific

                     ),
                 )
    + def _get_modules_for_case(self, case, job=None): module_nodes = self.get_children( "modules", root=self.get_child("module_system") @@ -214,7 +219,9 @@

    Source code for CIME.XML.env_mach_specific

     
             return envs_to_set
     
    -
    [docs] def load_env(self, case, force_method=None, job=None, verbose=False): +
    +[docs] + def load_env(self, case, force_method=None, job=None, verbose=False): """ Should only be called by case.load_env """ @@ -234,6 +241,7 @@

    Source code for CIME.XML.env_mach_specific

     
             return [] if envs_to_set is None else envs_to_set
    + def _get_resources_for_case(self, case): resource_nodes = self.get_children("resource_limits") if resource_nodes is not None: @@ -262,7 +270,9 @@

    Source code for CIME.XML.env_mach_specific

             else:
                 expect(False, "Unhandled module system '{}'".format(module_system))
     
    -
    [docs] def list_modules(self): +
    +[docs] + def list_modules(self): module_system = self.get_module_system_type() # If the user's login shell is not sh, it's possible that modules @@ -288,7 +298,10 @@

    Source code for CIME.XML.env_mach_specific

             else:
                 expect(False, "Unhandled module system '{}'".format(module_system))
    -
    [docs] def save_all_env_info(self, filename): + +
    +[docs] + def save_all_env_info(self, filename): """ Get a string representation of all current environment info and save it to file. @@ -297,7 +310,10 @@

    Source code for CIME.XML.env_mach_specific

                 f.write(self.list_modules())
             run_cmd_no_fail("echo -e '\n' && env", arg_stdout=filename)
    -
    [docs] def get_overrides_nodes(self, case): + +
    +[docs] + def get_overrides_nodes(self, case): overrides = {} overrides["num_nodes"] = case.num_nodes fnm = "env_mach_specific.xml" @@ -309,7 +325,10 @@

    Source code for CIME.XML.env_mach_specific

                 fd.write(output_text)
             return overrides
    -
    [docs] def make_env_mach_specific_file(self, shell, case, output_dir=""): + +
    +[docs] + def make_env_mach_specific_file(self, shell, case, output_dir=""): """Writes .env_mach_specific.sh or .env_mach_specific.csh Args: @@ -377,6 +396,7 @@

    Source code for CIME.XML.env_mach_specific

             with open(os.path.join(output_dir, filename), "w") as fd:
                 fd.write("\n".join(lines))
    + # Private API def _load_envs(self, envs_to_set, verbose=False): @@ -630,14 +650,19 @@

    Source code for CIME.XML.env_mach_specific

             header += "{} {}".format(source_cmd, self.get_module_system_init_path(shell))
             return header
     
    -
    [docs] def get_module_system_type(self): +
    +[docs] + def get_module_system_type(self): """ Return the module system used on this machine """ module_system = self.get_child("module_system") return self.get(module_system, "type")
    -
    [docs] def allow_error(self): + +
    +[docs] + def allow_error(self): """ Return True if stderr output from module commands should be assumed to be an error. Default False. This is necessary since implementations @@ -648,7 +673,10 @@

    Source code for CIME.XML.env_mach_specific

             value = self.get(module_system, "allow_error")
             return value.upper() == "TRUE" if value is not None else False
    -
    [docs] def get_module_system_init_path(self, lang): + +
    +[docs] + def get_module_system_init_path(self, lang): init_nodes = self.get_optional_child( "init_path", attributes={"lang": lang}, root=self.get_child("module_system") ) @@ -658,7 +686,10 @@

    Source code for CIME.XML.env_mach_specific

                 else None
             )
    -
    [docs] def get_module_system_cmd_path(self, lang): + +
    +[docs] + def get_module_system_cmd_path(self, lang): cmd_nodes = self.get_optional_child( "cmd_path", attributes={"lang": lang}, root=self.get_child("module_system") ) @@ -668,6 +699,7 @@

    Source code for CIME.XML.env_mach_specific

                 else None
             )
    + def _find_best_mpirun_match(self, attribs): mpirun_nodes = self.get_children("mpirun") best_match = None @@ -730,7 +762,9 @@

    Source code for CIME.XML.env_mach_specific

     
             return best_match if best_match is not None else default_match
     
    -
    [docs] def get_aprun_mode(self, attribs): +
    +[docs] + def get_aprun_mode(self, attribs): default_mode = "default" valid_modes = ("ignore", "default", "override") @@ -756,7 +790,10 @@

    Source code for CIME.XML.env_mach_specific

     
             return mode
    -
    [docs] def get_aprun_args(self, case, attribs, job, overrides=None): + +
    +[docs] + def get_aprun_args(self, case, attribs, job, overrides=None): args = {} try: @@ -787,7 +824,10 @@

    Source code for CIME.XML.env_mach_specific

     
             return args
    -
    [docs] def get_mpirun(self, case, attribs, job, exe_only=False, overrides=None): + +
    +[docs] + def get_mpirun(self, case, attribs, job, exe_only=False, overrides=None): """ Find best match, return (executable, {arg_name : text}) """ @@ -831,8 +871,13 @@

    Source code for CIME.XML.env_mach_specific

     
             return executable, args, run_exe, run_misc_suffix
    -
    [docs] def get_type_info(self, vid): - return "char"
    + +
    +[docs] + def get_type_info(self, vid): + return "char"
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_run.html b/versions/master/html/_modules/CIME/XML/env_run.html index f453dc7064f..6dad7f8c40a 100644 --- a/versions/master/html/_modules/CIME/XML/env_run.html +++ b/versions/master/html/_modules/CIME/XML/env_run.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.XML.env_run

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class EnvRun(EnvBase): +
    +[docs] +class EnvRun(EnvBase): def __init__( self, case_root=None, infile="env_run.xml", components=None, read_only=False ): @@ -115,7 +117,9 @@

    Source code for CIME.XML.env_run

     
             EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)
     
    -
    [docs] def get_value(self, vid, attribute=None, resolved=True, subgroup=None): +
    +[docs] + def get_value(self, vid, attribute=None, resolved=True, subgroup=None): """ Get a value for entry with id attribute vid. or from the values field if the attribute argument is provided @@ -130,7 +134,10 @@

    Source code for CIME.XML.env_run

     
             return EnvBase.get_value(self, vid, attribute, resolved, subgroup)
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=False): + +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=False): """ Set the value of an entry-id field to value Returns the value or None if not found @@ -153,7 +160,9 @@

    Source code for CIME.XML.env_run

                             value, "logical", vid
                         )
     
    -        return EnvBase.set_value(self, vid, value, subgroup, ignore_type)
    + return EnvBase.set_value(self, vid, value, subgroup, ignore_type)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_test.html b/versions/master/html/_modules/CIME/XML/env_test.html index cbf1dab87f9..bcbf142f4a7 100644 --- a/versions/master/html/_modules/CIME/XML/env_test.html +++ b/versions/master/html/_modules/CIME/XML/env_test.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.env_test

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class EnvTest(EnvBase): +
    +[docs] +class EnvTest(EnvBase): # pylint: disable=unused-argument def __init__( self, case_root=None, infile="env_test.xml", components=None, read_only=False @@ -105,11 +107,16 @@

    Source code for CIME.XML.env_test

             """
             EnvBase.__init__(self, case_root, infile, read_only=read_only)
     
    -
    [docs] def add_test(self, testnode): +
    +[docs] + def add_test(self, testnode): self.add_child(testnode) self.write()
    -
    [docs] def set_initial_values(self, case): + +
    +[docs] + def set_initial_values(self, case): """ The values to initialize a test are defined in env_test.xml copy them to the appropriate case env files to initialize a test @@ -136,7 +143,10 @@

    Source code for CIME.XML.env_test

             case.flush()
             return
    -
    [docs] def set_test_parameter(self, name, value): + +
    +[docs] + def set_test_parameter(self, name, value): """ If a node already exists update the value otherwise create a node and initialize it to value @@ -150,7 +160,10 @@

    Source code for CIME.XML.env_test

             else:
                 self.set_text(idnode, value)
    -
    [docs] def get_test_parameter(self, name): + +
    +[docs] + def get_test_parameter(self, name): case = self.get_value("TESTCASE") tnode = self.get_child("test", {"NAME": case}) value = None @@ -159,14 +172,20 @@

    Source code for CIME.XML.env_test

                 value = self.text(idnode)
             return value
    -
    [docs] def get_step_phase_cnt(self, step): + +
    +[docs] + def get_step_phase_cnt(self, step): bldnodes = self.get_children(step) cnt = 0 for node in bldnodes: cnt = max(cnt, int(self.get(node, "phase"))) return cnt
    -
    [docs] def get_settings_for_phase(self, name, cnt): + +
    +[docs] + def get_settings_for_phase(self, name, cnt): node = self.get_optional_child(name, attributes={"phase": cnt}) settings = [] if node is not None: @@ -180,13 +199,19 @@

    Source code for CIME.XML.env_test

     
             return settings
    -
    [docs] def run_phase_get_clone_name(self, phase): + +
    +[docs] + def run_phase_get_clone_name(self, phase): node = self.get_child("RUN", attributes={"phase": str(phase)}) if self.has(node, "clone"): return self.get(node, "clone") return None
    -
    [docs] def cleanupnode(self, node): + +
    +[docs] + def cleanupnode(self, node): """ keep the values component set """ @@ -199,7 +224,10 @@

    Source code for CIME.XML.env_test

                 self.remove_child(dnode, root=node)
             return node
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=False): + +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=False): """ check if vid is in test section of file """ @@ -210,13 +238,18 @@

    Source code for CIME.XML.env_test

                     newval = self.set_element_text(vid, value, root=tnode)
             return newval
    -
    [docs] def get_value(self, vid, attribute=None, resolved=True, subgroup=None): + +
    +[docs] + def get_value(self, vid, attribute=None, resolved=True, subgroup=None): value = EnvBase.get_value(self, vid, attribute, resolved, subgroup) if value is None: tnode = self.get_optional_child("test") if tnode is not None: value = self.get_element_text(vid, root=tnode) - return value
    + return value
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/env_workflow.html b/versions/master/html/_modules/CIME/XML/env_workflow.html index c510df2b717..8e68a59cddb 100644 --- a/versions/master/html/_modules/CIME/XML/env_workflow.html +++ b/versions/master/html/_modules/CIME/XML/env_workflow.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,7 +98,9 @@

    Source code for CIME.XML.env_workflow

     # pragma pylint: disable=attribute-defined-outside-init
     
     
    -
    [docs]class EnvWorkflow(EnvBase): +
    +[docs] +class EnvWorkflow(EnvBase): def __init__(self, case_root=None, infile="env_workflow.xml", read_only=False): """ initialize an object interface to file env_workflow.xml in the case directory @@ -111,7 +113,9 @@

    Source code for CIME.XML.env_workflow

                 case_root, infile, schema=schema, read_only=read_only
             )
     
    -
    [docs] def create_job_groups(self, batch_jobs, is_test): +
    +[docs] + def create_job_groups(self, batch_jobs, is_test): # Subtle: in order to support dynamic batch jobs, we need to remove the # job_submission group and replace with job-based groups orig_group = self.get_optional_child( @@ -149,14 +153,20 @@

    Source code for CIME.XML.env_workflow

                     for child in childnodes:
                         self.add_child(self.copy(child), root=new_job_group)
    -
    [docs] def get_jobs(self): + +
    +[docs] + def get_jobs(self): groups = self.get_children("group") results = [] for group in groups: results.append(self.get(group, "id")) return results
    -
    [docs] def get_type_info(self, vid): + +
    +[docs] + def get_type_info(self, vid): gnodes = self.get_children("group") type_info = None for gnode in gnodes: @@ -175,7 +185,10 @@

    Source code for CIME.XML.env_workflow

                         )
             return type_info
    -
    [docs] def get_job_specs(self, case, job): + +
    +[docs] + def get_job_specs(self, case, job): task_count = case.get_resolved_value(self.get_value("task_count", subgroup=job)) tasks_per_node = case.get_resolved_value( self.get_value("tasks_per_node", subgroup=job) @@ -200,8 +213,11 @@

    Source code for CIME.XML.env_workflow

     
             return task_count, num_nodes, tasks_per_node, thread_count, ngpus_per_node
    + # pylint: disable=arguments-differ -
    [docs] def get_value(self, item, attribute=None, resolved=True, subgroup="PRIMARY"): +
    +[docs] + def get_value(self, item, attribute=None, resolved=True, subgroup="PRIMARY"): """ Must default subgroup to something in order to provide single return value """ @@ -217,8 +233,11 @@

    Source code for CIME.XML.env_workflow

     
             return value
    + # pylint: disable=arguments-differ -
    [docs] def set_value(self, item, value, subgroup=None, ignore_type=False): +
    +[docs] + def set_value(self, item, value, subgroup=None, ignore_type=False): """ Override the entry_id set_value function with some special cases for this class """ @@ -243,7 +262,10 @@

    Source code for CIME.XML.env_workflow

     
             return val
    -
    [docs] def get_children(self, name=None, attributes=None, root=None): + +
    +[docs] + def get_children(self, name=None, attributes=None, root=None): if name in ( "JOB_WALLCLOCK_TIME", "PROJECT", @@ -259,7 +281,9 @@

    Source code for CIME.XML.env_workflow

                     name, attributes=attributes, root=root
                 )
     
    -        return nodes
    + return nodes
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/expected_fails_file.html b/versions/master/html/_modules/CIME/XML/expected_fails_file.html index 2793bb3ddb9..dd750b84ea6 100644 --- a/versions/master/html/_modules/CIME/XML/expected_fails_file.html +++ b/versions/master/html/_modules/CIME/XML/expected_fails_file.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -137,12 +137,16 @@

    Source code for CIME.XML.expected_fails_file

    logger = logging.getLogger(__name__)
     
     
    -
    [docs]class ExpectedFailsFile(GenericXML): +
    +[docs] +class ExpectedFailsFile(GenericXML): def __init__(self, infile): schema = os.path.join(utils.get_schema_path(), "expected_fails_file.xsd") GenericXML.__init__(self, infile, schema=schema) -
    [docs] def get_expected_fails(self): +
    +[docs] + def get_expected_fails(self): """Returns a dictionary of ExpectedFails objects, where the keys are test names""" xfails = {} test_nodes = self.get_children("test") @@ -158,7 +162,9 @@

    Source code for CIME.XML.expected_fails_file

    xfails[test_name] = ExpectedFails()
                     xfails[test_name].add_failure(phase_name, status)
     
    -        return xfails
    + return xfails
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/files.html b/versions/master/html/_modules/CIME/XML/files.html index ccd9380f81b..772821d1a36 100644 --- a/versions/master/html/_modules/CIME/XML/files.html +++ b/versions/master/html/_modules/CIME/XML/files.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -103,7 +103,9 @@

    Source code for CIME.XML.files

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Files(EntryID): +
    +[docs] +class Files(EntryID): def __init__(self, comp_interface=None): """ initialize an object @@ -141,7 +143,9 @@

    Source code for CIME.XML.files

                 self.read(model_config_files)
                 self.overwrite_existing_entries()
     
    -
    [docs] def get_value(self, vid, attribute=None, resolved=True, subgroup=None): +
    +[docs] + def get_value(self, vid, attribute=None, resolved=True, subgroup=None): if vid == "COMP_ROOT_DIR_CPL": if self._cpl_comp: attribute = self._cpl_comp @@ -209,7 +213,10 @@

    Source code for CIME.XML.files

                 value = self.get_resolved_value(value)
             return value
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=False): + +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=False): if "COMP_ROOT_DIR" in vid: if subgroup is not None: self.COMP_ROOT_DIR[vid + subgroup["component"]] = value @@ -220,7 +227,10 @@

    Source code for CIME.XML.files

                 expect(False, "Attempt to set a nonmutable variable {}".format(vid))
             return value
    -
    [docs] def get_schema(self, nodename, attributes=None): + +
    +[docs] + def get_schema(self, nodename, attributes=None): node = self.get_optional_child("entry", {"id": nodename}) schemanode = self.get_optional_child("schema", root=node, attributes=attributes) if schemanode is not None: @@ -228,7 +238,10 @@

    Source code for CIME.XML.files

                 return self.get_resolved_value(self.text(schemanode))
             return None
    -
    [docs] def get_components(self, nodename): + +
    +[docs] + def get_components(self, nodename): node = self.get_optional_child("entry", {"id": nodename}) if node is not None: valnodes = self.get_children( @@ -240,7 +253,9 @@

    Source code for CIME.XML.files

                     values.append(value)
                 return values
     
    -        return None
    + return None
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/generic_xml.html b/versions/master/html/_modules/CIME/XML/generic_xml.html index 786f326b615..bcd6889f74b 100644 --- a/versions/master/html/_modules/CIME/XML/generic_xml.html +++ b/versions/master/html/_modules/CIME/XML/generic_xml.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -123,17 +123,22 @@

    Source code for CIME.XML.generic_xml

             return _Element(deepcopy(self.xml_element))
     
     
    -
    [docs]class GenericXML(object): +
    +[docs] +class GenericXML(object): _FILEMAP = {} DISABLE_CACHING = False CacheEntry = namedtuple("CacheEntry", ["tree", "root", "modtime"]) -
    [docs] @classmethod +
    +[docs] + @classmethod def invalidate(cls, filename): if filename in cls._FILEMAP: del cls._FILEMAP[filename]
    + def __init__( self, infile=None, @@ -189,7 +194,9 @@

    Source code for CIME.XML.generic_xml

     
                 self._FILEMAP[infile] = self.CacheEntry(self.tree, self.root, 0.0)
     
    -
    [docs] def read(self, infile, schema=None): +
    +[docs] + def read(self, infile, schema=None): """ Read and parse an xml file into the object """ @@ -222,7 +229,10 @@

    Source code for CIME.XML.generic_xml

                     self.tree, self.root, os.path.getmtime(infile)
                 )
    -
    [docs] def read_fd(self, fd): + +
    +[docs] + def read_fd(self, fd): expect( self.read_only or not self.filename or not self.needsrewrite, "Reading into object marked for rewrite, file {}".format(self.filename), @@ -257,17 +267,26 @@

    Source code for CIME.XML.generic_xml

                 logger.debug("Include file {}".format(path))
                 self.read(path)
    -
    [docs] def lock(self): + +
    +[docs] + def lock(self): """ A subclass is doing caching, we need to lock the tree structure in order to avoid invalidating cache. """ self.locked = True
    -
    [docs] def unlock(self): + +
    +[docs] + def unlock(self): self.locked = False
    -
    [docs] def change_file(self, newfile, copy=False): + +
    +[docs] + def change_file(self, newfile, copy=False): if copy: new_case = os.path.dirname(newfile) if not os.path.exists(new_case): @@ -278,17 +297,26 @@

    Source code for CIME.XML.generic_xml

             self.filename = newfile
             self.read(newfile)
    + # # API for individual node operations # -
    [docs] def get(self, node, attrib_name, default=None): +
    +[docs] + def get(self, node, attrib_name, default=None): return node.xml_element.get(attrib_name, default=default)
    -
    [docs] def has(self, node, attrib_name): + +
    +[docs] + def has(self, node, attrib_name): return attrib_name in node.xml_element.attrib
    -
    [docs] def set(self, node, attrib_name, value): + +
    +[docs] + def set(self, node, attrib_name, value): if self.get(node, attrib_name) != value: expect( not self.read_only, @@ -306,7 +334,10 @@

    Source code for CIME.XML.generic_xml

                 self.needsrewrite = True
                 return node.xml_element.set(attrib_name, value)
    -
    [docs] def pop(self, node, attrib_name): + +
    +[docs] + def pop(self, node, attrib_name): expect( not self.read_only, "read_only: cannot pop attrib[{}] for node {} in file {}".format( @@ -323,13 +354,19 @@

    Source code for CIME.XML.generic_xml

             self.needsrewrite = True
             return node.xml_element.attrib.pop(attrib_name)
    -
    [docs] def attrib(self, node): + +
    +[docs] + def attrib(self, node): # Return a COPY. We do not want clients making changes directly return ( None if node.xml_element.attrib is None else dict(node.xml_element.attrib) )
    -
    [docs] def set_name(self, node, name): + +
    +[docs] + def set_name(self, node, name): expect( not self.read_only, "read_only: set node name {} in file {}".format(name, self.filename), @@ -338,7 +375,10 @@

    Source code for CIME.XML.generic_xml

                 self.needsrewrite = True
                 node.xml_element.tag = name
    -
    [docs] def set_text(self, node, text): + +
    +[docs] + def set_text(self, node, text): expect( not self.read_only, "read_only: set node text {} for node {} in file {}".format( @@ -349,13 +389,22 @@

    Source code for CIME.XML.generic_xml

                 node.xml_element.text = text
                 self.needsrewrite = True
    -
    [docs] def name(self, node): + +
    +[docs] + def name(self, node): return node.xml_element.tag
    -
    [docs] def text(self, node): + +
    +[docs] + def text(self, node): return node.xml_element.text
    -
    [docs] def add_child(self, node, root=None, position=None): + +
    +[docs] + def add_child(self, node, root=None, position=None): """ Add element node to self at root """ @@ -374,10 +423,16 @@

    Source code for CIME.XML.generic_xml

             else:
                 root.xml_element.append(node.xml_element)
    -
    [docs] def copy(self, node): + +
    +[docs] + def copy(self, node): return deepcopy(node)
    -
    [docs] def remove_child(self, node, root=None): + +
    +[docs] + def remove_child(self, node, root=None): expect( not self.locked and not self.read_only, "{}: cannot remove child {} in file {}".format( @@ -390,7 +445,10 @@

    Source code for CIME.XML.generic_xml

             root = root if root is not None else self.root
             root.xml_element.remove(node.xml_element)
    -
    [docs] def make_child(self, name, attributes=None, root=None, text=None): + +
    +[docs] + def make_child(self, name, attributes=None, root=None, text=None): expect( not self.locked and not self.read_only, "{}: cannot make child {} in file {}".format( @@ -409,7 +467,10 @@

    Source code for CIME.XML.generic_xml

     
             return node
    -
    [docs] def make_child_comment(self, root=None, text=None): + +
    +[docs] + def make_child_comment(self, root=None, text=None): expect( not self.locked and not self.read_only, "{}: cannot make child {} in file {}".format( @@ -423,7 +484,10 @@

    Source code for CIME.XML.generic_xml

             root.xml_element.append(node.xml_element)
             return node
    -
    [docs] def get_children(self, name=None, attributes=None, root=None): + +
    +[docs] + def get_children(self, name=None, attributes=None, root=None): """ This is the critical function, its interface and performance are crucial. @@ -458,7 +522,10 @@

    Source code for CIME.XML.generic_xml

     
             return children
    -
    [docs] def get_child(self, name=None, attributes=None, root=None, err_msg=None): + +
    +[docs] + def get_child(self, name=None, attributes=None, root=None, err_msg=None): child = self.get_optional_child( root=root, name=name, attributes=attributes, err_msg=err_msg ) @@ -472,7 +539,10 @@

    Source code for CIME.XML.generic_xml

             )
             return child
    -
    [docs] def get_optional_child(self, name=None, attributes=None, root=None, err_msg=None): + +
    +[docs] + def get_optional_child(self, name=None, attributes=None, root=None, err_msg=None): children = self.get_children(root=root, name=name, attributes=attributes) if len(children) > 1: # see if we can reduce to 1 based on attribute counts @@ -492,7 +562,10 @@

    Source code for CIME.XML.generic_xml

             )
             return children[0] if children else None
    -
    [docs] def get_element_text(self, element_name, attributes=None, root=None): + +
    +[docs] + def get_element_text(self, element_name, attributes=None, root=None): element_node = self.get_optional_child( name=element_name, attributes=attributes, root=root ) @@ -500,7 +573,10 @@

    Source code for CIME.XML.generic_xml

                 return self.text(element_node)
             return None
    -
    [docs] def set_element_text(self, element_name, new_text, attributes=None, root=None): + +
    +[docs] + def set_element_text(self, element_name, new_text, attributes=None, root=None): element_node = self.get_optional_child( name=element_name, attributes=attributes, root=root ) @@ -509,19 +585,28 @@

    Source code for CIME.XML.generic_xml

                 return new_text
             return None
    -
    [docs] def to_string(self, node, method="xml", encoding="us-ascii"): + +
    +[docs] + def to_string(self, node, method="xml", encoding="us-ascii"): return ET.tostring(node.xml_element, method=method, encoding=encoding)
    + # # API for operations over the entire file # -
    [docs] def get_version(self): +
    +[docs] + def get_version(self): version = self.get(self.root, "version") version = 1.0 if version is None else float(version) return version
    -
    [docs] def check_timestamp(self): + +
    +[docs] + def check_timestamp(self): """ Returns True if timestamp matches what is expected """ @@ -532,7 +617,10 @@

    Source code for CIME.XML.generic_xml

             else:
                 return True
    -
    [docs] def validate_timestamp(self): + +
    +[docs] + def validate_timestamp(self): timestamp_ok = self.check_timestamp() expect( timestamp_ok, @@ -541,7 +629,10 @@

    Source code for CIME.XML.generic_xml

                 ),
             )
    -
    [docs] def write(self, outfile=None, force_write=False): + +
    +[docs] + def write(self, outfile=None, force_write=False): """ Write an xml file from data in self """ @@ -581,7 +672,10 @@

    Source code for CIME.XML.generic_xml

     
             self.needsrewrite = False
    -
    [docs] def scan_child(self, nodename, attributes=None, root=None): + +
    +[docs] + def scan_child(self, nodename, attributes=None, root=None): """ Get an xml element matching nodename with optional attributes. @@ -598,7 +692,10 @@

    Source code for CIME.XML.generic_xml

             )
             return nodes[0]
    -
    [docs] def scan_optional_child(self, nodename, attributes=None, root=None): + +
    +[docs] + def scan_optional_child(self, nodename, attributes=None, root=None): """ Get an xml element matching nodename with optional attributes. @@ -614,7 +711,10 @@

    Source code for CIME.XML.generic_xml

             )
             return nodes[0] if nodes else None
    -
    [docs] def scan_children(self, nodename, attributes=None, root=None): + +
    +[docs] + def scan_children(self, nodename, attributes=None, root=None): logger.debug( "(get_nodes) Input values: {}, {}, {}, {}".format( @@ -667,7 +767,10 @@

    Source code for CIME.XML.generic_xml

     
             return [_Element(node) for node in nodes]
    -
    [docs] def get_value( + +
    +[docs] + def get_value( self, item, attribute=None, resolved=True, subgroup=None ): # pylint: disable=unused-argument """ @@ -677,13 +780,19 @@

    Source code for CIME.XML.generic_xml

             logger.debug("Get Value for " + item)
             return None
    -
    [docs] def get_values( + +
    +[docs] + def get_values( self, vid, attribute=None, resolved=True, subgroup=None ): # pylint: disable=unused-argument logger.debug("Get Values for " + vid) return []
    -
    [docs] def set_value( + +
    +[docs] + def set_value( self, vid, value, subgroup=None, ignore_type=True ): # pylint: disable=unused-argument """ @@ -695,7 +804,10 @@

    Source code for CIME.XML.generic_xml

     
             return value if valnodes else None
    -
    [docs] def get_resolved_value(self, raw_value, allow_unresolved_envvars=False): + +
    +[docs] + def get_resolved_value(self, raw_value, allow_unresolved_envvars=False): """ A value in the xml file may contain references to other xml variables or to environment variables. These are refered to in @@ -770,7 +882,10 @@

    Source code for CIME.XML.generic_xml

     
             return item_data
    -
    [docs] def validate_xml_file(self, filename, schema): + +
    +[docs] + def validate_xml_file(self, filename, schema): """ validate an XML file against a provided schema file using pylint """ @@ -790,7 +905,10 @@

    Source code for CIME.XML.generic_xml

                 "{} --xinclude --noout --schema {} {}".format(xmllint, schema, filename)
             )
    -
    [docs] def get_raw_record(self, root=None): + +
    +[docs] + def get_raw_record(self, root=None): logger.debug("writing file {}".format(self.filename)) if root is None: root = self.root @@ -806,11 +924,16 @@

    Source code for CIME.XML.generic_xml

                 )
             return xmlstr
    -
    [docs] def get_id(self): + +
    +[docs] + def get_id(self): xmlid = self.get(self.root, "id") if xmlid is not None: return xmlid - return self.name(self.root)
    + return self.name(self.root)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/grids.html b/versions/master/html/_modules/CIME/XML/grids.html index 71aaefe6d82..53da99ed954 100644 --- a/versions/master/html/_modules/CIME/XML/grids.html +++ b/versions/master/html/_modules/CIME/XML/grids.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -103,7 +103,9 @@

    Source code for CIME.XML.grids

     GRID_SEP = ":"
     
     
    -
    [docs]class Grids(GenericXML): +
    +[docs] +class Grids(GenericXML): def __init__(self, infile=None, files=None, comp_interface=None): if files is None: files = Files(comp_interface=comp_interface) @@ -138,7 +140,9 @@

    Source code for CIME.XML.grids

     
             return gridnames
     
    -
    [docs] def get_grid_info(self, name, compset, driver): +
    +[docs] + def get_grid_info(self, name, compset, driver): """ Find the matching grid node @@ -180,6 +184,7 @@

    Source code for CIME.XML.grids

     
             return gridinfo
    + def _read_config_grids(self, name, compset, atmnlev, lndnlev): """ read config_grids.xml with version 2.0 schema @@ -610,7 +615,9 @@

    Source code for CIME.XML.grids

             for name, value in these_gridmaps.items():
                 _add_grid_info(gridmaps, name, value)
     
    -
    [docs] def print_values(self, long_output=None): +
    +[docs] + def print_values(self, long_output=None): # write out help message helptext = self.get_element_text("help") logger.info("{} ".format(helptext)) @@ -698,7 +705,9 @@

    Source code for CIME.XML.grids

                     gridnames = set(gridnames)
                     for gridname in gridnames:
                         if gridname != "null":
    -                        logger.info("    {}".format(domains[gridname]))
    + logger.info(" {}".format(domains[gridname]))
    +
    + # ------------------------------------------------------------------------ diff --git a/versions/master/html/_modules/CIME/XML/headers.html b/versions/master/html/_modules/CIME/XML/headers.html index 5063c483f2f..cc9c1101729 100644 --- a/versions/master/html/_modules/CIME/XML/headers.html +++ b/versions/master/html/_modules/CIME/XML/headers.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.headers

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Headers(GenericXML): +
    +[docs] +class Headers(GenericXML): def __init__(self, infile=None): """ initialize an object @@ -109,10 +111,14 @@

    Source code for CIME.XML.headers

                 infile = files.get_value("CASEFILE_HEADERS", resolved=True)
             super(Headers, self).__init__(infile)
     
    -
    [docs] def get_header_node(self, fname): +
    +[docs] + def get_header_node(self, fname): fnode = self.get_child("file", attributes={"name": fname}) headernode = self.get_child("header", root=fnode) - return headernode
    + return headernode
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/inputdata.html b/versions/master/html/_modules/CIME/XML/inputdata.html index 7b88756a42c..c1ce6113280 100644 --- a/versions/master/html/_modules/CIME/XML/inputdata.html +++ b/versions/master/html/_modules/CIME/XML/inputdata.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.inputdata

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Inputdata(GenericXML): +
    +[docs] +class Inputdata(GenericXML): def __init__(self, infile=None, files=None): """ initialize a files object given input pes specification file @@ -110,7 +112,9 @@

    Source code for CIME.XML.inputdata

     
             self._servernode = None
     
    -
    [docs] def get_next_server(self, attributes=None): +
    +[docs] + def get_next_server(self, attributes=None): protocol = None address = None user = "" @@ -158,7 +162,9 @@

    Source code for CIME.XML.inputdata

                     if icnode:
                         ic_filepath = self.text(icnode)
     
    -        return protocol, address, user, passwd, chksum_file, ic_filepath, inventory
    + return protocol, address, user, passwd, chksum_file, ic_filepath, inventory
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/machines.html b/versions/master/html/_modules/CIME/XML/machines.html index 9db19b5cc7a..32c841a53b9 100644 --- a/versions/master/html/_modules/CIME/XML/machines.html +++ b/versions/master/html/_modules/CIME/XML/machines.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.XML.machines

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Machines(GenericXML): +
    +[docs] +class Machines(GenericXML): def __init__(self, infile=None, files=None, machine=None, extra_machines_dir=None): """ initialize an object @@ -172,27 +174,41 @@

    Source code for CIME.XML.machines

             )
             self.set_machine(machine)
     
    -
    [docs] def get_child(self, name=None, attributes=None, root=None, err_msg=None): +
    +[docs] + def get_child(self, name=None, attributes=None, root=None, err_msg=None): if root is None: root = self.machine_node return super(Machines, self).get_child(name, attributes, root, err_msg)
    -
    [docs] def get_machines_dir(self): + +
    +[docs] + def get_machines_dir(self): """ Return the directory of the machines file """ return self.machines_dir
    -
    [docs] def get_extra_machines_dir(self): + +
    +[docs] + def get_extra_machines_dir(self): return self.extra_machines_dir
    -
    [docs] def get_machine_name(self): + +
    +[docs] + def get_machine_name(self): """ Return the name of the machine """ return self.machine
    -
    [docs] def get_node_names(self): + +
    +[docs] + def get_node_names(self): """ Return the names of all the child nodes for the target machine """ @@ -202,14 +218,20 @@

    Source code for CIME.XML.machines

                 node_names.append(self.name(node))
             return node_names
    -
    [docs] def get_first_child_nodes(self, nodename): + +
    +[docs] + def get_first_child_nodes(self, nodename): """ Return the names of all the child nodes for the target machine """ nodes = self.get_children(nodename, root=self.machine_node) return nodes
    -
    [docs] def list_available_machines(self): + +
    +[docs] + def list_available_machines(self): """ Return a list of machines defined for a given CIME_MODEL """ @@ -220,7 +242,10 @@

    Source code for CIME.XML.machines

                 machines.append(mach)
             return machines
    -
    [docs] def probe_machine_name(self, warn=True): + +
    +[docs] + def probe_machine_name(self, warn=True): """ Find a matching regular expression for hostname in the NODENAME_REGEX field in the file. First match wins. @@ -251,6 +276,7 @@

    Source code for CIME.XML.machines

     
             return machine
    + def _probe_machine_name_one_guess(self, nametomatch): """ Find a matching regular expression for nametomatch in the NODENAME_REGEX @@ -301,7 +327,9 @@

    Source code for CIME.XML.machines

     
             return machine
     
    -
    [docs] def set_machine(self, machine): +
    +[docs] + def set_machine(self, machine): """ Sets the machine block in the Machines object @@ -325,8 +353,11 @@

    Source code for CIME.XML.machines

     
             return machine
    + # pylint: disable=arguments-differ -
    [docs] def get_value(self, name, attributes=None, resolved=True, subgroup=None): +
    +[docs] + def get_value(self, name, attributes=None, resolved=True, subgroup=None): """ Get Value of fields in the config_machines.xml file """ @@ -363,7 +394,10 @@

    Source code for CIME.XML.machines

     
             return value
    -
    [docs] def get_field_from_list(self, listname, reqval=None, attributes=None): + +
    +[docs] + def get_field_from_list(self, listname, reqval=None, attributes=None): """ Some of the fields have lists of valid values in the xml, parse these lists and return the first value if reqval is not provided and reqval @@ -389,7 +423,10 @@

    Source code for CIME.XML.machines

                     return reqval
             return None
    -
    [docs] def get_default_compiler(self): + +
    +[docs] + def get_default_compiler(self): """ Get the compiler to use from the list of COMPILERS """ @@ -406,19 +443,28 @@

    Source code for CIME.XML.machines

                 value = self.get_field_from_list("COMPILERS")
             return value
    -
    [docs] def get_default_MPIlib(self, attributes=None): + +
    +[docs] + def get_default_MPIlib(self, attributes=None): """ Get the MPILIB to use from the list of MPILIBS """ return self.get_field_from_list("MPILIBS", attributes=attributes)
    -
    [docs] def is_valid_compiler(self, compiler): + +
    +[docs] + def is_valid_compiler(self, compiler): """ Check the compiler is valid for the current machine """ return self.get_field_from_list("COMPILERS", reqval=compiler) is not None
    -
    [docs] def is_valid_MPIlib(self, mpilib, attributes=None): + +
    +[docs] + def is_valid_MPIlib(self, mpilib, attributes=None): """ Check the MPILIB is valid for the current machine """ @@ -428,7 +474,10 @@

    Source code for CIME.XML.machines

                 is not None
             )
    -
    [docs] def has_batch_system(self): + +
    +[docs] + def has_batch_system(self): """ Return if this machine has a batch system """ @@ -442,7 +491,10 @@

    Source code for CIME.XML.machines

             logger.debug("Machine {} has batch: {}".format(self.machine, result))
             return result
    -
    [docs] def get_suffix(self, suffix_type): + +
    +[docs] + def get_suffix(self, suffix_type): node = self.get_optional_child("default_run_suffix") if node is not None: suffix_node = self.get_optional_child(suffix_type, root=node) @@ -451,11 +503,17 @@

    Source code for CIME.XML.machines

     
             return None
    -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=True): + +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=True): # A temporary cache only self.custom_settings[vid] = value
    -
    [docs] def print_values(self): + +
    +[docs] + def print_values(self): # write out machines machines = self.get_children("machine") logger.info("Machines") @@ -480,7 +538,10 @@

    Source code for CIME.XML.machines

                 if max_gpus_per_node is not None:
                     print("      max_gpus/node ", self.text(max_gpus_per_node))
    -
    [docs] def return_values(self): + +
    +[docs] + def return_values(self): """return a dictionary of machine info This routine is used by external tools in https://github.com/NCAR/CESM_xml2html """ @@ -506,7 +567,9 @@

    Source code for CIME.XML.machines

                 max_gpus_per_node = self.get_child("MAX_GPUS_PER_NODE", root=machine)
                 mach_dict[(name, "max_gpus_per_node")] = self.text(max_gpus_per_node)
     
    -        return mach_dict
    + return mach_dict
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/namelist_definition.html b/versions/master/html/_modules/CIME/XML/namelist_definition.html index 99e6117db79..deba843b953 100644 --- a/versions/master/html/_modules/CIME/XML/namelist_definition.html +++ b/versions/master/html/_modules/CIME/XML/namelist_definition.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -117,7 +117,9 @@

    Source code for CIME.XML.namelist_definition

    _array_size_re = re.compile(r"^(?P<type>[^(]+)\((?P<size>[^)]+)\)$")
     
     
    -
    [docs]class CaseInsensitiveDict(dict): +
    +[docs] +class CaseInsensitiveDict(dict): """Basic case insensitive dict with strings only keys. From https://stackoverflow.com/a/27890005""" @@ -142,15 +144,21 @@

    Source code for CIME.XML.namelist_definition

    key = self.proxy[k.lower()]
             return super(CaseInsensitiveDict, self).__getitem__(key)
     
    -
    [docs] def get(self, k, default=None): +
    +[docs] + def get(self, k, default=None): return self[k] if k in self else default
    + def __setitem__(self, k, v): super(CaseInsensitiveDict, self).__setitem__(k, v) self.proxy[k.lower()] = k
    -
    [docs]class NamelistDefinition(EntryID): + +
    +[docs] +class NamelistDefinition(EntryID): """Class representing variable definitions for a namelist. This class inherits from `EntryID`, and supports most inherited methods; @@ -182,7 +190,9 @@

    Source code for CIME.XML.namelist_definition

    self._group_names = CaseInsensitiveDict({})
             self._nodes = {}
     
    -
    [docs] def set_node_values(self, name, node): +
    +[docs] + def set_node_values(self, name, node): self._entry_nodes.append(node) self._entry_ids.append(name) self._nodes[name] = node @@ -190,7 +200,10 @@

    Source code for CIME.XML.namelist_definition

    self._valid_values[name] = self._get_valid_values(node)
             self._group_names[name] = self.get_group_name(node)
    -
    [docs] def set_nodes(self, skip_groups=None): + +
    +[docs] + def set_nodes(self, skip_groups=None): """ populates the object data types for all nodes that are not part of the skip_groups array returns nodes that do not have attributes of `skip_default_entry` or `per_stream_entry` @@ -217,13 +230,17 @@

    Source code for CIME.XML.namelist_definition

    return default_nodes
    -
    [docs] def get_group_name(self, node=None): + +
    +[docs] + def get_group_name(self, node=None): if self.get_version() == 1.0: group = self.get(node, "group") elif self.get_version() >= 2.0: group = self.get_element_text("group", root=node) return group
    + def _get_type(self, node): if self.get_version() == 1.0: type_info = self.get(node, "type") @@ -246,25 +263,42 @@

    Source code for CIME.XML.namelist_definition

    valid_values = valid_values.split(",")
             return valid_values
     
    -
    [docs] def get_group(self, name): +
    +[docs] + def get_group(self, name): return self._group_names[name]
    -
    [docs] def rename_group(self, oldgroup, newgroup): + +
    +[docs] + def rename_group(self, oldgroup, newgroup): for var in self._group_names: if self._group_names[var] == oldgroup: self._group_names[var] = newgroup
    -
    [docs] def add_attributes(self, attributes): + +
    +[docs] + def add_attributes(self, attributes): self._attributes = attributes
    -
    [docs] def get_attributes(self): + +
    +[docs] + def get_attributes(self): """Return this object's attributes dictionary""" return self._attributes
    -
    [docs] def get_entry_nodes(self): + +
    +[docs] + def get_entry_nodes(self): return self._entry_nodes
    -
    [docs] def get_per_stream_entries(self): + +
    +[docs] + def get_per_stream_entries(self): entries = [] nodes = self.get_children("entry") for node in nodes: @@ -273,16 +307,22 @@

    Source code for CIME.XML.namelist_definition

    entries.append(self.get(node, "id"))
             return entries
    + # Currently we don't use this object to construct new files, and it's no # good for that purpose anyway, so stop this function from being called. -
    [docs] def set_value(self, vid, value, subgroup=None, ignore_type=True): +
    +[docs] + def set_value(self, vid, value, subgroup=None, ignore_type=True): """This function is not implemented.""" raise TypeError("NamelistDefinition does not support `set_value`.")
    + # In contrast to the entry_id version of this method, this version doesn't support the # replacement_for_none argument, because it is hard-coded to ''. # pylint: disable=arguments-differ -
    [docs] def get_value_match(self, vid, attributes=None, exact_match=True, entry_node=None): +
    +[docs] + def get_value_match(self, vid, attributes=None, exact_match=True, entry_node=None): """Return the default value for the variable named `vid`. The return value is a list of strings corresponding to the @@ -312,6 +352,7 @@

    Source code for CIME.XML.namelist_definition

    return value
    + @staticmethod def _split_defaults_text(string): """Take a comma-separated list in a string, and split it into a list.""" @@ -339,7 +380,9 @@

    Source code for CIME.XML.namelist_definition

    value.append(string[pos:].strip())
             return value
     
    -
    [docs] def split_type_string(self, name): +
    +[docs] + def split_type_string(self, name): """Split a 'type' attribute string into its component parts. The `name` argument is the variable name. @@ -395,6 +438,7 @@

    Source code for CIME.XML.namelist_definition

    max_len = None
             return type_, max_len, size
    + @staticmethod def _canonicalize_value(type_, value): """Create 'canonical' version of a value for comparison purposes.""" @@ -408,7 +452,9 @@

    Source code for CIME.XML.namelist_definition

    canonical_value = [int(scalar) for scalar in canonical_value]
             return canonical_value
     
    -
    [docs] def is_valid_value(self, name, value): +
    +[docs] + def is_valid_value(self, name, value): """Determine whether a value is valid for the named variable. The `value` argument must be a list of strings formatted as they would @@ -467,6 +513,7 @@

    Source code for CIME.XML.namelist_definition

    )
             return True
    + def _expect_variable_in_definition(self, name, variable_template): """Used to get a better error message for an unexpected variable. case insensitve match""" @@ -510,7 +557,9 @@

    Source code for CIME.XML.namelist_definition

    variable_template = "Variable {!r} from file " + repr(str(msgfn))
             return variable_template
     
    -
    [docs] def validate(self, namelist, filename=None): +
    +[docs] + def validate(self, namelist, filename=None): """Validate a namelist object against this definition. The optional `filename` argument can be used to assist in error @@ -552,7 +601,10 @@

    Source code for CIME.XML.namelist_definition

    ),
                     )
    -
    [docs] def dict_to_namelist(self, dict_, filename=None): + +
    +[docs] + def dict_to_namelist(self, dict_, filename=None): """Converts a dictionary of name-value pairs to a `Namelist`. The input is assumed to be similar to the output of `parse` when @@ -579,7 +631,10 @@

    Source code for CIME.XML.namelist_definition

    groups[group_name][variable_lc] = dict_[variable_name]
             return Namelist(groups)
    -
    [docs] def get_input_pathname(self, name): + +
    +[docs] + def get_input_pathname(self, name): node = self._nodes[name] if self.get_version() == 1.0: input_pathname = self.get(node, "input_pathname") @@ -587,8 +642,11 @@

    Source code for CIME.XML.namelist_definition

    input_pathname = self._get_node_element_info(node, "input_pathname")
             return input_pathname
    + # pylint: disable=arguments-differ -
    [docs] def get_default_value(self, item, attribute=None): +
    +[docs] + def get_default_value(self, item, attribute=None): """Return the default value for the variable named `item`. The return value is a list of strings corresponding to the @@ -603,7 +661,9 @@

    Source code for CIME.XML.namelist_definition

    all_attributes.update(attribute)
     
             value = self.get_value_match(item.lower(), all_attributes, True)
    -        return value
    + return value
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/pes.html b/versions/master/html/_modules/CIME/XML/pes.html index c79a0de00f5..d3c937fbad8 100644 --- a/versions/master/html/_modules/CIME/XML/pes.html +++ b/versions/master/html/_modules/CIME/XML/pes.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.XML.pes

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Pes(GenericXML): +
    +[docs] +class Pes(GenericXML): def __init__(self, infile, files=None): """ initialize a files object given input pes specification file @@ -106,7 +108,9 @@

    Source code for CIME.XML.pes

             logger.debug("DEBUG: infile is {}".format(infile))
             GenericXML.__init__(self, infile, schema=schema)
     
    -
    [docs] def find_pes_layout(self, grid, compset, machine, pesize_opts="M", mpilib=None): +
    +[docs] + def find_pes_layout(self, grid, compset, machine, pesize_opts="M", mpilib=None): opes_ntasks = {} opes_nthrds = {} opes_rootpe = {} @@ -175,6 +179,7 @@

    Source code for CIME.XML.pes

     
             return pes_ntasks, pes_nthrds, pes_rootpe, pes_pstrid, other_settings, comments
    + def _find_matches( self, grid_nodes, grid, compset, machine, pesize_opts, override=False ): @@ -317,6 +322,7 @@

    Source code for CIME.XML.pes

                     logger.info("Pes setting: pesize match  is {} ".format(pesize_choice))
     
             return pes_ntasks, pes_nthrds, pes_rootpe, pes_pstrid, other_settings, comment
    +
    diff --git a/versions/master/html/_modules/CIME/XML/pio.html b/versions/master/html/_modules/CIME/XML/pio.html index d9316957156..8edd1aa9190 100644 --- a/versions/master/html/_modules/CIME/XML/pio.html +++ b/versions/master/html/_modules/CIME/XML/pio.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.XML.pio

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class PIO(EntryID): +
    +[docs] +class PIO(EntryID): def __init__(self, comp_classes, infile=None, files=None): if infile is None: if files is None: @@ -107,7 +109,9 @@

    Source code for CIME.XML.pio

     
             self._components = list(comp_classes)
     
    -
    [docs] def check_if_comp_var(self, vid, attribute=None, node=None): +
    +[docs] + def check_if_comp_var(self, vid, attribute=None, node=None): comp = None new_vid = None for comp in self._components: @@ -123,7 +127,10 @@

    Source code for CIME.XML.pio

     
             return vid, None, False
    -
    [docs] def get_defaults( + +
    +[docs] + def get_defaults( self, grid=None, compset=None, mach=None, compiler=None, mpilib=None ): # pylint: disable=unused-argument # should we have a env_pio file @@ -151,7 +158,9 @@

    Source code for CIME.XML.pio

             for k, v in save_for_last:
                 defaults[k] = v
     
    -        return defaults
    + return defaults
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/stream.html b/versions/master/html/_modules/CIME/XML/stream.html index 880bfbb9c41..b3204c2b48b 100644 --- a/versions/master/html/_modules/CIME/XML/stream.html +++ b/versions/master/html/_modules/CIME/XML/stream.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.XML.stream

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Stream(GenericXML): +
    +[docs] +class Stream(GenericXML): def __init__(self, infile=None, files=None): """ initialize an object @@ -107,7 +109,9 @@

    Source code for CIME.XML.stream

             schema = None
             GenericXML.__init__(self, infile, schema=schema)
     
    -
    [docs] def get_value(self, item, attribute=None, resolved=True, subgroup=None): +
    +[docs] + def get_value(self, item, attribute=None, resolved=True, subgroup=None): """ Get Value of fields in a stream.xml file """ @@ -132,7 +136,9 @@

    Source code for CIME.XML.stream

                 elif item in os.environ:
                     value = os.environ[item]
     
    -        return value
    + return value
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/test_reporter.html b/versions/master/html/_modules/CIME/XML/test_reporter.html index bce8309ceac..0d4d93fb07d 100644 --- a/versions/master/html/_modules/CIME/XML/test_reporter.html +++ b/versions/master/html/_modules/CIME/XML/test_reporter.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -99,7 +99,9 @@

    Source code for CIME.XML.test_reporter

     ssl._create_default_https_context = ssl._create_unverified_context
     
     
    -
    [docs]class TestReporter(GenericXML): +
    +[docs] +class TestReporter(GenericXML): def __init__(self): """ initialize an object @@ -113,7 +115,9 @@

    Source code for CIME.XML.test_reporter

                 infile="TestRecord.xml",
             )
     
    -
    [docs] def setup_header( +
    +[docs] + def setup_header( self, tagname, machine, compiler, mpilib, testroot, testtype, baseline ): # @@ -130,7 +134,10 @@

    Source code for CIME.XML.test_reporter

             ]:
                 self.make_child(name, attributes=attribs, text=text)
    -
    [docs] def add_result(self, test_name, test_status): + +
    +[docs] + def add_result(self, test_name, test_status): # # Add a test result to the XML structure. # @@ -151,7 +158,10 @@

    Source code for CIME.XML.test_reporter

                     "category", attributes={"name": attrib_name}, text=text, root=tlelem
                 )
    -
    [docs] def push2testdb(self): + +
    +[docs] + def push2testdb(self): # # Post test result XML to CESM test database # @@ -167,7 +177,9 @@

    Source code for CIME.XML.test_reporter

             data = data.encode("ascii")
             req = urllib.request.Request(url, data)
             result = urllib.request.urlopen(req)
    -        print(result.read())
    + print(result.read())
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/testlist.html b/versions/master/html/_modules/CIME/XML/testlist.html index 3f87741c04b..c4fed675be7 100644 --- a/versions/master/html/_modules/CIME/XML/testlist.html +++ b/versions/master/html/_modules/CIME/XML/testlist.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -129,7 +129,9 @@

    Source code for CIME.XML.testlist

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Testlist(GenericXML): +
    +[docs] +class Testlist(GenericXML): def __init__(self, infile, files=None): """ initialize an object @@ -146,7 +148,9 @@

    Source code for CIME.XML.testlist

                 ),
             )
     
    -
    [docs] def get_tests( +
    +[docs] + def get_tests( self, machine=None, category=None, @@ -225,7 +229,9 @@

    Source code for CIME.XML.testlist

     
                         tests.append(this_test)
     
    -        return tests
    + return tests
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/tests.html b/versions/master/html/_modules/CIME/XML/tests.html index b29d8532cbd..68e689f0351 100644 --- a/versions/master/html/_modules/CIME/XML/tests.html +++ b/versions/master/html/_modules/CIME/XML/tests.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,7 +98,9 @@

    Source code for CIME.XML.tests

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Tests(GenericXML): +
    +[docs] +class Tests(GenericXML): def __init__(self, infile=None, files=None): """ initialize an object interface to file config_tests.xml @@ -116,7 +118,9 @@

    Source code for CIME.XML.tests

                 if os.path.isfile(infile):
                     self.read(infile)
     
    -
    [docs] def support_single_exe(self, case): +
    +[docs] + def support_single_exe(self, case): """Checks if case supports --single-exe. Raises: @@ -143,13 +147,19 @@

    Source code for CIME.XML.tests

                     f"{case_base_id} does not support the '--single-exe' option as it requires separate builds"
                 )
    -
    [docs] def get_test_node(self, testname): + +
    +[docs] + def get_test_node(self, testname): logger.debug("Get settings for {}".format(testname)) node = self.get_child("test", {"NAME": testname}) logger.debug("Found {}".format(self.text(node))) return node
    -
    [docs] def print_values(self, skip_infrastructure_tests=True): + +
    +[docs] + def print_values(self, skip_infrastructure_tests=True): """ Print each test type and its description. @@ -171,7 +181,9 @@

    Source code for CIME.XML.tests

                         continue
                 name = self.get(one_test, "NAME")
                 desc = self.get_element_text("DESC", root=one_test)
    -            logger.info("{}: {}".format(name, desc))
    + logger.info("{}: {}".format(name, desc))
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/testspec.html b/versions/master/html/_modules/CIME/XML/testspec.html index 2f220c5cb0b..63cccb61850 100644 --- a/versions/master/html/_modules/CIME/XML/testspec.html +++ b/versions/master/html/_modules/CIME/XML/testspec.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.XML.testspec

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class TestSpec(GenericXML): +
    +[docs] +class TestSpec(GenericXML): def __init__(self, infile): """ initialize an object @@ -107,7 +109,9 @@

    Source code for CIME.XML.testspec

                 for node in testnodes:
                     self._testnodes[self.get(node, "name")] = node
     
    -
    [docs] def set_header( +
    +[docs] + def set_header( self, testroot, machine, testid, baselinetag=None, baselineroot=None ): tlelem = self.make_child("testlist") @@ -124,7 +128,10 @@

    Source code for CIME.XML.testspec

     
             self._testlist_node = tlelem
    -
    [docs] def add_test(self, compiler, mpilib, testname): + +
    +[docs] + def add_test(self, compiler, mpilib, testname): expect( testname not in self._testnodes, "Test {} already in testlist".format(testname), @@ -139,7 +146,10 @@

    Source code for CIME.XML.testspec

     
             self._testnodes[testname] = telem
    -
    [docs] def update_test_status(self, testname, phase, status): + +
    +[docs] + def update_test_status(self, testname, phase, status): expect( testname in self._testnodes, "Test {} not defined in testlist".format(testname), @@ -149,7 +159,9 @@

    Source code for CIME.XML.testspec

             if pnode is not None:
                 self.set(pnode, "status", status)
             else:
    -            self.make_child("section", {"name": phase, "status": status}, root=root)
    + self.make_child("section", {"name": phase, "status": status}, root=root)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/XML/workflow.html b/versions/master/html/_modules/CIME/XML/workflow.html index 193fd4a1a83..b05218c35d2 100644 --- a/versions/master/html/_modules/CIME/XML/workflow.html +++ b/versions/master/html/_modules/CIME/XML/workflow.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.XML.workflow

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Workflow(GenericXML): +
    +[docs] +class Workflow(GenericXML): def __init__(self, infile=None, files=None): """ initialize an object @@ -117,7 +119,9 @@

    Source code for CIME.XML.workflow

             if os.path.exists(infile):
                 GenericXML.read(self, infile)
     
    -
    [docs] def get_workflow_jobs(self, machine, workflowid="default"): +
    +[docs] + def get_workflow_jobs(self, machine, workflowid="default"): """ Return a list of jobs with the first element the name of the script and the second a dict of qualifiers for the job @@ -168,7 +172,9 @@

    Source code for CIME.XML.workflow

     
                     jobs.append((name, jdict))
     
    -        return jobs
    + return jobs
    +
    +
    diff --git a/versions/master/html/_modules/CIME/aprun.html b/versions/master/html/_modules/CIME/aprun.html index 9f50dff7016..2f6803d450b 100644 --- a/versions/master/html/_modules/CIME/aprun.html +++ b/versions/master/html/_modules/CIME/aprun.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -237,7 +237,9 @@

    Source code for CIME.aprun

     
     
     ###############################################################################
    -
    [docs]def get_aprun_cmd_for_case(case, run_exe, overrides=None, extra_args=None): +
    +[docs] +def get_aprun_cmd_for_case(case, run_exe, overrides=None, extra_args=None): ############################################################################### """ Given a case, construct and return the aprun command and optimized node count @@ -278,6 +280,7 @@

    Source code for CIME.aprun

             run_exe,
             extra_args,
         )
    +
    diff --git a/versions/master/html/_modules/CIME/baselines/performance.html b/versions/master/html/_modules/CIME/baselines/performance.html new file mode 100644 index 00000000000..f4628435a9f --- /dev/null +++ b/versions/master/html/_modules/CIME/baselines/performance.html @@ -0,0 +1,702 @@ + + + + + + CIME.baselines.performance — CIME master documentation + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for CIME.baselines.performance

    +import os
    +import glob
    +import re
    +import gzip
    +import logging
    +from CIME.config import Config
    +from CIME.utils import expect
    +
    +logger = logging.getLogger(__name__)
    +
    +
    +
    +[docs] +def perf_compare_throughput_baseline(case, baseline_dir=None): + """ + Compares model throughput. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + baseline_dir : str + Overrides the baseline directory. + + Returns + ------- + below_tolerance : bool + Whether the comparison was below the tolerance. + comment : str + Provides explanation from comparison. + """ + if baseline_dir is None: + baseline_dir = case.get_baseline_dir() + + config = load_coupler_customization(case) + + baseline_file = os.path.join(baseline_dir, "cpl-tput.log") + + try: + baseline = read_baseline_file(baseline_file) + except FileNotFoundError as e: + comment = f"Could not read baseline throughput file: {e!s}" + + logger.debug(comment) + + return None, comment + + tolerance = case.get_value("TEST_TPUT_TOLERANCE") + + if tolerance is None: + tolerance = 0.1 + + expect( + tolerance > 0.0, + "Bad value for throughput tolerance in test", + ) + + try: + below_tolerance, comment = config.perf_compare_throughput_baseline( + case, baseline, tolerance + ) + except AttributeError: + below_tolerance, comment = _perf_compare_throughput_baseline( + case, baseline, tolerance + ) + + return below_tolerance, comment
    + + + +
    +[docs] +def perf_compare_memory_baseline(case, baseline_dir=None): + """ + Compares model highwater memory usage. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + baseline_dir : str + Overrides the baseline directory. + + Returns + ------- + below_tolerance : bool + Whether the comparison was below the tolerance. + comment : str + Provides explanation from comparison. + """ + if baseline_dir is None: + baseline_dir = case.get_baseline_dir() + + config = load_coupler_customization(case) + + baseline_file = os.path.join(baseline_dir, "cpl-mem.log") + + try: + baseline = read_baseline_file(baseline_file) + except FileNotFoundError as e: + comment = f"Could not read baseline memory usage: {e!s}" + + logger.debug(comment) + + return None, comment + + tolerance = case.get_value("TEST_MEMLEAK_TOLERANCE") + + if tolerance is None: + tolerance = 0.1 + + try: + below_tolerance, comments = config.perf_compare_memory_baseline( + case, baseline, tolerance + ) + except AttributeError: + below_tolerance, comments = _perf_compare_memory_baseline( + case, baseline, tolerance + ) + + return below_tolerance, comments
    + + + +
    +[docs] +def perf_write_baseline(case, basegen_dir, throughput=True, memory=True): + """ + Writes the baseline performance files. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + basegen_dir : str + Path to baseline directory. + throughput : bool + If true, write throughput baseline. + memory : bool + If true, write memory baseline. + """ + config = load_coupler_customization(case) + + if throughput: + try: + tput = perf_get_throughput(case, config) + except RuntimeError as e: + logger.debug("Could not get throughput: {0!s}".format(e)) + else: + baseline_file = os.path.join(basegen_dir, "cpl-tput.log") + + write_baseline_file(baseline_file, tput) + + if memory: + try: + mem = perf_get_memory(case, config) + except RuntimeError as e: + logger.info("Could not get memory usage: {0!s}".format(e)) + else: + baseline_file = os.path.join(basegen_dir, "cpl-mem.log") + + write_baseline_file(baseline_file, mem)
    + + + +
    +[docs] +def load_coupler_customization(case): + """ + Loads customizations from the coupler `cime_config` directory. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + + Returns + ------- + CIME.config.Config + Runtime configuration. + """ + comp_root_dir_cpl = case.get_value("COMP_ROOT_DIR_CPL") + + cpl_customize = os.path.join(comp_root_dir_cpl, "cime_config", "customize") + + return Config.load(cpl_customize)
    + + + +
    +[docs] +def perf_get_throughput(case, config): + """ + Gets the model throughput. + + First attempts to use a coupler define method to retrieve the + models throughput. If this is not defined then the default + method of parsing the coupler log is used. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + + Returns + ------- + str or None + Model throughput. + """ + try: + tput = config.perf_get_throughput(case) + except AttributeError: + tput = _perf_get_throughput(case) + + if tput is None: + raise RuntimeError("Could not get default throughput") from None + + tput = str(tput) + + return tput
    + + + +
    +[docs] +def perf_get_memory(case, config): + """ + Gets the model memory usage. + + First attempts to use a coupler defined method to retrieve the + models memory usage. If this is not defined then the default + method of parsing the coupler log is used. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + + Returns + ------- + str or None + Model memory usage. + """ + try: + mem = config.perf_get_memory(case) + except AttributeError: + mem = _perf_get_memory(case) + + if mem is None: + raise RuntimeError("Could not get default memory usage") from None + + mem = str(mem[-1][1]) + + return mem
    + + + +
    +[docs] +def write_baseline_file(baseline_file, value): + """ + Writes value to `baseline_file`. + + Parameters + ---------- + baseline_file : str + Path to the baseline file. + value : str + Value to write. + """ + with open(baseline_file, "w") as fd: + fd.write(value)
    + + + +def _perf_get_memory(case, cpllog=None): + """ + Default function to retrieve memory usage from the coupler log. + + If the usage is not available from the log then `None` is returned. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + cpllog : str + Overrides the default coupler log. + + Returns + ------- + str or None + Model memory usage or `None`. + + Raises + ------ + RuntimeError + If not enough sample were found. + """ + if cpllog is None: + cpllog = get_latest_cpl_logs(case) + else: + cpllog = [ + cpllog, + ] + + try: + memlist = get_cpl_mem_usage(cpllog[0]) + except (FileNotFoundError, IndexError): + memlist = None + + logger.debug("Could not parse memory usage from coupler log") + else: + if len(memlist) <= 3: + raise RuntimeError( + f"Found {len(memlist)} memory usage samples, need atleast 4" + ) + + return memlist + + +def _perf_get_throughput(case): + """ + Default function to retrieve throughput from the coupler log. + + If the throughput is not available from the log then `None` is returned. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + + Returns + ------- + str or None + Model throughput or `None`. + """ + cpllog = get_latest_cpl_logs(case) + + try: + tput = get_cpl_throughput(cpllog[0]) + except (FileNotFoundError, IndexError): + tput = None + + logger.debug("Could not parse throughput from coupler log") + + return tput + + +
    +[docs] +def get_latest_cpl_logs(case): + """ + find and return the latest cpl log file in the run directory + """ + coupler_log_path = case.get_value("RUNDIR") + + cpllog_name = "drv" if case.get_value("COMP_INTERFACE") == "nuopc" else "cpl" + + cpllogs = glob.glob(os.path.join(coupler_log_path, "{}*.log.*".format(cpllog_name))) + + lastcpllogs = [] + + if cpllogs: + lastcpllogs.append(max(cpllogs, key=os.path.getctime)) + + basename = os.path.basename(lastcpllogs[0]) + + suffix = basename.split(".", 1)[1] + + for log in cpllogs: + if log in lastcpllogs: + continue + + if log.endswith(suffix): + lastcpllogs.append(log) + + return lastcpllogs
    + + + +
    +[docs] +def get_cpl_mem_usage(cpllog): + """ + Read memory usage from coupler log. + + Parameters + ---------- + cpllog : str + Path to the coupler log. + + Returns + ------- + list + Memory usage (data, highwater) as recorded by the coupler or empty list. + """ + memlist = [] + + meminfo = re.compile(r".*model date =\s+(\w+).*memory =\s+(\d+\.?\d+).*highwater") + + if cpllog is not None and os.path.isfile(cpllog): + if ".gz" == cpllog[-3:]: + fopen = gzip.open + else: + fopen = open + + with fopen(cpllog, "rb") as f: + for line in f: + m = meminfo.match(line.decode("utf-8")) + + if m: + memlist.append((float(m.group(1)), float(m.group(2)))) + + # Remove the last mem record, it's sometimes artificially high + if len(memlist) > 0: + memlist.pop() + + return memlist
    + + + +
    +[docs] +def get_cpl_throughput(cpllog): + """ + Reads throuhgput from coupler log. + + Parameters + ---------- + cpllog : str + Path to the coupler log. + + Returns + ------- + int or None + Throughput as recorded by the coupler or None + """ + if cpllog is not None and os.path.isfile(cpllog): + with gzip.open(cpllog, "rb") as f: + cpltext = f.read().decode("utf-8") + + m = re.search(r"# simulated years / cmp-day =\s+(\d+\.\d+)\s", cpltext) + + if m: + return float(m.group(1)) + return None
    + + + +
    +[docs] +def read_baseline_file(baseline_file): + """ + Reads value from `baseline_file`. + + Strips comments and returns the raw content to be decoded. + + Parameters + ---------- + baseline_file : str + Path to the baseline file. + + Returns + ------- + str + Value stored in baseline file without comments. + """ + with open(baseline_file) as fd: + lines = [x.strip() for x in fd.readlines() if not x.startswith("#")] + + return "\n".join(lines)
    + + + +def _perf_compare_throughput_baseline(case, baseline, tolerance): + """ + Default throughput baseline comparison. + + Compares the throughput from the coupler to the baseline value. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + baseline : list + Lines contained in the baseline file. + tolerance : float + Allowed tolerance for comparison. + + Returns + ------- + below_tolerance : bool + Whether the comparison was below the tolerance. + comment : str + provides explanation from comparison. + """ + current = _perf_get_throughput(case) + + try: + # default baseline is stored as single float + baseline = float(baseline) + except ValueError: + comment = "Could not compare throughput to baseline, as basline had no value." + + return None, comment + + # comparing ypd so bigger is better + diff = (baseline - current) / baseline + + below_tolerance = None + + if diff is not None: + below_tolerance = diff < tolerance + + if below_tolerance: + comment = "TPUTCOMP: Computation time changed by {:.2f}% relative to baseline".format( + diff * 100 + ) + else: + comment = "Error: TPUTCOMP: Computation time increase > {:d}% from baseline".format( + int(tolerance * 100) + ) + + return below_tolerance, comment + + +def _perf_compare_memory_baseline(case, baseline, tolerance): + """ + Default memory usage baseline comparison. + + Compares the highwater memory usage from the coupler to the baseline value. + + Parameters + ---------- + case : CIME.case.case.Case + Current case object. + baseline : list + Lines contained in the baseline file. + tolerance : float + Allowed tolerance for comparison. + + Returns + ------- + below_tolerance : bool + Whether the comparison was below the tolerance. + comment : str + provides explanation from comparison. + """ + try: + current = _perf_get_memory(case) + except RuntimeError as e: + return None, str(e) + else: + current = current[-1][1] + + try: + # default baseline is stored as single float + baseline = float(baseline) + except ValueError: + baseline = 0.0 + + try: + diff = (current - baseline) / baseline + except ZeroDivisionError: + diff = 0.0 + + # Should we check if tolerance is above 0 + below_tolerance = None + comment = "" + + if diff is not None: + below_tolerance = diff < tolerance + + if below_tolerance: + comment = "MEMCOMP: Memory usage highwater has changed by {:.2f}% relative to baseline".format( + diff * 100 + ) + else: + comment = "Error: Memory usage increase >{:d}% from baseline's {:f} to {:f}".format( + int(tolerance * 100), baseline, current + ) + + return below_tolerance, comment +
    + +
    +
    +
    + +
    + +
    +

    © Copyright 2017, U.S. National Science Foundation and U.S. Department of Energy.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + + + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/versions/master/html/_modules/CIME/bless_test_results.html b/versions/master/html/_modules/CIME/bless_test_results.html index 5be56e1fc4f..3694b16fc1a 100644 --- a/versions/master/html/_modules/CIME/bless_test_results.html +++ b/versions/master/html/_modules/CIME/bless_test_results.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,12 +97,100 @@

    Source code for CIME.bless_test_results

     from CIME.hist_utils import generate_baseline, compare_baseline
     from CIME.case import Case
     from CIME.test_utils import get_test_status_files
    +from CIME.baselines.performance import (
    +    perf_compare_throughput_baseline,
    +    perf_compare_memory_baseline,
    +    perf_write_baseline,
    +)
     import os, time
     
     logger = logging.getLogger(__name__)
     
    +
    +
    +[docs] +def bless_throughput( + case, + test_name, + baseline_root, + baseline_name, + report_only, + force, +): + success = True + reason = None + + baseline_dir = os.path.join( + baseline_root, baseline_name, case.get_value("CASEBASEID") + ) + + below_threshold, comment = perf_compare_throughput_baseline( + case, baseline_dir=baseline_dir + ) + + if below_threshold: + logger.info("Diff appears to have been already resolved.") + else: + logger.info(comment) + + if not report_only and ( + force or input("Update this diff (y/n)? ").upper() in ["Y", "YES"] + ): + try: + perf_write_baseline(case, baseline_dir, memory=False) + except Exception as e: + success = False + + reason = f"Failed to write baseline throughput for {test_name!r}: {e!s}" + + return success, reason
    + + + +
    +[docs] +def bless_memory( + case, + test_name, + baseline_root, + baseline_name, + report_only, + force, +): + success = True + reason = None + + baseline_dir = os.path.join( + baseline_root, baseline_name, case.get_value("CASEBASEID") + ) + + below_threshold, comment = perf_compare_memory_baseline( + case, baseline_dir=baseline_dir + ) + + if below_threshold: + logger.info("Diff appears to have been already resolved.") + else: + logger.info(comment) + + if not report_only and ( + force or input("Update this diff (y/n)? ").upper() in ["Y", "YES"] + ): + try: + perf_write_baseline(case, baseline_dir, throughput=False) + except Exception as e: + success = False + + reason = f"Failed to write baseline memory usage for test {test_name!r}: {e!s}" + + return success, reason
    + + + ############################################################################### -
    [docs]def bless_namelists( +
    +[docs] +def bless_namelists( test_name, report_only, force, @@ -153,8 +241,11 @@

    Source code for CIME.bless_test_results

             return True, None
    + ############################################################################### -
    [docs]def bless_history(test_name, case, baseline_name, baseline_root, report_only, force): +
    +[docs] +def bless_history(test_name, case, baseline_name, baseline_root, report_only, force): ############################################################################### real_user = case.get_value("REALUSER") with EnvironmentContext(USER=real_user): @@ -189,8 +280,11 @@

    Source code for CIME.bless_test_results

                     return True, None
    + ############################################################################### -
    [docs]def bless_test_results( +
    +[docs] +def bless_test_results( baseline_name, baseline_root, test_root, @@ -198,6 +292,8 @@

    Source code for CIME.bless_test_results

         test_id=None,
         namelists_only=False,
         hist_only=False,
    +    tput_only=False,
    +    mem_only=False,
         report_only=False,
         force=False,
         pesfile=None,
    @@ -205,6 +301,7 @@ 

    Source code for CIME.bless_test_results

         no_skip_pass=False,
         new_test_root=None,
         new_test_id=None,
    +    **_,  # Capture all for extra
     ):
         ###############################################################################
         test_status_files = get_test_status_files(test_root, compiler, test_id=test_id)
    @@ -258,9 +355,15 @@ 

    Source code for CIME.bless_test_results

             if bless_tests in [[], None] or CIME.utils.match_any(
                 test_name, bless_tests_counts
             ):
    -            overall_result, phase = ts.get_overall_test_status(
    -                ignore_namelists=True, ignore_memleak=True
    -            )
    +            ts_kwargs = dict(ignore_namelists=True, ignore_memleak=True)
    +
    +            if tput_only:
    +                ts_kwargs["check_throughput"] = True
    +
    +            if mem_only:
    +                ts_kwargs["check_memory"] = True
    +
    +            overall_result, phase = ts.get_overall_test_status(**ts_kwargs)
     
                 # See if we need to bless namelist
                 if not hist_only:
    @@ -305,14 +408,13 @@ 

    Source code for CIME.bless_test_results

                     hist_bless = False
     
                 # Now, do the bless
    -            if not nl_bless and not hist_bless:
    +            if not nl_bless and not hist_bless and not tput_only and not mem_only:
                     logger.info(
                         "Nothing to bless for test: {}, overall status: {}".format(
                             test_name, overall_result
                         )
                     )
                 else:
    -
                     logger.info(
                         "###############################################################################"
                     )
    @@ -391,6 +493,32 @@ 

    Source code for CIME.bless_test_results

                             if not success:
                                 broken_blesses.append((test_name, reason))
     
    +                    if tput_only:
    +                        success, reason = bless_throughput(
    +                            case,
    +                            test_name,
    +                            baseline_root_resolved,
    +                            baseline_name_resolved,
    +                            report_only,
    +                            force,
    +                        )
    +
    +                        if not success:
    +                            broken_blesses.append((test_name, reason))
    +
    +                    if mem_only:
    +                        success, reason = bless_memory(
    +                            case,
    +                            test_name,
    +                            baseline_root_resolved,
    +                            baseline_name_resolved,
    +                            report_only,
    +                            force,
    +                        )
    +
    +                        if not success:
    +                            broken_blesses.append((test_name, reason))
    +
         # Emit a warning if items in bless_tests did not match anything
         if bless_tests:
             for bless_test, bless_count in bless_tests_counts.items():
    @@ -413,6 +541,7 @@ 

    Source code for CIME.bless_test_results

             success = False
     
         return success
    +
    diff --git a/versions/master/html/_modules/CIME/build.html b/versions/master/html/_modules/CIME/build.html index 55d81dee491..1a1ab94ae7c 100644 --- a/versions/master/html/_modules/CIME/build.html +++ b/versions/master/html/_modules/CIME/build.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -152,7 +152,9 @@

    Source code for CIME.build

     )
     
     
    -
    [docs]class CmakeTmpBuildDir(object): +
    +[docs] +class CmakeTmpBuildDir(object): """ Use to create a temporary cmake build dir for the purposes of querying Macros. @@ -170,9 +172,12 @@

    Source code for CIME.build

     
             self._entered = False
     
    -
    [docs] def get_full_tmpdir(self): +
    +[docs] + def get_full_tmpdir(self): return os.path.join(self._rootdir, self._tmpdir)
    + def __enter__(self): cmake_macros_dir = os.path.join(self._macroloc, "cmake_macros") expect( @@ -194,7 +199,9 @@

    Source code for CIME.build

             shutil.rmtree(self.get_full_tmpdir())
             self._entered = False
     
    -
    [docs] def get_makefile_vars(self, case=None, comp=None, cmake_args=None): +
    +[docs] + def get_makefile_vars(self, case=None, comp=None, cmake_args=None): """ Run cmake and process output to a list of variable settings @@ -236,10 +243,14 @@

    Source code for CIME.build

                 + "\n"
             )
     
    -        return output_to_keep
    + return output_to_keep
    +
    + -
    [docs]def generate_makefile_macro(case, caseroot): +
    +[docs] +def generate_makefile_macro(case, caseroot): """ Generates a flat Makefile macro file based on the CMake cache system. This macro is only used by certain sharedlibs since components use CMake. @@ -299,7 +310,10 @@

    Source code for CIME.build

             fd.write(all_output)
    -
    [docs]def get_standard_makefile_args(case, shared_lib=False): + +
    +[docs] +def get_standard_makefile_args(case, shared_lib=False): make_args = "CIME_MODEL={} ".format(case.get_value("MODEL")) make_args += " SMP={} ".format(stringify_bool(case.get_build_threaded())) expect( @@ -312,6 +326,7 @@

    Source code for CIME.build

         return make_args
    + def _get_compset_comps(case): comps = [] driver = case.get_value("COMP_INTERFACE") @@ -326,7 +341,9 @@

    Source code for CIME.build

         return comps
     
     
    -
    [docs]def get_standard_cmake_args(case, sharedpath): +
    +[docs] +def get_standard_cmake_args(case, sharedpath): cmake_args = "-DCIME_MODEL={} ".format(case.get_value("MODEL")) cmake_args += "-DSRC_ROOT={} ".format(case.get_value("SRCROOT")) cmake_args += " -Dcompile_threaded={} ".format( @@ -376,7 +393,10 @@

    Source code for CIME.build

         return cmake_args
    -
    [docs]def xml_to_make_variable(case, varname, cmake=False): + +
    +[docs] +def xml_to_make_variable(case, varname, cmake=False): varvalue = case.get_value(varname) if varvalue is None: return "" @@ -393,8 +413,11 @@

    Source code for CIME.build

             return "{}={} ".format(varname, varvalue)
    + ############################################################################### -
    [docs]def uses_kokkos(case): +
    +[docs] +def uses_kokkos(case): ############################################################################### cam_target = case.get_value("CAM_TARGET") # atm_comp = case.get_value("COMP_ATM") # scream does not use the shared kokkoslib for now @@ -406,6 +429,7 @@

    Source code for CIME.build

         )
    + ############################################################################### def _build_model( build_threaded, @@ -1355,7 +1379,9 @@

    Source code for CIME.build

     
     
     ###############################################################################
    -
    [docs]def post_build(case, logs, build_complete=False, save_build_provenance=True): +
    +[docs] +def post_build(case, logs, build_complete=False, save_build_provenance=True): ############################################################################### for log in logs: gzip_existing_file(log) @@ -1381,8 +1407,11 @@

    Source code for CIME.build

             lock_file("env_build.xml", caseroot=case.get_value("CASEROOT"))
    + ############################################################################### -
    [docs]def case_build( +
    +[docs] +def case_build( caseroot, case, sharedlib_only=False, @@ -1413,13 +1442,17 @@

    Source code for CIME.build

         return run_and_log_case_status(functor, cb, caseroot=caseroot)
    + ############################################################################### -
    [docs]def clean(case, cleanlist=None, clean_all=False, clean_depends=None): +
    +[docs] +def clean(case, cleanlist=None, clean_all=False, clean_depends=None): ############################################################################### functor = lambda: _clean_impl(case, cleanlist, clean_all, clean_depends) return run_and_log_case_status( functor, "build.clean", caseroot=case.get_value("CASEROOT") )
    +
    diff --git a/versions/master/html/_modules/CIME/buildlib.html b/versions/master/html/_modules/CIME/buildlib.html index 27d6d02df64..bca21bfd189 100644 --- a/versions/master/html/_modules/CIME/buildlib.html +++ b/versions/master/html/_modules/CIME/buildlib.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -104,7 +104,9 @@

    Source code for CIME.buildlib

     logger = logging.getLogger(__name__)
     
     ###############################################################################
    -
    [docs]def parse_input(argv): +
    +[docs] +def parse_input(argv): ############################################################################### parser = argparse.ArgumentParser() @@ -129,8 +131,11 @@

    Source code for CIME.buildlib

         return args.caseroot, args.libroot, args.bldroot
    + ############################################################################### -
    [docs]def build_cime_component_lib(case, compname, libroot, bldroot): +
    +[docs] +def build_cime_component_lib(case, compname, libroot, bldroot): ############################################################################### casebuild = case.get_value("CASEBUILD") @@ -176,8 +181,11 @@

    Source code for CIME.buildlib

             run_gmake(case, compclass, compname, libroot, bldroot)
    + ############################################################################### -
    [docs]def run_gmake(case, compclass, compname, libroot, bldroot, libname="", user_cppdefs=""): +
    +[docs] +def run_gmake(case, compclass, compname, libroot, bldroot, libname="", user_cppdefs=""): ############################################################################### gmake_args = get_standard_makefile_args(case) @@ -211,6 +219,7 @@

    Source code for CIME.buildlib

             logger.info("buildlib stat={} err={}".format(stat, err))
             os.unlink(complib)
         return stat
    +
    diff --git a/versions/master/html/_modules/CIME/buildnml.html b/versions/master/html/_modules/CIME/buildnml.html index 09f86312af9..25a38dbbed7 100644 --- a/versions/master/html/_modules/CIME/buildnml.html +++ b/versions/master/html/_modules/CIME/buildnml.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -102,7 +102,9 @@

    Source code for CIME.buildnml

     logger = logging.getLogger(__name__)
     
     ###############################################################################
    -
    [docs]def parse_input(argv): +
    +[docs] +def parse_input(argv): ############################################################################### parser = argparse.ArgumentParser() @@ -116,9 +118,12 @@

    Source code for CIME.buildnml

         return args.caseroot
    + ############################################################################### # pylint: disable=unused-argument -
    [docs]def build_xcpl_nml(case, caseroot, compname): +
    +[docs] +def build_xcpl_nml(case, caseroot, compname): ############################################################################### compclasses = case.get_values("COMP_CLASSES") compclass = None @@ -194,8 +199,11 @@

    Source code for CIME.buildnml

                         infile.write("{:<20s} ! {}\n".format(extra[0], extra[1]))
    + ############################################################################### -
    [docs]def create_namelist_infile(case, user_nl_file, namelist_infile, infile_text=""): +
    +[docs] +def create_namelist_infile(case, user_nl_file, namelist_infile, infile_text=""): ############################################################################### lines_input = [] if os.path.isfile(user_nl_file): @@ -225,7 +233,10 @@

    Source code for CIME.buildnml

             file_infile.write("\n".join(lines_output))
    -
    [docs]def copy_inputs_to_rundir(caseroot, compname, confdir, rundir, inst_string): + +
    +[docs] +def copy_inputs_to_rundir(caseroot, compname, confdir, rundir, inst_string): if os.path.isdir(rundir): filename = compname + "_in" @@ -242,6 +253,7 @@

    Source code for CIME.buildnml

                     safe_copy(casexml, rundir)
                 else:
                     safe_copy(xmlfile, rundir)
    +
    diff --git a/versions/master/html/_modules/CIME/case/case.html b/versions/master/html/_modules/CIME/case/case.html index b59630bfc23..b72c54e8b5b 100644 --- a/versions/master/html/_modules/CIME/case/case.html +++ b/versions/master/html/_modules/CIME/case/case.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -133,7 +133,9 @@

    Source code for CIME.case.case

     config = Config.instance()
     
     
    -
    [docs]class Case(object): +
    +[docs] +class Case(object): """ https://github.com/ESMCI/cime/wiki/Developers-Introduction The Case class is the heart of the CIME Case Control system. All @@ -293,7 +295,19 @@

    Source code for CIME.case.case

     
                 self.initialize_derived_attributes()
     
    -
    [docs] def check_if_comp_var(self, vid): +
    +[docs] + def get_baseline_dir(self): + baseline_root = self.get_value("BASELINE_ROOT") + + baseline_name = self.get_value("BASECMP_CASE") + + return os.path.join(baseline_root, baseline_name)
    + + +
    +[docs] + def check_if_comp_var(self, vid): for env_file in self._env_entryid_files: new_vid, new_comp, iscompvar = env_file.check_if_comp_var(vid) if iscompvar: @@ -301,7 +315,10 @@

    Source code for CIME.case.case

     
             return vid, None, False
    -
    [docs] def initialize_derived_attributes(self): + +
    +[docs] + def initialize_derived_attributes(self): """ These are derived variables which can be used in the config_* files for variable substitution using the {{ var }} syntax @@ -385,6 +402,7 @@

    Source code for CIME.case.case

             )
             self.srun_binding = max(1, int(self.srun_binding))
    + # Define __enter__ and __exit__ so that we can use this as a context manager # and force a flush on exit. def __enter__(self): @@ -397,7 +415,9 @@

    Source code for CIME.case.case

             self._read_only_mode = True
             return False
     
    -
    [docs] def read_xml(self): +
    +[docs] + def read_xml(self): for env_file in self._files: expect( not env_file.needsrewrite, @@ -457,11 +477,17 @@

    Source code for CIME.case.case

             )
             self._files = self._env_entryid_files + self._env_generic_files
    -
    [docs] def get_case_root(self): + +
    +[docs] + def get_case_root(self): """Returns the root directory for this case.""" return self._caseroot
    -
    [docs] def get_env(self, short_name, allow_missing=False): + +
    +[docs] + def get_env(self, short_name, allow_missing=False): full_name = "env_{}.xml".format(short_name) for env_file in self._files: if os.path.basename(env_file.filename) == full_name: @@ -470,7 +496,10 @@

    Source code for CIME.case.case

                 return None
             expect(False, "Could not find object for {} in case".format(full_name))
    -
    [docs] def check_timestamps(self, short_name=None): + +
    +[docs] + def check_timestamps(self, short_name=None): if short_name is not None: env_file = self.get_env(short_name) env_file.check_timestamp() @@ -478,7 +507,10 @@

    Source code for CIME.case.case

                 for env_file in self._files:
                     env_file.check_timestamp()
    -
    [docs] def copy(self, newcasename, newcaseroot, newcimeroot=None, newsrcroot=None): + +
    +[docs] + def copy(self, newcasename, newcaseroot, newcimeroot=None, newsrcroot=None): newcase = deepcopy(self) for env_file in newcase._files: # pylint: disable=protected-access basename = os.path.basename(env_file.filename) @@ -504,7 +536,10 @@

    Source code for CIME.case.case

     
             return newcase
    -
    [docs] def flush(self, flushall=False): + +
    +[docs] + def flush(self, flushall=False): if not os.path.isdir(self._caseroot): # do not flush if caseroot wasnt created return @@ -512,7 +547,10 @@

    Source code for CIME.case.case

             for env_file in self._files:
                 env_file.write(force_write=flushall)
    -
    [docs] def get_values(self, item, attribute=None, resolved=True, subgroup=None): + +
    +[docs] + def get_values(self, item, attribute=None, resolved=True, subgroup=None): for env_file in self._files: # Wait and resolve in self rather than in env_file results = env_file.get_values( @@ -541,10 +579,16 @@

    Source code for CIME.case.case

             # Return empty result
             return []
    -
    [docs] def get_value(self, item, attribute=None, resolved=True, subgroup=None): + +
    +[docs] + def get_value(self, item, attribute=None, resolved=True, subgroup=None): if item == "GPU_ENABLED": if not self.gpu_enabled: - if self.get_value("GPU_TYPE") != "none": + if ( + self.get_value("GPU_TYPE") != "none" + and self.get_value("NGPUS_PER_NODE") > 0 + ): self.gpu_enabled = True return "true" if self.gpu_enabled else "false" @@ -567,7 +611,10 @@

    Source code for CIME.case.case

             # Return empty result
             return result
    -
    [docs] def get_record_fields(self, variable, field): + +
    +[docs] + def get_record_fields(self, variable, field): """get_record_fields gets individual requested field from an entry_id file this routine is used only by xmlquery""" # Empty result @@ -615,7 +662,10 @@

    Source code for CIME.case.case

     
             return list(set(result))
    -
    [docs] def get_type_info(self, item): + +
    +[docs] + def get_type_info(self, item): result = None for env_file in self._env_entryid_files: result = env_file.get_type_info(item) @@ -624,7 +674,10 @@

    Source code for CIME.case.case

     
             return result
    -
    [docs] def get_resolved_value(self, item, recurse=0, allow_unresolved_envvars=False): + +
    +[docs] + def get_resolved_value(self, item, recurse=0, allow_unresolved_envvars=False): num_unresolved = item.count("$") if item else 0 recurse_limit = 10 if num_unresolved > 0 and recurse < recurse_limit: @@ -643,7 +696,10 @@

    Source code for CIME.case.case

     
             return item
    -
    [docs] def set_value( + +
    +[docs] + def set_value( self, item, value, @@ -685,7 +741,10 @@

    Source code for CIME.case.case

                     "No variable {} found in case".format(item),
                 )
    -
    [docs] def set_valid_values(self, item, valid_values): + +
    +[docs] + def set_valid_values(self, item, valid_values): """ Update or create a valid_values entry for item and populate it """ @@ -702,7 +761,10 @@

    Source code for CIME.case.case

                     logger.debug("Will rewrite file {} {}".format(env_file.filename, item))
                     return result
    -
    [docs] def set_lookup_value(self, item, value): + +
    +[docs] + def set_lookup_value(self, item, value): if item in self.lookups and self.lookups[item] is not None: logger.warning( "Item {} already in lookups with value {}".format( @@ -713,7 +775,10 @@

    Source code for CIME.case.case

                 logger.debug("Setting in lookups: item {}, value {}".format(item, value))
                 self.lookups[item] = value
    -
    [docs] def clean_up_lookups(self, allow_undefined=False): + +
    +[docs] + def clean_up_lookups(self, allow_undefined=False): # put anything in the lookups table into existing env objects for key, value in list(self.lookups.items()): logger.debug("lookup key {} value {}".format(key, value)) @@ -721,6 +786,7 @@

    Source code for CIME.case.case

                 if result is not None:
                     del self.lookups[key]
    + def _set_compset(self, compset_name, files): """ Loop through all the compset files and find the compset @@ -802,11 +868,14 @@

    Source code for CIME.case.case

     
             return compset_alias, science_support
     
    -
    [docs] def get_primary_component(self): +
    +[docs] + def get_primary_component(self): if self._primary_component is None: self._primary_component = self._find_primary_component() return self._primary_component
    + def _find_primary_component(self): """ try to glean the primary component based on compset name @@ -973,7 +1042,9 @@

    Source code for CIME.case.case

         # Note: interstitial digits are included (e.g., in FV3GFS).
         __mod_match_re__ = re.compile(r"([^%]*[^0-9%]+)")
     
    -
    [docs] def valid_compset(self, compset_name, compset_alias, files): +
    +[docs] + def valid_compset(self, compset_name, compset_alias, files): """Add stub models missing in <compset_name>, return full compset name. <files> is used to collect set of all supported components. """ @@ -1010,6 +1081,7 @@

    Source code for CIME.case.case

                 compset_name, compset_alias, comp_classes, comp_hash
             )
    + def _set_info_from_primary_component(self, files, pesfile=None): """ Sets file and directory paths that depend on the primary component of @@ -1053,7 +1125,9 @@

    Source code for CIME.case.case

             self.set_lookup_value("TESTS_MODS_DIR", tests_mods_dir)
             self.set_lookup_value("USER_MODS_DIR", user_mods_dir)
     
    -
    [docs] def get_compset_components(self): +
    +[docs] + def get_compset_components(self): # If are doing a create_clone then, self._compsetname is not set yet components = [] compset = self.get_value("COMPSET") @@ -1079,6 +1153,7 @@

    Source code for CIME.case.case

                     components.append(element_component)
             return components
    + def __iter__(self): for entryid_file in self._env_entryid_files: for key, val in entryid_file: @@ -1087,11 +1162,14 @@

    Source code for CIME.case.case

                     else:
                         yield key, val
     
    -
    [docs] def set_comp_classes(self, comp_classes): +
    +[docs] + def set_comp_classes(self, comp_classes): self._component_classes = comp_classes for env_file in self._env_entryid_files: env_file.set_components(comp_classes)
    + def _get_component_config_data(self, files): # attributes used for multi valued defaults # attlist is a dictionary used to determine the value element that has the most matches @@ -1331,7 +1409,9 @@

    Source code for CIME.case.case

             if multi_driver:
                 mach_pes_obj.set_value("MULTI_DRIVER", True)
     
    -
    [docs] def configure( +
    +[docs] + def configure( self, compset_name, grid_name, @@ -1670,9 +1750,9 @@

    Source code for CIME.case.case

                 )
     
             # Set these two GPU XML variables here to overwrite the default values
    -        if gpu_type:
    +        # Only set them for "cesm" model
    +        if self._cime_model == "cesm":
                 self.set_value("GPU_TYPE", str(gpu_type).lower())
    -        if gpu_offload:
                 self.set_value("GPU_OFFLOAD", str(gpu_offload).lower())
     
             self.initialize_derived_attributes()
    @@ -1729,7 +1809,10 @@ 

    Source code for CIME.case.case

             if input_dir is not None:
                 self.set_value("DIN_LOC_ROOT", os.path.abspath(input_dir))
    -
    [docs] def get_compset_var_settings(self, files): + +
    +[docs] + def get_compset_var_settings(self, files): infile = files.get_value( "COMPSETS_SPEC_FILE", attribute={"component": self._primary_component} ) @@ -1746,14 +1829,21 @@

    Source code for CIME.case.case

                     )
                     self.set_lookup_value(name, value)
    -
    [docs] def set_initial_test_values(self): + +
    +[docs] + def set_initial_test_values(self): testobj = self.get_env("test") testobj.set_initial_values(self)
    -
    [docs] def get_batch_jobs(self): + +
    +[docs] + def get_batch_jobs(self): batchobj = self.get_env("batch") return batchobj.get_jobs()
    + def _set_pio_xml(self): pioobj = PIO(self._component_classes) grid = self.get_value("GRID") @@ -1921,7 +2011,9 @@

    Source code for CIME.case.case

                         with open(readme_file, "w") as fd:
                             fd.write(str_to_write)
     
    -
    [docs] def create_caseroot(self, clone=False): +
    +[docs] + def create_caseroot(self, clone=False): if not os.path.exists(self._caseroot): # Make the case directory logger.info(" Creating Case directory {}".format(self._caseroot)) @@ -1994,7 +2086,10 @@

    Source code for CIME.case.case

                 self._create_caseroot_sourcemods()
             self._create_caseroot_tools()
    -
    [docs] def apply_user_mods(self, user_mods_dirs=None): + +
    +[docs] + def apply_user_mods(self, user_mods_dirs=None): """ User mods can be specified on the create_newcase command line (usually when called from create test) or they can be in the compset definition, or both. @@ -2031,6 +2126,7 @@

    Source code for CIME.case.case

             if all_user_mods:
                 self.read_xml()
    + def _get_comp_user_mods(self, component): """ For a component 'foo', gets the value of FOO_USER_MODS. @@ -2044,7 +2140,9 @@

    Source code for CIME.case.case

             else:
                 return comp_user_mods
     
    -
    [docs] def submit_jobs( +
    +[docs] + def submit_jobs( self, no_batch=False, job=None, @@ -2075,7 +2173,10 @@

    Source code for CIME.case.case

             )
             return result
    -
    [docs] def get_job_info(self): + +
    +[docs] + def get_job_info(self): """ Get information on batch jobs associated with this case """ @@ -2091,11 +2192,17 @@

    Source code for CIME.case.case

     
                 return result
    -
    [docs] def get_job_id(self, output): + +
    +[docs] + def get_job_id(self, output): env_batch = self.get_env("batch") return env_batch.get_job_id(output)
    -
    [docs] def report_job_status(self): + +
    +[docs] + def report_job_status(self): jobmap = self.get_job_info() if not jobmap: logger.info( @@ -2113,14 +2220,20 @@

    Source code for CIME.case.case

                             )
                         )
    -
    [docs] def cancel_batch_jobs(self, jobids): + +
    +[docs] + def cancel_batch_jobs(self, jobids): env_batch = self.get_env("batch") for jobid in jobids: success = env_batch.cancel_job(jobid) if not success: logger.warning("Failed to kill {}".format(jobid))
    -
    [docs] def get_mpirun_cmd(self, job=None, allow_unresolved_envvars=True, overrides=None): + +
    +[docs] + def get_mpirun_cmd(self, job=None, allow_unresolved_envvars=True, overrides=None): if job is None: job = self.get_primary_job() @@ -2212,7 +2325,10 @@

    Source code for CIME.case.case

                 allow_unresolved_envvars=allow_unresolved_envvars,
             )
    -
    [docs] def set_model_version(self, model): + +
    +[docs] + def set_model_version(self, model): version = "unknown" srcroot = self.get_value("SRCROOT") version = get_current_commit(True, srcroot, tag=(model == "cesm")) @@ -2224,7 +2340,10 @@

    Source code for CIME.case.case

             else:
                 logger.warning("WARNING: No {} Model version found.".format(model))
    -
    [docs] def load_env(self, reset=False, job=None, verbose=False): + +
    +[docs] + def load_env(self, reset=False, job=None, verbose=False): if not self._is_env_loaded or reset: if job is None: job = self.get_primary_job() @@ -2236,7 +2355,10 @@

    Source code for CIME.case.case

     
             return self._loaded_envs
    -
    [docs] def get_build_threaded(self): + +
    +[docs] + def get_build_threaded(self): """ Returns True if current settings require a threaded build/run. """ @@ -2246,6 +2368,7 @@

    Source code for CIME.case.case

             smp_present = force_threaded or self.thread_count > 1
             return smp_present
    + def _check_testlists(self, compset_alias, grid_name, files): """ CESM only: check the testlist file for tests of this compset grid combination @@ -2297,7 +2420,9 @@

    Source code for CIME.case.case

                     error_prefix="STOP: ",
                 )
     
    -
    [docs] def set_file(self, xmlfile): +
    +[docs] + def set_file(self, xmlfile): """ force the case object to consider only xmlfile """ @@ -2356,7 +2481,10 @@

    Source code for CIME.case.case

             )
             self._files = [new_env_file]
    -
    [docs] def update_env(self, new_object, env_file, blow_away=False): + +
    +[docs] + def update_env(self, new_object, env_file, blow_away=False): """ Replace a case env object file """ @@ -2377,7 +2505,10 @@

    Source code for CIME.case.case

             self._files.remove(old_object)
             self._files.append(new_object)
    -
    [docs] def get_latest_cpl_log(self, coupler_log_path=None, cplname="cpl"): + +
    +[docs] + def get_latest_cpl_log(self, coupler_log_path=None, cplname="cpl"): """ find and return the latest cpl log file in the coupler_log_path directory @@ -2392,7 +2523,10 @@

    Source code for CIME.case.case

             else:
                 return None
    -
    [docs] def record_cmd(self, cmd=None, init=False): + +
    +[docs] + def record_cmd(self, cmd=None, init=False): lines = [] caseroot = self.get_value("CASEROOT") cimeroot = self.get_value("CIMEROOT") @@ -2437,7 +2571,10 @@

    Source code for CIME.case.case

             except PermissionError:
                 logger.warning("Could not write to 'replay.sh' script")
    -
    [docs] def fix_sys_argv_quotes(self, cmd): + +
    +[docs] + def fix_sys_argv_quotes(self, cmd): """Fixes removed quotes from argument list. Restores quotes to `--val` and `KEY=VALUE` from sys.argv. @@ -2468,7 +2605,10 @@

    Source code for CIME.case.case

     
             return cmd
    -
    [docs] def create( + +
    +[docs] + def create( self, casename, srcroot, @@ -2598,7 +2738,10 @@

    Source code for CIME.case.case

     
                 raise
    -
    [docs] def new_hash(self): + +
    +[docs] + def new_hash(self): """Creates a hash""" args = "".join(sys.argv) ctime = time.strftime("%Y-%m-%d %H:%M:%S") @@ -2609,7 +2752,10 @@

    Source code for CIME.case.case

     
             return hashlib.sha256(data.encode()).hexdigest()
    -
    [docs] def is_save_timing_dir_project(self, project): + +
    +[docs] + def is_save_timing_dir_project(self, project): """ Check whether the project is permitted to archive performance data in the location specified for the current machine @@ -2628,15 +2774,24 @@

    Source code for CIME.case.case

     
                 return False
    -
    [docs] def get_primary_job(self): + +
    +[docs] + def get_primary_job(self): return "case.test" if self.get_value("TEST") else "case.run"
    -
    [docs] def get_first_job(self): + +
    +[docs] + def get_first_job(self): env_workflow = self.get_env("workflow") jobs = env_workflow.get_jobs() return jobs[0]
    -
    [docs] def preview_run(self, write, job): + +
    +[docs] + def preview_run(self, write, job): write("CASE INFO:") write(" nodes: {}".format(self.num_nodes)) write(" total tasks: {}".format(self.total_tasks)) @@ -2670,7 +2825,9 @@

    Source code for CIME.case.case

                     overrides = env_batch.get_job_overrides(job_id, self)
                     write("    MPIRUN (job={}):".format(job_id))
                     write("      {}".format(self.get_resolved_value(overrides["mpirun"])))
    -                write("")
    + write("")
    +
    +
    diff --git a/versions/master/html/_modules/CIME/case/case_clone.html b/versions/master/html/_modules/CIME/case/case_clone.html index d79269c1d47..cd383747bce 100644 --- a/versions/master/html/_modules/CIME/case/case_clone.html +++ b/versions/master/html/_modules/CIME/case/case_clone.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.case.case_clone

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]def create_clone( +
    +[docs] +def create_clone( self, newcaseroot, keepexe=False, @@ -310,6 +312,7 @@

    Source code for CIME.case.case_clone

         return newcase
    + # pylint: disable=unused-argument def _copy_user_modified_to_clone(self, origpath, newpath): """ diff --git a/versions/master/html/_modules/CIME/case/case_cmpgen_namelists.html b/versions/master/html/_modules/CIME/case/case_cmpgen_namelists.html index 6714378d9e0..4e7f09f743f 100644 --- a/versions/master/html/_modules/CIME/case/case_cmpgen_namelists.html +++ b/versions/master/html/_modules/CIME/case/case_cmpgen_namelists.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -194,7 +194,9 @@

    Source code for CIME.case.case_cmpgen_namelists

    < _do_full_nl_gen_impl(case, test, generate_name, baseline_root=baseline_root) -
    [docs]def case_cmpgen_namelists( +
    +[docs] +def case_cmpgen_namelists( self, compare=False, generate=False, @@ -277,6 +279,7 @@

    Source code for CIME.case.case_cmpgen_namelists

    < pass return success
    +
    diff --git a/versions/master/html/_modules/CIME/case/case_run.html b/versions/master/html/_modules/CIME/case/case_run.html index 0adf40330af..73f8dcae1dc 100644 --- a/versions/master/html/_modules/CIME/case/case_run.html +++ b/versions/master/html/_modules/CIME/case/case_run.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -512,7 +512,9 @@

    Source code for CIME.case.case_run

     
     
     ###############################################################################
    -
    [docs]def case_run(self, skip_pnl=False, set_continue_run=False, submit_resubmits=False): +
    +[docs] +def case_run(self, skip_pnl=False, set_continue_run=False, submit_resubmits=False): ############################################################################### model_log( "e3sm", @@ -678,6 +680,7 @@

    Source code for CIME.case.case_run

             "{} CASE.RUN HAS FINISHED".format(time.strftime("%Y-%m-%d %H:%M:%S")),
         )
         return True
    +
    diff --git a/versions/master/html/_modules/CIME/case/case_setup.html b/versions/master/html/_modules/CIME/case/case_setup.html index ffc60526654..1175d328704 100644 --- a/versions/master/html/_modules/CIME/case/case_setup.html +++ b/versions/master/html/_modules/CIME/case/case_setup.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -227,12 +227,29 @@

    Source code for CIME.case.case_setup

         ###############################################################################
         if not os.path.isfile(os.path.join(caseroot, "Macros.cmake")):
             safe_copy(os.path.join(cmake_macros_dir, "Macros.cmake"), caseroot)
    -    if not os.path.exists(os.path.join(caseroot, "cmake_macros")):
    -        shutil.copytree(cmake_macros_dir, case_cmake_path)
     
    -    copy_depends_files(
    -        mach_obj.get_machine_name(), mach_obj.machines_dir, caseroot, compiler
    -    )
    +    if not os.path.exists(case_cmake_path):
    +        os.mkdir(case_cmake_path)
    +
    +    # This impl is coupled to contents of Macros.cmake
    +    os_ = mach_obj.get_value("OS")
    +    mach = mach_obj.get_machine_name()
    +    macros = [
    +        "universal.cmake",
    +        os_ + ".cmake",
    +        compiler + ".cmake",
    +        "{}_{}.cmake".format(compiler, os),
    +        mach + ".cmake",
    +        "{}_{}.cmake".format(compiler, mach),
    +        "CMakeLists.txt",
    +    ]
    +    for macro in macros:
    +        repo_macro = os.path.join(cmake_macros_dir, macro)
    +        case_macro = os.path.join(case_cmake_path, macro)
    +        if not os.path.exists(case_macro) and os.path.exists(repo_macro):
    +            safe_copy(repo_macro, case_cmake_path)
    +
    +    copy_depends_files(mach, mach_obj.machines_dir, caseroot, compiler)
     
     
     ###############################################################################
    @@ -523,7 +540,9 @@ 

    Source code for CIME.case.case_setup

     
     
     ###############################################################################
    -
    [docs]def case_setup(self, clean=False, test_mode=False, reset=False, keep=None): +
    +[docs] +def case_setup(self, clean=False, test_mode=False, reset=False, keep=None): ############################################################################### caseroot, casebaseid = self.get_value("CASEROOT"), self.get_value("CASEBASEID") phase = "setup.clean" if clean else "case.setup" @@ -567,6 +586,7 @@

    Source code for CIME.case.case_setup

                 caseroot=caseroot,
                 is_batch=is_batch,
             )
    +
    diff --git a/versions/master/html/_modules/CIME/case/case_st_archive.html b/versions/master/html/_modules/CIME/case/case_st_archive.html index 8e9edd79080..63f34f6e391 100644 --- a/versions/master/html/_modules/CIME/case/case_st_archive.html +++ b/versions/master/html/_modules/CIME/case/case_st_archive.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -436,7 +436,9 @@

    Source code for CIME.case.case_st_archive

     
     
     ###############################################################################
    -
    [docs]def get_histfiles_for_restarts( +
    +[docs] +def get_histfiles_for_restarts( rundir, archive, archive_entry, restfile, testonly=False ): ############################################################################### @@ -494,6 +496,7 @@

    Source code for CIME.case.case_st_archive

         return histfiles
    + ############################################################################### def _archive_restarts_date( case, @@ -996,7 +999,9 @@

    Source code for CIME.case.case_st_archive

     
     
     ###############################################################################
    -
    [docs]def restore_from_archive( +
    +[docs] +def restore_from_archive( self, rest_dir=None, dout_s_root=None, rundir=None, test=False ): ############################################################################### @@ -1039,8 +1044,11 @@

    Source code for CIME.case.case_st_archive

             safe_copy(item, rundir)
    + ############################################################################### -
    [docs]def archive_last_restarts( +
    +[docs] +def archive_last_restarts( self, archive_restdir, rundir, last_date=None, link_to_restart_files=False ): ############################################################################### @@ -1081,8 +1089,11 @@

    Source code for CIME.case.case_st_archive

         )
    + ############################################################################### -
    [docs]def case_st_archive( +
    +[docs] +def case_st_archive( self, last_date_str=None, archive_incomplete_logs=True, @@ -1170,7 +1181,10 @@

    Source code for CIME.case.case_st_archive

         return True
    -
    [docs]def test_st_archive(self, testdir="st_archive_test"): + +
    +[docs] +def test_st_archive(self, testdir="st_archive_test"): files = Files() archive = Archive(files=files) components = [] @@ -1243,7 +1257,10 @@

    Source code for CIME.case.case_st_archive

         return True
    -
    [docs]def test_env_archive(self, testdir="env_archive_test"): + +
    +[docs] +def test_env_archive(self, testdir="env_archive_test"): components = self.get_values("COMP_CLASSES") comps_in_case = [] # create the run directory testdir and populate it with rest_file and hist_file from @@ -1272,7 +1289,9 @@

    Source code for CIME.case.case_st_archive

     
         for comp_archive_spec in comp_archive_specs:
             comp_expected = archive.get(comp_archive_spec, "compname")
    -        if comp_expected == "ww3":
    +        # Rename ww3 component when case and archive names don't match,
    +        # specific to CESM.
    +        if comp_expected == "ww3" and "ww" in comps_in_case:
                 comp_expected = "ww"
             comp_class = archive.get(comp_archive_spec, "compclass").upper()
             if comp_class in components:
    @@ -1349,6 +1368,7 @@ 

    Source code for CIME.case.case_st_archive

         return True
    + def _check_disposition(testdir): copyfilelist = [] for root, _, files in os.walk(testdir): diff --git a/versions/master/html/_modules/CIME/case/case_submit.html b/versions/master/html/_modules/CIME/case/case_submit.html index 57c7ba9ccbb..9c32bacb656 100644 --- a/versions/master/html/_modules/CIME/case/case_submit.html +++ b/versions/master/html/_modules/CIME/case/case_submit.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -284,7 +284,9 @@

    Source code for CIME.case.case_submit

         return xml_jobid_text
     
     
    -
    [docs]def submit( +
    +[docs] +def submit( self, job=None, no_batch=False, @@ -368,12 +370,16 @@

    Source code for CIME.case.case_submit

             raise
    -
    [docs]def check_case(self, skip_pnl=False, chksum=False): + +
    +[docs] +def check_case(self, skip_pnl=False, chksum=False): self.check_lockedfiles() if not skip_pnl: self.create_namelists() # Must be called before check_all_input_data logger.info("Checking that inputdata is available as part of case submission") - self.check_all_input_data(chksum=chksum) + if not self.get_value("TEST"): + self.check_all_input_data(chksum=chksum) if self.get_value("COMP_WAV") == "ww": # the ww3 buildnml has dependencies on inputdata so we must run it again @@ -441,7 +447,10 @@

    Source code for CIME.case.case_submit

         logger.info("Check case OK")
    -
    [docs]def check_DA_settings(self): + +
    +[docs] +def check_DA_settings(self): script = self.get_value("DATA_ASSIMILATION_SCRIPT") cycles = self.get_value("DATA_ASSIMILATION_CYCLES") if len(script) > 0 and os.path.isfile(script) and cycles > 0: @@ -450,6 +459,7 @@

    Source code for CIME.case.case_submit

                     script, cycles
                 )
             )
    +
    diff --git a/versions/master/html/_modules/CIME/case/case_test.html b/versions/master/html/_modules/CIME/case/case_test.html index 8f37a86990e..eec2af9d86d 100644 --- a/versions/master/html/_modules/CIME/case/case_test.html +++ b/versions/master/html/_modules/CIME/case/case_test.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -137,7 +137,9 @@

    Source code for CIME.case.case_test

             signal.signal(signum, _signal_handler)
     
     
    -
    [docs]def case_test(self, testname=None, reset=False, skip_pnl=False): +
    +[docs] +def case_test(self, testname=None, reset=False, skip_pnl=False): if testname is None: testname = self.get_value("TESTCASE") @@ -167,6 +169,7 @@

    Source code for CIME.case.case_test

         success = test.run(skip_pnl=skip_pnl)
     
         return success
    +
    diff --git a/versions/master/html/_modules/CIME/case/check_input_data.html b/versions/master/html/_modules/CIME/case/check_input_data.html index cd68d379a7f..e8825f7567c 100644 --- a/versions/master/html/_modules/CIME/case/check_input_data.html +++ b/versions/master/html/_modules/CIME/case/check_input_data.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -310,7 +310,9 @@

    Source code for CIME.case.check_input_data

         return success
     
     
    -
    [docs]def check_all_input_data( +
    +[docs] +def check_all_input_data( self, protocol=None, address=None, @@ -332,6 +334,7 @@

    Source code for CIME.case.check_input_data

             )
    + def _downloadfromserver(case, input_data_root, data_list_dir, attributes=None): """ Download files @@ -360,7 +363,9 @@

    Source code for CIME.case.check_input_data

         return success
     
     
    -
    [docs]def stage_refcase(self, input_data_root=None, data_list_dir=None): +
    +[docs] +def stage_refcase(self, input_data_root=None, data_list_dir=None): """ Get a REFCASE for a hybrid or branch run This is the only case in which we are downloading an entire directory instead of @@ -453,6 +458,7 @@

    Source code for CIME.case.check_input_data

         return True
    + def _check_input_data_impl( case, protocol, @@ -669,7 +675,9 @@

    Source code for CIME.case.check_input_data

         return no_files_missing
     
     
    -
    [docs]def check_input_data( +
    +[docs] +def check_input_data( case, protocol="svn", address=None, @@ -704,7 +712,10 @@

    Source code for CIME.case.check_input_data

             )
    -
    [docs]def verify_chksum(input_data_root, rundir, filename, isdirectory): + +
    +[docs] +def verify_chksum(input_data_root, rundir, filename, isdirectory): """ For file in filename perform a chksum and compare the result to that stored in the local checksumfile, if isdirectory chksum all files in the directory of form *.* @@ -751,7 +762,10 @@

    Source code for CIME.case.check_input_data

                     )
    -
    [docs]def md5(fname): + +
    +[docs] +def md5(fname): """ performs an md5 sum one chunk at a time to avoid memory issues with large files. """ @@ -760,6 +774,7 @@

    Source code for CIME.case.check_input_data

             for chunk in iter(lambda: f.read(4096), b""):
                 hash_md5.update(chunk)
         return hash_md5.hexdigest()
    +
    diff --git a/versions/master/html/_modules/CIME/case/check_lockedfiles.html b/versions/master/html/_modules/CIME/case/check_lockedfiles.html index 5d2d9c11f4b..000bea93079 100644 --- a/versions/master/html/_modules/CIME/case/check_lockedfiles.html +++ b/versions/master/html/_modules/CIME/case/check_lockedfiles.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -103,7 +103,9 @@

    Source code for CIME.case.check_lockedfiles

     import glob
     
     
    -
    [docs]def check_pelayouts_require_rebuild(self, models): +
    +[docs] +def check_pelayouts_require_rebuild(self, models): """ Create if we require a rebuild, expects cwd is caseroot """ @@ -142,7 +144,10 @@

    Source code for CIME.case.check_lockedfiles

             unlock_file("env_mach_pes.xml", self.get_value("CASEROOT"))
    -
    [docs]def check_lockedfile(self, filebase): + +
    +[docs] +def check_lockedfile(self, filebase): caseroot = self.get_value("CASEROOT") cfile = os.path.join(caseroot, filebase) @@ -211,7 +216,10 @@

    Source code for CIME.case.check_lockedfiles

                     expect(False, "'{}' diff was not handled".format(objname))
    -
    [docs]def check_lockedfiles(self, skip=None): + +
    +[docs] +def check_lockedfiles(self, skip=None): """ Check that all lockedfiles match what's in case @@ -235,6 +243,7 @@

    Source code for CIME.case.check_lockedfiles

     
             if not do_skip:
                 self.check_lockedfile(fpart)
    +
    diff --git a/versions/master/html/_modules/CIME/case/preview_namelists.html b/versions/master/html/_modules/CIME/case/preview_namelists.html index 88ce7d85992..5c973ae428c 100644 --- a/versions/master/html/_modules/CIME/case/preview_namelists.html +++ b/versions/master/html/_modules/CIME/case/preview_namelists.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.case.preview_namelists

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]def create_dirs(self): +
    +[docs] +def create_dirs(self): """ Make necessary directories for case """ @@ -137,7 +139,10 @@

    Source code for CIME.case.preview_namelists

                 fd.write(caseroot + "\n")
    -
    [docs]def create_namelists(self, component=None): + +
    +[docs] +def create_namelists(self, component=None): """ Create component namelists """ @@ -221,6 +226,7 @@

    Source code for CIME.case.preview_namelists

         if os.path.isdir(os.path.join(casebuild, atmconf)):
             for file_to_copy in glob.glob(os.path.join(casebuild, atmconf, "*chem_mech*")):
                 safe_copy(file_to_copy, docdir)
    +
    diff --git a/versions/master/html/_modules/CIME/code_checker.html b/versions/master/html/_modules/CIME/code_checker.html index dc7d0e9bbbe..16a1b682834 100644 --- a/versions/master/html/_modules/CIME/code_checker.html +++ b/versions/master/html/_modules/CIME/code_checker.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -211,7 +211,9 @@

    Source code for CIME.code_checker

     
     
     ###############################################################################
    -
    [docs]def get_all_checkable_files(): +
    +[docs] +def get_all_checkable_files(): ############################################################################### cimeroot = get_cime_root() all_git_files = run_cmd_no_fail( @@ -246,8 +248,11 @@

    Source code for CIME.code_checker

         return files_to_test
    + ############################################################################### -
    [docs]def check_code(files, num_procs=10, interactive=False): +
    +[docs] +def check_code(files, num_procs=10, interactive=False): ############################################################################### """ Check all python files in the given directory @@ -287,6 +292,7 @@

    Source code for CIME.code_checker

     
         return results
    + # pool = ThreadPool(num_procs) # results = pool.map(lambda x : _run_pylint(x, interactive), files_to_check) # pool.close() diff --git a/versions/master/html/_modules/CIME/compare_namelists.html b/versions/master/html/_modules/CIME/compare_namelists.html index 9293620759a..c0d99cd1ae5 100644 --- a/versions/master/html/_modules/CIME/compare_namelists.html +++ b/versions/master/html/_modules/CIME/compare_namelists.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -766,7 +766,9 @@

    Source code for CIME.compare_namelists

     
     
     ###############################################################################
    -
    [docs]def compare_namelist_files(gold_file, compare_file, case=None): +
    +[docs] +def compare_namelist_files(gold_file, compare_file, case=None): ############################################################################### """ Returns (is_match, comments) @@ -780,8 +782,11 @@

    Source code for CIME.compare_namelists

         return comments == "", comments
    + ############################################################################### -
    [docs]def is_namelist_file(file_path): +
    +[docs] +def is_namelist_file(file_path): ############################################################################### try: compare_namelist_files(file_path, file_path) @@ -789,6 +794,7 @@

    Source code for CIME.compare_namelists

             assert "does not appear to be a namelist file" in str(e), str(e)
             return False
         return True
    +
    diff --git a/versions/master/html/_modules/CIME/compare_test_results.html b/versions/master/html/_modules/CIME/compare_test_results.html index 845aebc635f..f0413d0378a 100644 --- a/versions/master/html/_modules/CIME/compare_test_results.html +++ b/versions/master/html/_modules/CIME/compare_test_results.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.compare_test_results

     import os, logging
     
     ###############################################################################
    -
    [docs]def append_status_cprnc_log(msg, logfile_name, test_dir): +
    +[docs] +def append_status_cprnc_log(msg, logfile_name, test_dir): ############################################################################### try: append_status(msg, logfile_name, caseroot=test_dir) @@ -102,8 +104,11 @@

    Source code for CIME.compare_test_results

             pass
    + ############################################################################### -
    [docs]def compare_namelists(case, baseline_name, baseline_root, logfile_name): +
    +[docs] +def compare_namelists(case, baseline_name, baseline_root, logfile_name): ############################################################################### log_lvl = logging.getLogger().getEffectiveLevel() logging.disable(logging.CRITICAL) @@ -117,8 +122,11 @@

    Source code for CIME.compare_test_results

         return success
    + ############################################################################### -
    [docs]def compare_history(case, baseline_name, baseline_root, log_id): +
    +[docs] +def compare_history(case, baseline_name, baseline_root, log_id): ############################################################################### real_user = case.get_value("REALUSER") with EnvironmentContext(USER=real_user): @@ -139,8 +147,11 @@

    Source code for CIME.compare_test_results

             return result, comments
    + ############################################################################### -
    [docs]def compare_test_results( +
    +[docs] +def compare_test_results( baseline_name, baseline_root, test_root, @@ -307,6 +318,7 @@

    Source code for CIME.compare_test_results

                     )
     
         return all_pass_or_skip
    +
    diff --git a/versions/master/html/_modules/CIME/config.html b/versions/master/html/_modules/CIME/config.html index d5062732d78..dee41fff7c1 100644 --- a/versions/master/html/_modules/CIME/config.html +++ b/versions/master/html/_modules/CIME/config.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,19 +95,146 @@

    Source code for CIME.config

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]class Config: +
    +[docs] +class ConfigBase: def __new__(cls): if not hasattr(cls, "_instance"): - cls._instance = super(Config, cls).__new__(cls) + cls._instance = super(ConfigBase, cls).__new__(cls) return cls._instance def __init__(self): - if getattr(self, "_loaded", False): - return - self._attribute_config = {} + @property + def loaded(self): + return getattr(self, "_loaded", False) + +
    +[docs] + @classmethod + def instance(cls): + """Access singleton. + + Explicit way to access singleton, same as calling constructor. + """ + return cls()
    + + +
    +[docs] + @classmethod + def load(cls, customize_path): + obj = cls() + + logger.debug("Searching %r for files to load", customize_path) + + customize_files = glob.glob(f"{customize_path}/**/*.py", recursive=True) + + # filter out any tests + customize_files = [ + x for x in customize_files if "tests" not in x and "conftest" not in x + ] + + customize_module_spec = importlib.machinery.ModuleSpec("cime_customize", None) + + customize_module = importlib.util.module_from_spec(customize_module_spec) + + sys.modules["CIME.customize"] = customize_module + + for x in sorted(customize_files): + obj._load_file(x, customize_module) + + setattr(obj, "_loaded", True) + + return obj
    + + + def _load_file(self, file_path, customize_module): + logger.debug("Loading file %r", file_path) + + raw_config = utils.import_from_file("raw_config", file_path) + + # filter user define variables and functions + user_defined = [x for x in dir(raw_config) if not x.endswith("__")] + + # set values on this object, will overwrite existing + for x in user_defined: + try: + value = getattr(raw_config, x) + except AttributeError: + # should never hit this + logger.fatal("Attribute %r missing on obejct", x) + + sys.exit(1) + else: + setattr(customize_module, x, value) + + self._set_attribute(x, value) + + def _set_attribute(self, name, value, desc=None): + if hasattr(self, name): + logger.debug("Overwriting %r attribute", name) + + logger.debug("Setting attribute %r with value %r", name, value) + + setattr(self, name, value) + + self._attribute_config[name] = { + "desc": desc, + "default": value, + } + +
    +[docs] + def print_rst_table(self): + max_variable = max([len(x) for x in self._attribute_config.keys()]) + max_default = max( + [len(str(x["default"])) for x in self._attribute_config.values()] + ) + max_type = max( + [len(type(x["default"]).__name__) for x in self._attribute_config.values()] + ) + max_desc = max([len(x["desc"]) for x in self._attribute_config.values()]) + + divider_row = ( + f"{'='*max_variable} {'='*max_default} {'='*max_type} {'='*max_desc}" + ) + + rows = [ + divider_row, + f"Variable{' '*(max_variable-8)} Default{' '*(max_default-7)} Type{' '*(max_type-4)} Description{' '*(max_desc-11)}", + divider_row, + ] + + for variable, value in sorted( + self._attribute_config.items(), key=lambda x: x[0] + ): + variable_fill = max_variable - len(variable) + default_fill = max_default - len(str(value["default"])) + type_fill = max_type - len(type(value["default"]).__name__) + + rows.append( + f"{variable}{' '*variable_fill} {value['default']}{' '*default_fill} {type(value['default']).__name__}{' '*type_fill} {value['desc']}" + ) + + rows.append(divider_row) + + print("\n".join(rows))
    +
    + + + +
    +[docs] +class Config(ConfigBase): + def __init__(self): + super().__init__() + + if self.loaded: + return + self._set_attribute( "additional_archive_components", ("drv", "dart"), @@ -280,111 +407,8 @@

    Source code for CIME.config

                 "mct_path",
                 "{srcroot}/libraries/mct",
                 desc="Sets the path to the mct library.",
    -        )
    -
    -
    [docs] @classmethod - def instance(cls): - """Access singleton. - - Explicit way to access singleton, same as calling constructor. - """ - return cls()
    - -
    [docs] @classmethod - def load(cls, customize_path): - obj = cls() - - logger.debug("Searching %r for files to load", customize_path) - - customize_files = glob.glob(f"{customize_path}/**/*.py", recursive=True) - - # filter out any tests - customize_files = [ - x for x in customize_files if "tests" not in x and "conftest" not in x - ] - - customize_module_spec = importlib.machinery.ModuleSpec("cime_customize", None) - - customize_module = importlib.util.module_from_spec(customize_module_spec) - - sys.modules["CIME.customize"] = customize_module - - for x in sorted(customize_files): - obj._load_file(x, customize_module) - - setattr(obj, "_loaded", True) - - return obj
    - - def _load_file(self, file_path, customize_module): - logger.debug("Loading file %r", file_path) - - raw_config = utils.import_from_file("raw_config", file_path) - - # filter user define variables and functions - user_defined = [x for x in dir(raw_config) if not x.endswith("__")] - - # set values on this object, will overwrite existing - for x in user_defined: - try: - value = getattr(raw_config, x) - except AttributeError: - # should never hit this - logger.fatal("Attribute %r missing on obejct", x) - - sys.exit(1) - else: - setattr(customize_module, x, value) - - self._set_attribute(x, value) - - def _set_attribute(self, name, value, desc=None): - if hasattr(self, name): - logger.debug("Overwriting %r attribute", name) - - logger.debug("Setting attribute %r with value %r", name, value) - - setattr(self, name, value) - - self._attribute_config[name] = { - "desc": desc, - "default": value, - } - -
    [docs] def print_rst_table(self): - max_variable = max([len(x) for x in self._attribute_config.keys()]) - max_default = max( - [len(str(x["default"])) for x in self._attribute_config.values()] - ) - max_type = max( - [len(type(x["default"]).__name__) for x in self._attribute_config.values()] - ) - max_desc = max([len(x["desc"]) for x in self._attribute_config.values()]) - - divider_row = ( - f"{'='*max_variable} {'='*max_default} {'='*max_type} {'='*max_desc}" - ) - - rows = [ - divider_row, - f"Variable{' '*(max_variable-8)} Default{' '*(max_default-7)} Type{' '*(max_type-4)} Description{' '*(max_desc-11)}", - divider_row, - ] - - for variable, value in sorted( - self._attribute_config.items(), key=lambda x: x[0] - ): - variable_fill = max_variable - len(variable) - default_fill = max_default - len(str(value["default"])) - type_fill = max_type - len(type(value["default"]).__name__) - - rows.append( - f"{variable}{' '*variable_fill} {value['default']}{' '*default_fill} {type(value['default']).__name__}{' '*type_fill} {value['desc']}" - ) - - rows.append(divider_row) + )
    - print("\n".join(rows))
    diff --git a/versions/master/html/_modules/CIME/cs_status.html b/versions/master/html/_modules/CIME/cs_status.html index 47e690ba234..882564dc6a6 100644 --- a/versions/master/html/_modules/CIME/cs_status.html +++ b/versions/master/html/_modules/CIME/cs_status.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,7 +98,9 @@

    Source code for CIME.cs_status

     from collections import defaultdict
     
     
    -
    [docs]def cs_status( +
    +[docs] +def cs_status( test_paths, summary=False, fails_only=False, @@ -190,6 +192,7 @@

    Source code for CIME.cs_status

                 print("{} non-passes: {}".format(phase, non_pass_counts[phase]), file=out)
    + def _get_xfails(expected_fails_filepath): """Returns a dictionary of ExpectedFails objects, where the keys are test names diff --git a/versions/master/html/_modules/CIME/cs_status_creator.html b/versions/master/html/_modules/CIME/cs_status_creator.html index 99f5f76bf0d..cb82ae0663e 100644 --- a/versions/master/html/_modules/CIME/cs_status_creator.html +++ b/versions/master/html/_modules/CIME/cs_status_creator.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.cs_status_creator

     import stat
     
     
    -
    [docs]def create_cs_status(test_root, test_id, extra_args="", filename=None): +
    +[docs] +def create_cs_status(test_root, test_id, extra_args="", filename=None): """Create a test suite-specific cs.status file from the template Arguments: @@ -132,6 +134,7 @@

    Source code for CIME.cs_status_creator

         os.chmod(
             cs_status_file, os.stat(cs_status_file).st_mode | stat.S_IXUSR | stat.S_IXGRP
         )
    +
    diff --git a/versions/master/html/_modules/CIME/date.html b/versions/master/html/_modules/CIME/date.html index 76b991aef5e..613945556b5 100644 --- a/versions/master/html/_modules/CIME/date.html +++ b/versions/master/html/_modules/CIME/date.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -89,7 +89,9 @@

    Source code for CIME.date

     
     logger = logging.getLogger(__name__)
     ###############################################################################
    -
    [docs]def get_file_date(filename): +
    +[docs] +def get_file_date(filename): ############################################################################### """ Returns the date associated with the filename as a date object representing the correct date @@ -155,7 +157,10 @@

    Source code for CIME.date

         return None
    -
    [docs]class date: + +
    +[docs] +class date: """ Simple struct for holding dates and the time of day and performing comparisons @@ -268,13 +273,18 @@

    Source code for CIME.date

         False
         """
     
    -
    [docs] @staticmethod +
    +[docs] + @staticmethod def hms_to_second(hour, minute, second): _SECONDS_PER_HOUR = 3600 _SECONDS_PER_MINUTE = 60 return hour * _SECONDS_PER_HOUR + minute * _SECONDS_PER_MINUTE + second
    -
    [docs] @staticmethod + +
    +[docs] + @staticmethod def second_to_hms(second): _SECONDS_PER_HOUR = 3600 _SECONDS_PER_MINUTE = 60 @@ -284,6 +294,7 @@

    Source code for CIME.date

                 "second": second % _SECONDS_PER_MINUTE,
             }
    + def __init__(self, year=1, month=1, day=1, hour=0, minute=0, second=0): self._year = year self._month = month @@ -305,27 +316,48 @@

    Source code for CIME.date

                 second=self.second(),
             )
     
    -
    [docs] def year(self): +
    +[docs] + def year(self): return self._year
    -
    [docs] def month(self): + +
    +[docs] + def month(self): return self._month
    -
    [docs] def day(self): + +
    +[docs] + def day(self): return self._day
    -
    [docs] def hour(self): + +
    +[docs] + def hour(self): return self.second_to_hms(self._second)["hour"]
    -
    [docs] def minute(self): + +
    +[docs] + def minute(self): return self.second_to_hms(self._second)["minute"]
    -
    [docs] def second(self): + +
    +[docs] + def second(self): return self.second_to_hms(self._second)["second"]
    -
    [docs] def second_of_day(self): + +
    +[docs] + def second_of_day(self): return self._second
    + def __repr__(self): return str(self) @@ -370,6 +402,7 @@

    Source code for CIME.date

     
         def __gt__(self, other):
             return not (self <= other)
    +
    diff --git a/versions/master/html/_modules/CIME/expected_fails.html b/versions/master/html/_modules/CIME/expected_fails.html index 7209ecf0d21..77ccf726f48 100644 --- a/versions/master/html/_modules/CIME/expected_fails.html +++ b/versions/master/html/_modules/CIME/expected_fails.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -94,7 +94,9 @@

    Source code for CIME.expected_fails

     UNEXPECTED_FAILURE_COMMENT_START = "(UNEXPECTED"  # There will be some additional text after this, before the end parentheses
     
     
    -
    [docs]class ExpectedFails(object): +
    +[docs] +class ExpectedFails(object): def __init__(self): """Initialize an empty ExpectedFails object""" self._fails = {} @@ -110,14 +112,19 @@

    Source code for CIME.expected_fails

         def __repr__(self):
             return repr(self._fails)
     
    -
    [docs] def add_failure(self, phase, expected_status): +
    +[docs] + def add_failure(self, phase, expected_status): """Add an expected failure to the list""" expect( phase not in self._fails, "Phase {} already present in list".format(phase) ) self._fails[phase] = expected_status
    -
    [docs] def expected_fails_comment(self, phase, status): + +
    +[docs] + def expected_fails_comment(self, phase, status): """Returns a string giving the expected fails comment for this phase and status""" if phase not in self._fails: return "" @@ -127,7 +134,9 @@

    Source code for CIME.expected_fails

             else:
                 return "{}: expected {})".format(
                     UNEXPECTED_FAILURE_COMMENT_START, self._fails[phase]
    -            )
    + )
    +
    +
    diff --git a/versions/master/html/_modules/CIME/get_tests.html b/versions/master/html/_modules/CIME/get_tests.html index 510088349f9..74c91a22b0f 100644 --- a/versions/master/html/_modules/CIME/get_tests.html +++ b/versions/master/html/_modules/CIME/get_tests.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -109,6 +109,7 @@

    Source code for CIME.get_tests

     #     "inherit" : (suite1, suite2, ...), # Optional. Suites to inherit tests from. Default is None. Tuple, list, or str.
     #     "time"    : "HH:MM:SS",            # Optional. Recommended upper-limit on test time.
     #     "share"   : True|False,            # Optional. If True, all tests in this suite share a build. Default is False.
    +#     "perf"    : True|False,            # Optional. If True, all tests in this suite will do performance tracking. Default is False.
     #     "tests"   : (test1, test2, ...)    # Optional. The list of tests for this suite. See above for format. Tuple, list, or str. This is the ONLY inheritable attribute.
     # }
     
    @@ -175,6 +176,16 @@ 

    Source code for CIME.get_tests

                 "SMS_P16.f19_g16_rx1.X",
             ),
         },
    +    "cime_test_perf": {
    +        "time": "0:10:00",
    +        "perf": True,
    +        "tests": (
    +            "SMS_P2.T42_T42.S",
    +            "SMS_P4.T42_T42.S",
    +            "SMS_P8.T42_T42.S",
    +            "SMS_P16.T42_T42.S",
    +        ),
    +    },
         "cime_test_repeat": {
             "tests": (
                 "TESTRUNPASS_P1.f19_g16_rx1.A",
    @@ -201,7 +212,6 @@ 

    Source code for CIME.get_tests

                 "ERR_Ln9.f45_g37_rx1.A",
                 "ERP_Ln9.f45_g37_rx1.A",
                 "SMS_D_Ln9_Mmpi-serial.f19_g16_rx1.A",
    -            "DAE.ww3a.ADWAV",
                 "PET_Ln9_P4.f19_f19.A",
                 "PEM_Ln9_P4.f19_f19.A",
                 "SMS_Ln3.T42_T42.S",
    @@ -243,15 +253,17 @@ 

    Source code for CIME.get_tests

     
     
     ###############################################################################
    -
    [docs]def get_test_data(suite): +
    +[docs] +def get_test_data(suite): ############################################################################### """ - For a given suite, returns (inherit, time, share, tests) + For a given suite, returns (inherit, time, share, perf, tests) """ raw_dict = _ALL_TESTS[suite] for key in raw_dict.keys(): expect( - key in ["inherit", "time", "share", "tests"], + key in ["inherit", "time", "share", "perf", "tests"], "Unexpected test key '{}'".format(key), ) @@ -259,18 +271,25 @@

    Source code for CIME.get_tests

             _get_key_data(raw_dict, "inherit", tuple),
             _get_key_data(raw_dict, "time", str),
             _get_key_data(raw_dict, "share", bool),
    +        _get_key_data(raw_dict, "perf", bool),
             _get_key_data(raw_dict, "tests", tuple),
         )
    + ############################################################################### -
    [docs]def get_test_suites(): +
    +[docs] +def get_test_suites(): ############################################################################### return list(_ALL_TESTS.keys())
    + ############################################################################### -
    [docs]def get_test_suite( +
    +[docs] +def get_test_suite( suite, machine=None, compiler=None, skip_inherit=False, skip_tests=None ): ############################################################################### @@ -288,7 +307,7 @@

    Source code for CIME.get_tests

             "Compiler {} not valid for machine {}".format(compiler, machine),
         )
     
    -    inherits_from, _, _, tests_raw = get_test_data(suite)
    +    inherits_from, _, _, _, tests_raw = get_test_data(suite)
         tests = []
         for item in tests_raw:
             expect(
    @@ -326,8 +345,11 @@ 

    Source code for CIME.get_tests

         return tests
    + ############################################################################### -
    [docs]def suite_has_test(suite, test_full_name, skip_inherit=False): +
    +[docs] +def suite_has_test(suite, test_full_name, skip_inherit=False): ############################################################################### _, _, _, _, machine, compiler, _ = CIME.utils.parse_test_name(test_full_name) expect(machine is not None, "{} is not a full test name".format(test_full_name)) @@ -338,8 +360,11 @@

    Source code for CIME.get_tests

         return test_full_name in tests
    + ############################################################################### -
    [docs]def get_build_groups(tests): +
    +[docs] +def get_build_groups(tests): ############################################################################### """ Given a list of tests, return a list of lists, with each list representing @@ -385,8 +410,40 @@

    Source code for CIME.get_tests

         return [tuple(item[0]) for item in build_groups]
    + +############################################################################### +
    +[docs] +def is_perf_test(test): + ############################################################################### + """ + Is the provided test in a suite with perf=True? + + >>> is_perf_test("SMS_P2.T42_T42.S.melvin_gnu") + True + >>> is_perf_test("SMS_P2.f19_g16_rx1.X.melvin_gnu") + False + >>> is_perf_test("PFS_P2.f19_g16_rx1.X.melvin_gnu") + True + """ + # Get a list of performance suites + if test.startswith("PFS"): + return True + else: + suites = get_test_suites() + for suite in suites: + perf = get_test_data(suite)[3] + if perf and suite_has_test(suite, test, skip_inherit=True): + return True + + return False
    + + + ############################################################################### -
    [docs]def infer_arch_from_tests(testargs): +
    +[docs] +def infer_arch_from_tests(testargs): ############################################################################### """ Return a tuple (machine, [compilers]) that can be inferred from the test args @@ -438,8 +495,11 @@

    Source code for CIME.get_tests

         return machine, compilers
    + ############################################################################### -
    [docs]def get_full_test_names(testargs, machine, compiler): +
    +[docs] +def get_full_test_names(testargs, machine, compiler): ############################################################################### """ Return full test names in the form: @@ -503,8 +563,11 @@

    Source code for CIME.get_tests

         return list(sorted(tests_to_run))
    + ############################################################################### -
    diff --git a/versions/master/html/_modules/CIME/get_timing.html b/versions/master/html/_modules/CIME/get_timing.html index 46dcc3da2ef..38f66919d31 100644 --- a/versions/master/html/_modules/CIME/get_timing.html +++ b/versions/master/html/_modules/CIME/get_timing.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -1011,9 +1011,12 @@

    Source code for CIME.get_timing

             self.fout.close()
     
     
    -
    [docs]def get_timing(case, lid): +
    +[docs] +def get_timing(case, lid): parser = _TimingParser(case, lid) parser.getTiming()
    +
    diff --git a/versions/master/html/_modules/CIME/hist_utils.html b/versions/master/html/_modules/CIME/hist_utils.html index a6d748fcf83..49003e57cdf 100644 --- a/versions/master/html/_modules/CIME/hist_utils.html +++ b/versions/master/html/_modules/CIME/hist_utils.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -138,7 +138,9 @@

    Source code for CIME.hist_utils

             yield model
     
     
    -
    [docs]def copy_histfiles(case, suffix, match_suffix=None): +
    +[docs] +def copy_histfiles(case, suffix, match_suffix=None): """Copy the most recent batch of hist files in a case, adding the given suffix. This can allow you to temporarily "save" these files so they won't be blown @@ -158,6 +160,10 @@

    Source code for CIME.hist_utils

         num_copied = 0
         for model in _iter_model_file_substrs(case):
             if case.get_value("TEST") and archive.exclude_testing(model):
    +            logger.info(
    +                "Case is a test and component %r is excluded from comparison", model
    +            )
    +
                 continue
             comments += "  Copying hist files for model '{}'\n".format(model)
             test_hists = archive.get_latest_hist_files(
    @@ -197,7 +203,10 @@ 

    Source code for CIME.hist_utils

         return comments, num_copied
    -
    [docs]def rename_all_hist_files(case, suffix): + +
    +[docs] +def rename_all_hist_files(case, suffix): """Renaming all hist files in a case, adding the given suffix. case - The case containing the files you want to save @@ -238,6 +247,7 @@

    Source code for CIME.hist_utils

         return comments
    + def _hists_match(model, hists1, hists2, suffix1="", suffix2=""): """ return (num in set 1 but not 2 , num in set 2 but not 1, matchups) @@ -375,6 +385,12 @@

    Source code for CIME.hist_utils

         archive = case.get_env("archive")
         ref_case = case.get_value("RUN_REFCASE")
         for model in _iter_model_file_substrs(case):
    +        if case.get_value("TEST") and archive.exclude_testing(model):
    +            logger.info(
    +                "Case is a test and component %r is excluded from comparison", model
    +            )
    +
    +            continue
             if model == "cpl" and suffix2 == "multiinst":
                 multiinst_driver_compare = True
             comments += "  comparing model '{}'\n".format(model)
    @@ -468,7 +484,9 @@ 

    Source code for CIME.hist_utils

         return all_success, comments, num_compared
     
     
    -
    [docs]def compare_test(case, suffix1, suffix2, ignore_fieldlist_diffs=False): +
    +[docs] +def compare_test(case, suffix1, suffix2, ignore_fieldlist_diffs=False): """ Compares two sets of component history files in the testcase directory @@ -494,7 +512,10 @@

    Source code for CIME.hist_utils

         )
    -
    [docs]def cprnc( + +
    +[docs] +def cprnc( model, file1, file2, @@ -601,7 +622,10 @@

    Source code for CIME.hist_utils

         return (files_match, output_filename, comment)
    -
    [docs]def compare_baseline(case, baseline_dir=None, outfile_suffix=""): + +
    +[docs] +def compare_baseline(case, baseline_dir=None, outfile_suffix=""): """ compare the current test output to a baseline result @@ -642,7 +666,10 @@

    Source code for CIME.hist_utils

         return success, comments
    -
    [docs]def generate_teststatus(testdir, baseline_dir): + +
    +[docs] +def generate_teststatus(testdir, baseline_dir): """ CESM stores it's TestStatus file in baselines. Do not let exceptions escape from this function. @@ -665,6 +692,7 @@

    Source code for CIME.hist_utils

             )
    + def _generate_baseline_impl(case, baseline_dir=None, allow_baseline_overwrite=False): """ copy the current test output to baseline result @@ -769,7 +797,9 @@

    Source code for CIME.hist_utils

         return True, comments
     
     
    -
    [docs]def generate_baseline(case, baseline_dir=None, allow_baseline_overwrite=False): +
    +[docs] +def generate_baseline(case, baseline_dir=None, allow_baseline_overwrite=False): with SharedArea(): return _generate_baseline_impl( case, @@ -778,7 +808,10 @@

    Source code for CIME.hist_utils

             )
    -
    [docs]def get_ts_synopsis(comments): + +
    +[docs] +def get_ts_synopsis(comments): r""" Reduce case diff comments down to a single line synopsis so that we can put something in the TestStatus file. It's expected that the comments provided @@ -845,6 +878,7 @@

    Source code for CIME.hist_utils

                     )
                 else:
                     return ""
    +
    diff --git a/versions/master/html/_modules/CIME/jenkins_generic_job.html b/versions/master/html/_modules/CIME/jenkins_generic_job.html index fa043a4fcbe..552e637ff04 100644 --- a/versions/master/html/_modules/CIME/jenkins_generic_job.html +++ b/versions/master/html/_modules/CIME/jenkins_generic_job.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -91,7 +91,9 @@

    Source code for CIME.jenkins_generic_job

     import os, shutil, glob, signal, logging, threading, sys, re, tarfile, time
     
     ##############################################################################
    -
    [docs]def cleanup_queue(test_root, test_id): +
    +[docs] +def cleanup_queue(test_root, test_id): ############################################################################### """ Delete all jobs left in the queue @@ -112,8 +114,11 @@

    Source code for CIME.jenkins_generic_job

                 case.cancel_batch_jobs(jobkills)
    + ############################################################################### -
    [docs]def delete_old_test_data( +
    +[docs] +def delete_old_test_data( mach_comp, test_id_root, scratch_root, @@ -144,8 +149,11 @@

    Source code for CIME.jenkins_generic_job

                     )
    + ############################################################################### -
    [docs]def scan_for_test_ids(old_test_archive, mach_comp, test_id_root): +
    +[docs] +def scan_for_test_ids(old_test_archive, mach_comp, test_id_root): ############################################################################### results = set([]) test_id_re = re.compile(".+[.]([^.]+)") @@ -161,8 +169,11 @@

    Source code for CIME.jenkins_generic_job

         return list(results)
    + ############################################################################### -
    [docs]def archive_old_test_data( +
    +[docs] +def archive_old_test_data( machine, mach_comp, test_id_root, @@ -298,8 +309,11 @@

    Source code for CIME.jenkins_generic_job

             )
    + ############################################################################### -
    [docs]def handle_old_test_data( +
    +[docs] +def handle_old_test_data( machine, compiler, test_id_root, scratch_root, test_root, avoid_test_id ): ############################################################################### @@ -343,8 +357,11 @@

    Source code for CIME.jenkins_generic_job

             )
    + ############################################################################### -
    [docs]def jenkins_generic_job( +
    +[docs] +def jenkins_generic_job( generate_baselines, submit_to_cdash, no_batch, @@ -520,6 +537,7 @@

    Source code for CIME.jenkins_generic_job

             cleanup_queue(test_root, test_id)
     
         return tests_passed
    +
    diff --git a/versions/master/html/_modules/CIME/locked_files.html b/versions/master/html/_modules/CIME/locked_files.html index d7591a117ad..084f1baab36 100644 --- a/versions/master/html/_modules/CIME/locked_files.html +++ b/versions/master/html/_modules/CIME/locked_files.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -93,7 +93,9 @@

    Source code for CIME.locked_files

     LOCKED_DIR = "LockedFiles"
     
     
    -
    [docs]def lock_file(filename, caseroot=None, newname=None): +
    +[docs] +def lock_file(filename, caseroot=None, newname=None): expect("/" not in filename, "Please just provide basename of locked file") caseroot = os.getcwd() if caseroot is None else caseroot newname = filename if newname is None else newname @@ -112,7 +114,10 @@

    Source code for CIME.locked_files

         GenericXML.invalidate(os.path.join(fulllockdir, newname))
    -
    [docs]def unlock_file(filename, caseroot=None): + +
    +[docs] +def unlock_file(filename, caseroot=None): expect("/" not in filename, "Please just provide basename of locked file") caseroot = os.getcwd() if caseroot is None else caseroot locked_path = os.path.join(caseroot, LOCKED_DIR, filename) @@ -122,10 +127,14 @@

    Source code for CIME.locked_files

         logging.debug("Unlocking file {}".format(filename))
    -
    [docs]def is_locked(filename, caseroot=None): + +
    +[docs] +def is_locked(filename, caseroot=None): expect("/" not in filename, "Please just provide basename of locked file") caseroot = os.getcwd() if caseroot is None else caseroot return os.path.exists(os.path.join(caseroot, LOCKED_DIR, filename))
    +
    diff --git a/versions/master/html/_modules/CIME/namelist.html b/versions/master/html/_modules/CIME/namelist.html index a16304389c6..4d008accfeb 100644 --- a/versions/master/html/_modules/CIME/namelist.html +++ b/versions/master/html/_modules/CIME/namelist.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -242,7 +242,9 @@

    Source code for CIME.namelist

     FORTRAN_REPEAT_PREFIX_REGEX = re.compile(r"^[0-9]*[1-9]+[0-9]*\*")
     
     
    -
    [docs]def is_valid_fortran_name(string): +
    +[docs] +def is_valid_fortran_name(string): """Check that a variable name is allowed in Fortran. The rules are: @@ -287,7 +289,10 @@

    Source code for CIME.namelist

         return FORTRAN_NAME_REGEX.search(string) is not None
    -
    [docs]def get_fortran_name_only(full_var): + +
    +[docs] +def get_fortran_name_only(full_var): """remove array section if any and return only the variable name >>> get_fortran_name_only('foo') 'foo' @@ -308,7 +313,10 @@

    Source code for CIME.namelist

         return m.group(1)
    -
    [docs]def get_fortran_variable_indices(varname, varlen=1, allow_any_len=False): + +
    +[docs] +def get_fortran_variable_indices(varname, varlen=1, allow_any_len=False): """get indices from a fortran namelist variable as a triplet of minindex, maxindex and step >>> get_fortran_variable_indices('foo(3)') @@ -346,7 +354,10 @@

    Source code for CIME.namelist

         return (minindex, maxindex, step)
    -
    [docs]def fortran_namelist_base_value(string): + +
    +[docs] +def fortran_namelist_base_value(string): r"""Strip off whitespace and repetition syntax from a namelist value. >>> fortran_namelist_base_value("") @@ -370,7 +381,10 @@

    Source code for CIME.namelist

         return string
    -
    [docs]def character_literal_to_string(literal): + +
    +[docs] +def character_literal_to_string(literal): """Convert a Fortran character literal to a Python string. This function assumes (without checking) that `literal` is a valid literal. @@ -397,7 +411,10 @@

    Source code for CIME.namelist

         return new_literal.replace(delimiter * 2, delimiter)
    -
    [docs]def string_to_character_literal(string): + +
    +[docs] +def string_to_character_literal(string): r"""Convert a Python string to a Fortran character literal. This function always uses double quotes (") as the delimiter. @@ -413,7 +430,10 @@

    Source code for CIME.namelist

         return '"' + string + '"'
    -
    [docs]def is_valid_fortran_namelist_literal(type_, string): + +
    +[docs] +def is_valid_fortran_namelist_literal(type_, string): r"""Determine whether a literal is valid in a Fortran namelist. Note that kind parameters are *not* allowed in namelists, which simplifies @@ -680,7 +700,10 @@

    Source code for CIME.namelist

         return FORTRAN_LITERAL_REGEXES[type_].search(string) is not None
    -
    [docs]def literal_to_python_value(literal, type_=None): + +
    +[docs] +def literal_to_python_value(literal, type_=None): r"""Convert a Fortran literal string to a Python value. This function assumes that the input contains a single value, i.e. @@ -782,7 +805,10 @@

    Source code for CIME.namelist

             return float(literal)
    -
    [docs]def expand_literal_list(literals): + +
    +[docs] +def expand_literal_list(literals): """Expands a list of literal values to get rid of repetition syntax. >>> expand_literal_list([]) @@ -805,7 +831,10 @@

    Source code for CIME.namelist

         return expanded
    -
    [docs]def compress_literal_list(literals): + +
    +[docs] +def compress_literal_list(literals): """Uses repetition syntax to shorten a literal list. >>> compress_literal_list([]) @@ -856,7 +885,10 @@

    Source code for CIME.namelist

             return compressed
    -
    [docs]def merge_literal_lists(default, overwrite): + +
    +[docs] +def merge_literal_lists(default, overwrite): """Merge two lists of literal value strings. The `overwrite` values have higher precedence, so will overwrite the @@ -899,7 +931,10 @@

    Source code for CIME.namelist

         return compress_literal_list(merged)
    -
    [docs]def parse(in_file=None, text=None, groupless=False, convert_tab_to_space=True): + +
    +[docs] +def parse(in_file=None, text=None, groupless=False, convert_tab_to_space=True): """Parse a Fortran namelist. The `in_file` argument must be either a `str` or `unicode` object containing @@ -961,7 +996,10 @@

    Source code for CIME.namelist

             return Namelist(namelist_dict)
    -
    [docs]def shouldRaise(eclass, method, *args, **kw): + +
    +[docs] +def shouldRaise(eclass, method, *args, **kw): """ A helper function to make doctests py3 compatible http://python3porting.com/problems.html#running-doctests @@ -976,7 +1014,10 @@

    Source code for CIME.namelist

         raise Exception("Expected exception %s not raised" % str(eclass))
    -
    [docs]class Namelist(object): + +
    +[docs] +class Namelist(object): """Class representing a Fortran namelist. @@ -1012,10 +1053,15 @@

    Source code for CIME.namelist

                             variable_name
                         ]
     
    -
    [docs] def clean_groups(self): +
    +[docs] + def clean_groups(self): self._groups = collections.OrderedDict()
    -
    [docs] def get_group_names(self): + +
    +[docs] + def get_group_names(self): """Return a list of all groups in the namelist. >>> Namelist().get_group_names() @@ -1025,7 +1071,10 @@

    Source code for CIME.namelist

             """
             return list(self._groups.keys())
    -
    [docs] def get_variable_names(self, group_name): + +
    +[docs] + def get_variable_names(self, group_name): """Return a list of all variables in the given namelist group. If the specified group is not in the namelist, returns an empty list. @@ -1047,7 +1096,10 @@

    Source code for CIME.namelist

                 return []
             return list(self._groups[gn].keys())
    -
    [docs] def get_variable_value(self, group_name, variable_name): + +
    +[docs] + def get_variable_value(self, group_name, variable_name): """Return the value of the specified variable. This function always returns a non-empty list containing strings. If the @@ -1070,7 +1122,10 @@

    Source code for CIME.namelist

                     return self._groups[gn][vn][:]
             return [""]
    -
    [docs] def get_value(self, variable_name): + +
    +[docs] + def get_value(self, variable_name): """Return the value of a uniquely-named variable. This function is similar to `get_variable_value`, except that it does @@ -1105,7 +1160,10 @@

    Source code for CIME.namelist

             else:
                 return [""]
    -
    [docs] def set_variable_value(self, group_name, variable_name, value, var_size=1): + +
    +[docs] + def set_variable_value(self, group_name, variable_name, value, var_size=1): """Set the value of the specified variable. >>> x = parse(text='&foo bar=1 /') @@ -1163,7 +1221,10 @@

    Source code for CIME.namelist

                 if len(value) == 0:
                     break
    -
    [docs] def delete_variable(self, group_name, variable_name): + +
    +[docs] + def delete_variable(self, group_name, variable_name): """Delete a variable from a specified group. If the specified group or variable does not exist, this is a no-op. @@ -1183,7 +1244,10 @@

    Source code for CIME.namelist

                 if vn:
                     del self._groups[gn][vn]
    -
    [docs] def merge_nl(self, other, overwrite=False): + +
    +[docs] + def merge_nl(self, other, overwrite=False): """Merge this namelist object with another. Values in the invoking (`self`) `Namelist` will take precedence over @@ -1245,7 +1309,10 @@

    Source code for CIME.namelist

                         group_name, variable_name, merged_val, var_size=len(merged_val)
                     )
    -
    [docs] def get_group_variables(self, group_name): + +
    +[docs] + def get_group_variables(self, group_name): group_variables = {} group = self._groups[group_name] for name in sorted(group.keys()): @@ -1253,7 +1320,10 @@

    Source code for CIME.namelist

                 group_variables[name] = value
             return group_variables
    -
    [docs] def write( + +
    +[docs] + def write( self, out_file, groups=None, append=False, format_="nml", sorted_groups=True ): @@ -1284,6 +1354,7 @@

    Source code for CIME.namelist

                 logger.debug("Writing namelist to file object")
                 self._write(out_file, groups, format_, sorted_groups=sorted_groups)
    + def _write(self, out_file, groups, format_, sorted_groups): """Unwrapped version of `write` assuming that a file object is input.""" if groups is None: @@ -1338,7 +1409,9 @@

    Source code for CIME.namelist

                 if format_ == "nmlcontents":
                     out_file.write("\n")
     
    -
    [docs] def write_nuopc(self, out_file, groups=None, sorted_groups=True): +
    +[docs] + def write_nuopc(self, out_file, groups=None, sorted_groups=True): """Write a nuopc config file out_file As with `parse`, the `out_file` argument can be either a file name, or a @@ -1354,6 +1427,7 @@

    Source code for CIME.namelist

                 logger.debug("Writing nuopc config data to file object")
                 self._write_nuopc(out_file, groups, sorted_groups=sorted_groups)
    + def _write_nuopc(self, out_file, groups, sorted_groups): """Unwrapped version of `write` assuming that a file object is input.""" if groups is None: @@ -1422,6 +1496,7 @@

    Source code for CIME.namelist

                 indent = False
    + class _NamelistEOF(Exception): """Exception thrown for an unexpected end-of-file in a namelist. diff --git a/versions/master/html/_modules/CIME/nmlgen.html b/versions/master/html/_modules/CIME/nmlgen.html index 0c6e46d4120..404a98fce2e 100644 --- a/versions/master/html/_modules/CIME/nmlgen.html +++ b/versions/master/html/_modules/CIME/nmlgen.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -151,7 +151,9 @@

    Source code for CIME.nmlgen

     """
     
     
    -
    [docs]class NamelistGenerator(object): +
    +[docs] +class NamelistGenerator(object): """Utility class for generating namelists for a given component.""" @@ -195,7 +197,9 @@

    Source code for CIME.nmlgen

         def __exit__(self, *_):
             return False
     
    -
    [docs] def init_defaults( +
    +[docs] + def init_defaults( self, infiles, config, @@ -255,11 +259,17 @@

    Source code for CIME.nmlgen

     
             return [self._definition.get(entry, "id") for entry in self._default_nodes]
    -
    [docs] def rename_group(self, group, newgroup): + +
    +[docs] + def rename_group(self, group, newgroup): """Pass through to namelist definition""" return self._definition.rename_group(group, newgroup)
    -
    [docs] def add_defaults_for_group(self, group): + +
    +[docs] + def add_defaults_for_group(self, group): """Call add_default for namelist variables in the given group This still skips variables that have attributes of skip_default_entry or @@ -273,7 +283,10 @@

    Source code for CIME.nmlgen

                 if group_name == group:
                     self.add_default(self._definition.get(entry, "id"))
    -
    [docs] def confirm_group_is_empty(self, group_name, errmsg): + +
    +[docs] + def confirm_group_is_empty(self, group_name, errmsg): """Confirms that no values have been added to the given group If any values HAVE been added to this group, aborts with the given error message. @@ -294,7 +307,10 @@

    Source code for CIME.nmlgen

             fullmsg = "{}\nOffending variables: {}".format(errmsg, variables_in_group)
             expect(len(variables_in_group) == 0, fullmsg)
    -
    [docs] @staticmethod + +
    +[docs] + @staticmethod def quote_string(string): """Convert a string to a quoted Fortran literal. @@ -304,6 +320,7 @@

    Source code for CIME.nmlgen

                 string = string_to_character_literal(string)
             return string
    + def _to_python_value(self, name, literals): """Transform a literal list as needed for `get_value`.""" ( @@ -350,7 +367,9 @@

    Source code for CIME.nmlgen

     
             return compress_literal_list(values)
     
    -
    [docs] def get_value(self, name): +
    +[docs] + def get_value(self, name): """Get the current value of a given namelist variable. Note that the return value of this function is always a string or a list @@ -370,7 +389,10 @@

    Source code for CIME.nmlgen

             """
             return self._to_python_value(name, self._namelist.get_value(name))
    -
    [docs] def set_value(self, name, value): + +
    +[docs] + def set_value(self, name, value): """Set the current value of a given namelist variable. Usually, you should use `add_default` instead of this function. @@ -397,7 +419,10 @@

    Source code for CIME.nmlgen

             if len(literals) > 0 and literals[0] is not None:
                 self._namelist.set_variable_value(var_group, name, literals, var_size)
    -
    [docs] def get_default(self, name, config=None, allow_none=False): + +
    +[docs] + def get_default(self, name, config=None, allow_none=False): """Get the value of a variable from the namelist definition file. The `config` argument is passed through to the underlying @@ -472,20 +497,30 @@

    Source code for CIME.nmlgen

     
             return default
    -
    [docs] def get_streams(self): + +
    +[docs] + def get_streams(self): """Get a list of all streams used for the current data model mode.""" return self.get_default("streamslist")
    -
    [docs] def clean_streams(self): + +
    +[docs] + def clean_streams(self): for variable in self._streams_variables: self._streams_namelists[variable] = [] self._streams_namelists["streams"] = []
    -
    [docs] def new_instance(self): + +
    +[docs] + def new_instance(self): """Clean the object just enough to introduce a new instance""" self.clean_streams() self._namelist.clean_groups()
    + def _sub_fields(self, varnames): """Substitute indicators with given values in a list of fields. @@ -612,7 +647,9 @@

    Source code for CIME.nmlgen

                 list_to_deliminate[n] = pred + list_to_deliminate[n].strip() + postd
             return "\n      ".join(list_to_deliminate)
     
    -
    [docs] def create_stream_file_and_update_shr_strdata_nml( +
    +[docs] + def create_stream_file_and_update_shr_strdata_nml( self, config, caseroot, # pylint:disable=too-many-locals @@ -712,7 +749,10 @@

    Source code for CIME.nmlgen

                         input_data_list.write(string)
             self.update_shr_strdata_nml(config, stream, stream_path)
    -
    [docs] def update_shr_strdata_nml(self, config, stream, stream_path): + +
    +[docs] + def update_shr_strdata_nml(self, config, stream, stream_path): """Updates values for the `shr_strdata_nml` namelist group. This should be done once per stream, and it shouldn't usually be called @@ -748,7 +788,10 @@

    Source code for CIME.nmlgen

                 )
                 self._streams_namelists[variable].append(default[0])
    -
    [docs] def set_abs_file_path(self, file_path): + +
    +[docs] + def set_abs_file_path(self, file_path): """If `file_path` is relative, make it absolute using `DIN_LOC_ROOT`. If an absolute path is input, it is returned unchanged. @@ -759,7 +802,10 @@

    Source code for CIME.nmlgen

                 fullpath = os.path.join(self._din_loc_root, file_path)
                 return fullpath
    -
    [docs] def add_default(self, name, value=None, ignore_abs_path=None): + +
    +[docs] + def add_default(self, name, value=None, ignore_abs_path=None): """Add a value for the specified variable to the namelist. If the specified variable is already defined in the object, the existing @@ -819,6 +865,7 @@

    Source code for CIME.nmlgen

             # Set the new value.
             self._namelist.set_variable_value(group, name, current_literals, var_size)
    + def _convert_to_abs_file_path(self, file_path, name): """Convert the given file_path to an abs file path and return the result @@ -855,7 +902,9 @@

    Source code for CIME.nmlgen

     
             return GRID_SEP.join(abs_file_paths)
     
    -
    [docs] def create_shr_strdata_nml(self): +
    +[docs] + def create_shr_strdata_nml(self): """Set defaults for `shr_strdata_nml` variables other than the variable domainfile""" self.add_default("datamode") if self.get_value("datamode") != "NULL": @@ -863,9 +912,13 @@

    Source code for CIME.nmlgen

                 for variable in self._streams_variables:
                     self.add_default(variable, value=self._streams_namelists[variable])
    -
    [docs] def get_group_variables(self, group_name): + +
    +[docs] + def get_group_variables(self, group_name): return self._namelist.get_group_variables(group_name)
    + def _get_input_file_hash(self, data_list_path): lines_hash = set() if os.path.isfile(data_list_path): @@ -957,7 +1010,9 @@

    Source code for CIME.nmlgen

                 else:
                     logger.debug("Line already in file {}".format(string))
     
    -
    [docs] def write_output_file( +
    +[docs] + def write_output_file( self, namelist_file, data_list_path=None, groups=None, sorted_groups=True ): """Write out the namelists and input data files. @@ -983,8 +1038,11 @@

    Source code for CIME.nmlgen

             if data_list_path is not None:
                 self._write_input_files(data_list_path)
    + # For MCT -
    [docs] def add_nmlcontents( +
    +[docs] + def add_nmlcontents( self, filename, group, append=True, format_="nmlcontents", sorted_groups=True ): """Write only contents of nml group""" @@ -996,20 +1054,32 @@

    Source code for CIME.nmlgen

                 sorted_groups=sorted_groups,
             )
    -
    [docs] def write_seq_maps(self, filename): + +
    +[docs] + def write_seq_maps(self, filename): """Write mct out seq_maps.rc""" self._namelist.write(filename, groups=["seq_maps"], format_="rc")
    -
    [docs] def write_modelio_file(self, filename): + +
    +[docs] + def write_modelio_file(self, filename): """Write mct component modelio files""" self._namelist.write(filename, groups=["modelio", "pio_inparm"], format_="nml")
    + # For NUOPC -
    [docs] def write_nuopc_modelio_file(self, filename): +
    +[docs] + def write_nuopc_modelio_file(self, filename): """Write nuopc component modelio files""" self._namelist.write(filename, groups=["pio_inparm"], format_="nml")
    -
    [docs] def write_nuopc_config_file( + +
    +[docs] + def write_nuopc_config_file( self, filename, data_list_path=None, sorted_groups=False ): """Write the nuopc config file""" @@ -1019,7 +1089,9 @@

    Source code for CIME.nmlgen

             self._namelist.write_nuopc(filename, groups=groups, sorted_groups=sorted_groups)
             # append to input_data_list file
             if data_list_path is not None:
    -            self._write_input_files(data_list_path)
    + self._write_input_files(data_list_path)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/provenance.html b/versions/master/html/_modules/CIME/provenance.html index f78c68a6469..894cb2a2b95 100644 --- a/versions/master/html/_modules/CIME/provenance.html +++ b/versions/master/html/_modules/CIME/provenance.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -110,7 +110,9 @@

    Source code for CIME.provenance

     _WALLTIME_TOLERANCE = ((600, 2.0), (1800, 1.5), (9999999999, 1.25))
     
     
    -
    diff --git a/versions/master/html/_modules/CIME/tests/test_sys_test_scheduler.html b/versions/master/html/_modules/CIME/tests/test_sys_test_scheduler.html index dba304700aa..8d0ce9ad4b0 100644 --- a/versions/master/html/_modules/CIME/tests/test_sys_test_scheduler.html +++ b/versions/master/html/_modules/CIME/tests/test_sys_test_scheduler.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -99,8 +99,12 @@

    Source code for CIME.tests.test_sys_test_scheduler

    from CIME.tests import base -
    [docs]class TestTestScheduler(base.BaseTestCase): -
    [docs] @mock.patch("time.strftime", return_value="00:00:00") +
    +[docs] +class TestTestScheduler(base.BaseTestCase): +
    +[docs] + @mock.patch("time.strftime", return_value="00:00:00") def test_chksum(self, strftime): # pylint: disable=unused-argument if self._config.test_mode == "e3sm": self.skipTest("Skipping chksum test. Depends on CESM settings") @@ -124,7 +128,10 @@

    Source code for CIME.tests.test_sys_test_scheduler

    from_dir="/tests/SEQ_Ln9.f19_g16_rx1.A.cori-haswell_gnu.00:00:00", )
    -
    [docs] def test_a_phases(self): + +
    +[docs] + def test_a_phases(self): # exclude the MEMLEAK tests here. tests = get_tests.get_full_test_names( [ @@ -236,7 +243,10 @@

    Source code for CIME.tests.test_sys_test_scheduler

    self.assertFalse(ct._is_broken(test)) self.assertTrue(ct._work_remains(test))
    -
    [docs] def test_b_full(self): + +
    +[docs] + def test_b_full(self): tests = get_tests.get_full_test_names( ["cime_test_only"], self._machine, self._compiler ) @@ -365,7 +375,10 @@

    Source code for CIME.tests.test_sys_test_scheduler

    test_status.TEST_PASS_STATUS, )
    -
    [docs] def test_force_rebuild(self): + +
    +[docs] + def test_force_rebuild(self): tests = get_tests.get_full_test_names( [ "TESTBUILDFAIL_P1.f19_g16_rx1.A", @@ -419,7 +432,10 @@

    Source code for CIME.tests.test_sys_test_scheduler

    == test_status.TEST_PEND_STATUS )
    -
    [docs] def test_c_use_existing(self): + +
    +[docs] + def test_c_use_existing(self): tests = get_tests.get_full_test_names( [ "TESTBUILDFAIL_P1.f19_g16_rx1.A", @@ -579,7 +595,10 @@

    Source code for CIME.tests.test_sys_test_scheduler

    test_name, ts, test_status.RUN_PHASE, test_status.TEST_PASS_STATUS )
    -
    [docs] def test_d_retry(self): + +
    +[docs] + def test_d_retry(self): args = [ "TESTBUILDFAIL_P1.f19_g16_rx1.A", "TESTRUNFAILRESET_P1.f19_g16_rx1.A", @@ -589,7 +608,10 @@

    Source code for CIME.tests.test_sys_test_scheduler

    self._create_test(args)
    -
    [docs] def test_e_test_inferred_compiler(self): + +
    +[docs] + def test_e_test_inferred_compiler(self): if self._config.test_mode != "e3sm" or self._machine != "docker": self.skipTest("Skipping create_test test. Depends on E3SM settings") @@ -599,7 +621,9 @@

    Source code for CIME.tests.test_sys_test_scheduler

    result = self.run_cmd_assert_result( "./xmlquery --value BASELINE_ROOT", from_dir=case ) - self.assertEqual(os.path.split(result)[1], "gnuX")
    + self.assertEqual(os.path.split(result)[1], "gnuX")
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_sys_unittest.html b/versions/master/html/_modules/CIME/tests/test_sys_unittest.html index 7f1139305ff..a3aa389964f 100644 --- a/versions/master/html/_modules/CIME/tests/test_sys_unittest.html +++ b/versions/master/html/_modules/CIME/tests/test_sys_unittest.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,13 +95,18 @@

    Source code for CIME.tests.test_sys_unittest

    from CIME.XML.files import Files
     
     
    -
    [docs]class TestUnitTest(base.BaseTestCase): -
    [docs] @classmethod +
    +[docs] +class TestUnitTest(base.BaseTestCase): +
    +[docs] + @classmethod def setUpClass(cls): cls._do_teardown = [] cls._testroot = os.path.join(cls.TEST_ROOT, "TestUnitTests") cls._testdirs = []
    + def _has_unit_test_support(self): if self.TEST_COMPILER is None: compiler = self.MACHINE.get_default_compiler() @@ -128,7 +133,9 @@

    Source code for CIME.tests.test_sys_unittest

    return False
     
    -
    [docs] def test_a_unit_test(self): +
    +[docs] + def test_a_unit_test(self): cls = self.__class__ if not self._has_unit_test_support(): self.skipTest( @@ -150,7 +157,10 @@

    Source code for CIME.tests.test_sys_unittest

    utils.run_cmd_no_fail("{} {}".format(unit_test_tool, args))
             cls._do_teardown.append(test_dir)
    -
    [docs] def test_b_cime_f90_unit_tests(self): + +
    +[docs] + def test_b_cime_f90_unit_tests(self): cls = self.__class__ if self.FAST_ONLY: self.skipTest("Skipping slow test") @@ -174,7 +184,10 @@

    Source code for CIME.tests.test_sys_unittest

    utils.run_cmd_no_fail("{} {}".format(unit_test_tool, args))
             cls._do_teardown.append(test_dir)
    -
    [docs] @classmethod + +
    +[docs] + @classmethod def tearDownClass(cls): do_teardown = ( len(cls._do_teardown) > 0 @@ -192,7 +205,9 @@

    Source code for CIME.tests.test_sys_unittest

    shutil.rmtree(tfile)
     
             if teardown_root and do_teardown:
    -            shutil.rmtree(cls._testroot)
    + shutil.rmtree(cls._testroot)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_sys_user_concurrent_mods.html b/versions/master/html/_modules/CIME/tests/test_sys_user_concurrent_mods.html index 483fd94d307..171782ff8db 100644 --- a/versions/master/html/_modules/CIME/tests/test_sys_user_concurrent_mods.html +++ b/versions/master/html/_modules/CIME/tests/test_sys_user_concurrent_mods.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -93,8 +93,12 @@

    Source code for CIME.tests.test_sys_user_concurrent_mods

    from CIME.tests import base -
    [docs]class TestUserConcurrentMods(base.BaseTestCase): -
    [docs] def test_user_concurrent_mods(self): +
    +[docs] +class TestUserConcurrentMods(base.BaseTestCase): +
    +[docs] + def test_user_concurrent_mods(self): # Put this inside any test that's slow if self.FAST_ONLY: self.skipTest("Skipping slow test") @@ -121,7 +125,9 @@

    Source code for CIME.tests.test_sys_user_concurrent_mods

    chk_file = "drv_in" with open(os.path.join(rundir, chk_file), "r") as fd: contents = fd.read() - self.assertTrue("stop_n = 6" in contents)
    + self.assertTrue("stop_n = 6" in contents)
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_sys_wait_for_tests.html b/versions/master/html/_modules/CIME/tests/test_sys_wait_for_tests.html index 8f0518b2894..4ae5ff764ed 100644 --- a/versions/master/html/_modules/CIME/tests/test_sys_wait_for_tests.html +++ b/versions/master/html/_modules/CIME/tests/test_sys_wait_for_tests.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -99,8 +99,12 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    from CIME.tests import utils as test_utils -
    [docs]class TestWaitForTests(base.BaseTestCase): -
    [docs] def setUp(self): +
    +[docs] +class TestWaitForTests(base.BaseTestCase): +
    +[docs] + def setUp(self): super().setUp() self._testroot = os.path.join(self.TEST_ROOT, "TestWaitForTests") @@ -187,7 +191,10 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    self._thread_error = None
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): super().tearDown() do_teardown = sys.exc_info() == (None, None, None) and not self.NO_TEARDOWN @@ -196,7 +203,10 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    for testdir in self._testdirs: shutil.rmtree(testdir)
    -
    [docs] def simple_test(self, testdir, expected_results, extra_args="", build_name=None): + +
    +[docs] + def simple_test(self, testdir, expected_results, extra_args="", build_name=None): # Need these flags to test dashboard if e3sm if self._config.create_test_flag_mode == "e3sm" and build_name is not None: extra_args += " -b %s" % build_name @@ -231,28 +241,46 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    self.assertEqual(status, expected_results[idx]) self.assertEqual(testname, "Test_%d" % idx)
    -
    [docs] def threaded_test(self, testdir, expected_results, extra_args="", build_name=None): + +
    +[docs] + def threaded_test(self, testdir, expected_results, extra_args="", build_name=None): try: self.simple_test(testdir, expected_results, extra_args, build_name) except AssertionError as e: self._thread_error = str(e)
    -
    [docs] def test_wait_for_test_all_pass(self): + +
    +[docs] + def test_wait_for_test_all_pass(self): self.simple_test(self._testdir_all_pass, ["PASS"] * 10)
    -
    [docs] def test_wait_for_test_with_fail(self): + +
    +[docs] + def test_wait_for_test_with_fail(self): expected_results = ["FAIL" if item == 5 else "PASS" for item in range(10)] self.simple_test(self._testdir_with_fail, expected_results)
    -
    [docs] def test_wait_for_test_no_wait(self): + +
    +[docs] + def test_wait_for_test_no_wait(self): expected_results = ["PEND" if item == 5 else "PASS" for item in range(10)] self.simple_test(self._testdir_unfinished, expected_results, "-n")
    -
    [docs] def test_wait_for_test_timeout(self): + +
    +[docs] + def test_wait_for_test_timeout(self): expected_results = ["PEND" if item == 5 else "PASS" for item in range(10)] self.simple_test(self._testdir_unfinished, expected_results, "--timeout=3")
    -
    [docs] def test_wait_for_test_wait_for_pend(self): + +
    +[docs] + def test_wait_for_test_wait_for_pend(self): run_thread = threading.Thread( target=self.threaded_test, args=(self._testdir_unfinished, ["PASS"] * 10) ) @@ -279,7 +307,10 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    msg="Thread had failure: %s" % self._thread_error, )
    -
    [docs] def test_wait_for_test_wait_for_missing_run_phase(self): + +
    +[docs] + def test_wait_for_test_wait_for_missing_run_phase(self): run_thread = threading.Thread( target=self.threaded_test, args=(self._testdir_unfinished2, ["PASS"] * 10) ) @@ -306,7 +337,10 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    msg="Thread had failure: %s" % self._thread_error, )
    -
    [docs] def test_wait_for_test_wait_kill(self): + +
    +[docs] + def test_wait_for_test_wait_kill(self): expected_results = ["PEND" if item == 5 else "PASS" for item in range(10)] run_thread = threading.Thread( target=self.threaded_test, args=(self._testdir_unfinished, expected_results) @@ -331,7 +365,10 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    msg="Thread had failure: %s" % self._thread_error, )
    -
    [docs] def test_wait_for_test_cdash_pass(self): + +
    +[docs] + def test_wait_for_test_cdash_pass(self): expected_results = ["PASS"] * 10 build_name = "regression_test_pass_" + self._timestamp run_thread = threading.Thread( @@ -354,7 +391,10 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    self.assert_dashboard_has_build(build_name)
    -
    [docs] def test_wait_for_test_cdash_kill(self): + +
    +[docs] + def test_wait_for_test_cdash_kill(self): expected_results = ["PEND" if item == 5 else "PASS" for item in range(10)] build_name = "regression_test_kill_" + self._timestamp run_thread = threading.Thread( @@ -401,9 +441,12 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    r'<Test Status="notrun"><Name>Test_5</Name>' in xml_contents )
    + # TODO: Any further checking of xml output worth doing? -
    [docs] def live_test_impl(self, testdir, expected_results, last_phase, last_status): +
    +[docs] + def live_test_impl(self, testdir, expected_results, last_phase, last_status): run_thread = threading.Thread( target=self.threaded_test, args=(testdir, expected_results) ) @@ -449,7 +492,10 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    msg="Thread had failure: %s" % self._thread_error, )
    -
    [docs] def test_wait_for_test_test_status_integration_pass(self): + +
    +[docs] + def test_wait_for_test_test_status_integration_pass(self): self.live_test_impl( self._testdir_teststatus1, ["PASS"], @@ -457,13 +503,18 @@

    Source code for CIME.tests.test_sys_wait_for_tests

    test_status.TEST_PASS_STATUS, )
    -
    [docs] def test_wait_for_test_test_status_integration_submit_fail(self): + +
    +[docs] + def test_wait_for_test_test_status_integration_submit_fail(self): self.live_test_impl( self._testdir_teststatus1, ["FAIL"], test_status.SUBMIT_PHASE, test_status.TEST_FAIL_STATUS, - )
    + )
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_aprun.html b/versions/master/html/_modules/CIME/tests/test_unit_aprun.html index 484c1d9b60d..65ad4f72fa8 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_aprun.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_aprun.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -140,8 +140,12 @@

    Source code for CIME.tests.test_unit_aprun

     ]
     
     
    -
    [docs]class TestUnitAprun(unittest.TestCase): -
    [docs] def test_aprun_extra_args(self): +
    +[docs] +class TestUnitAprun(unittest.TestCase): +
    +[docs] + def test_aprun_extra_args(self): case = mock.MagicMock() case.get_values.return_value = [ @@ -180,7 +184,10 @@

    Source code for CIME.tests.test_unit_aprun

             assert min_tasks_per_node == 4
             assert max_thread_count == 4
    -
    [docs] def test_aprun(self): + +
    +[docs] + def test_aprun(self): case = mock.MagicMock() case.get_values.return_value = [ @@ -211,7 +218,9 @@

    Source code for CIME.tests.test_unit_aprun

             assert total_node_count == 117
             assert total_task_count == 808
             assert min_tasks_per_node == 4
    -        assert max_thread_count == 4
    + assert max_thread_count == 4
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_baselines_performance.html b/versions/master/html/_modules/CIME/tests/test_unit_baselines_performance.html new file mode 100644 index 00000000000..b81d75d0ad5 --- /dev/null +++ b/versions/master/html/_modules/CIME/tests/test_unit_baselines_performance.html @@ -0,0 +1,918 @@ + + + + + + CIME.tests.test_unit_baselines_performance — CIME master documentation + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    +
      +
    • + + +
    • +
    • +
    +
    +
    +
    +
    + +

    Source code for CIME.tests.test_unit_baselines_performance

    +#!/usr/bin/env python3
    +
    +import gzip
    +import tempfile
    +import unittest
    +from unittest import mock
    +from pathlib import Path
    +
    +from CIME.baselines import performance
    +from CIME.tests.test_unit_system_tests import CPLLOG
    +
    +
    +
    +[docs] +def create_mock_case(tempdir, get_latest_cpl_logs=None): + caseroot = Path(tempdir, "0", "caseroot") + + rundir = caseroot / "run" + + if get_latest_cpl_logs is not None: + get_latest_cpl_logs.return_value = (str(rundir / "cpl.log.gz"),) + + baseline_root = Path(tempdir, "baselines") + + baseline_root.mkdir(parents=True, exist_ok=False) + + case = mock.MagicMock() + + return case, caseroot, rundir, baseline_root
    + + + +
    +[docs] +class TestUnitBaselinesPerformance(unittest.TestCase): +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_memory") + def test_perf_get_memory_default_no_value(self, _perf_get_memory): + _perf_get_memory.return_value = None + + case = mock.MagicMock() + + config = mock.MagicMock() + + config.perf_get_memory.side_effect = AttributeError + + with self.assertRaises(RuntimeError): + performance.perf_get_memory(case, config)
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_memory") + def test_perf_get_memory_default(self, _perf_get_memory): + _perf_get_memory.return_value = [(1, 1000)] + + case = mock.MagicMock() + + config = mock.MagicMock() + + config.perf_get_memory.side_effect = AttributeError + + mem = performance.perf_get_memory(case, config) + + assert mem == "1000"
    + + +
    +[docs] + def test_perf_get_memory(self): + case = mock.MagicMock() + + config = mock.MagicMock() + + config.perf_get_memory.return_value = "1000" + + mem = performance.perf_get_memory(case, config) + + assert mem == "1000"
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_throughput") + def test_perf_get_throughput_default_no_value(self, _perf_get_throughput): + _perf_get_throughput.return_value = None + + case = mock.MagicMock() + + config = mock.MagicMock() + + config.perf_get_throughput.side_effect = AttributeError + + with self.assertRaises(RuntimeError): + performance.perf_get_throughput(case, config)
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_throughput") + def test_perf_get_throughput_default(self, _perf_get_throughput): + _perf_get_throughput.return_value = 100 + + case = mock.MagicMock() + + config = mock.MagicMock() + + config.perf_get_throughput.side_effect = AttributeError + + tput = performance.perf_get_throughput(case, config) + + assert tput == "100"
    + + +
    +[docs] + def test_perf_get_throughput(self): + case = mock.MagicMock() + + config = mock.MagicMock() + + config.perf_get_throughput.return_value = "100" + + tput = performance.perf_get_throughput(case, config) + + assert tput == "100"
    + + +
    +[docs] + def test_get_cpl_throughput_no_file(self): + throughput = performance.get_cpl_throughput("/tmp/cpl.log") + + assert throughput is None
    + + +
    +[docs] + def test_get_cpl_throughput(self): + with tempfile.TemporaryDirectory() as tempdir: + cpl_log_path = Path(tempdir, "cpl.log.gz") + + with gzip.open(cpl_log_path, "w") as fd: + fd.write(CPLLOG.encode("utf-8")) + + throughput = performance.get_cpl_throughput(str(cpl_log_path)) + + assert throughput == 719.635
    + + +
    +[docs] + def test_get_cpl_mem_usage_gz(self): + with tempfile.TemporaryDirectory() as tempdir: + cpl_log_path = Path(tempdir, "cpl.log.gz") + + with gzip.open(cpl_log_path, "w") as fd: + fd.write(CPLLOG.encode("utf-8")) + + mem_usage = performance.get_cpl_mem_usage(str(cpl_log_path)) + + assert mem_usage == [ + (10102.0, 1673.89), + (10103.0, 1673.89), + (10104.0, 1673.89), + (10105.0, 1673.89), + ]
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.os.path.isfile") + def test_get_cpl_mem_usage(self, isfile): + isfile.return_value = True + + with mock.patch( + "builtins.open", mock.mock_open(read_data=CPLLOG.encode("utf-8")) + ) as mock_file: + mem_usage = performance.get_cpl_mem_usage("/tmp/cpl.log") + + assert mem_usage == [ + (10102.0, 1673.89), + (10103.0, 1673.89), + (10104.0, 1673.89), + (10105.0, 1673.89), + ]
    + + +
    +[docs] + def test_read_baseline_file_multi_line(self): + with mock.patch( + "builtins.open", + mock.mock_open(read_data="#comment about data\n1000.0\n2000.0\n"), + ) as mock_file: + baseline = performance.read_baseline_file("/tmp/cpl-mem.log") + + mock_file.assert_called_with("/tmp/cpl-mem.log") + assert baseline == "1000.0\n2000.0"
    + + +
    +[docs] + def test_read_baseline_file_content(self): + with mock.patch( + "builtins.open", mock.mock_open(read_data="1000.0") + ) as mock_file: + baseline = performance.read_baseline_file("/tmp/cpl-mem.log") + + mock_file.assert_called_with("/tmp/cpl-mem.log") + assert baseline == "1000.0"
    + + +
    +[docs] + def test_read_baseline_file(self): + with mock.patch("builtins.open", mock.mock_open(read_data="")) as mock_file: + baseline = performance.read_baseline_file("/tmp/cpl-mem.log") + + mock_file.assert_called_with("/tmp/cpl-mem.log") + assert baseline == ""
    + + +
    +[docs] + def test_write_baseline_file(self): + with mock.patch("builtins.open", mock.mock_open()) as mock_file: + performance.write_baseline_file("/tmp/cpl-tput.log", "1000") + + mock_file.assert_called_with("/tmp/cpl-tput.log", "w") + mock_file.return_value.write.assert_called_with("1000")
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_throughput") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test__perf_get_throughput(self, get_latest_cpl_logs, get_cpl_throughput): + get_cpl_throughput.side_effect = FileNotFoundError() + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + tput = performance._perf_get_throughput(case) + + assert tput == None
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test__perf_get_memory_override(self, get_latest_cpl_logs, get_cpl_mem_usage): + get_cpl_mem_usage.side_effect = FileNotFoundError() + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + mem = performance._perf_get_memory(case, "/tmp/override") + + assert mem == None
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test__perf_get_memory(self, get_latest_cpl_logs, get_cpl_mem_usage): + get_cpl_mem_usage.side_effect = FileNotFoundError() + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + mem = performance._perf_get_memory(case) + + assert mem == None
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.write_baseline_file") + @mock.patch("CIME.baselines.performance.perf_get_memory") + @mock.patch("CIME.baselines.performance.perf_get_throughput") + def test_write_baseline_skip( + self, perf_get_throughput, perf_get_memory, write_baseline_file + ): + perf_get_throughput.return_value = "100" + + perf_get_memory.return_value = "1000" + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir) + + performance.perf_write_baseline( + case, + baseline_root, + False, + False, + ) + + perf_get_throughput.assert_not_called() + perf_get_memory.assert_not_called() + write_baseline_file.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.write_baseline_file") + @mock.patch("CIME.baselines.performance.perf_get_memory") + @mock.patch("CIME.baselines.performance.perf_get_throughput") + def test_write_baseline_runtimeerror( + self, perf_get_throughput, perf_get_memory, write_baseline_file + ): + perf_get_throughput.side_effect = RuntimeError + + perf_get_memory.side_effect = RuntimeError + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir) + + performance.perf_write_baseline(case, baseline_root) + + perf_get_throughput.assert_called() + perf_get_memory.assert_called() + write_baseline_file.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.write_baseline_file") + @mock.patch("CIME.baselines.performance.perf_get_memory") + @mock.patch("CIME.baselines.performance.perf_get_throughput") + def test_perf_write_baseline( + self, perf_get_throughput, perf_get_memory, write_baseline_file + ): + perf_get_throughput.return_value = "100" + + perf_get_memory.return_value = "1000" + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir) + + performance.perf_write_baseline(case, baseline_root) + + perf_get_throughput.assert_called() + perf_get_memory.assert_called() + write_baseline_file.assert_any_call(str(baseline_root / "cpl-tput.log"), "100") + write_baseline_file.assert_any_call(str(baseline_root / "cpl-mem.log"), "1000")
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_throughput") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_throughput_baseline_no_baseline_file( + self, get_latest_cpl_logs, read_baseline_file, _perf_get_throughput + ): + read_baseline_file.side_effect = FileNotFoundError + + _perf_get_throughput.return_value = 504 + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_value.side_effect = ( + str(baseline_root), + "master/ERIO.ne30_g16_rx1.A.docker_gnu", + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_throughput_baseline( + case + ) + + assert below_tolerance is None + assert comment == "Could not read baseline throughput file: "
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_throughput") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_throughput_baseline_no_baseline( + self, get_latest_cpl_logs, read_baseline_file, _perf_get_throughput + ): + read_baseline_file.return_value = "" + + _perf_get_throughput.return_value = 504 + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_throughput_baseline( + case + ) + + assert below_tolerance is None + assert ( + comment + == "Could not compare throughput to baseline, as basline had no value." + )
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_throughput") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_throughput_baseline_no_tolerance( + self, get_latest_cpl_logs, read_baseline_file, _perf_get_throughput + ): + read_baseline_file.return_value = "500" + + _perf_get_throughput.return_value = 504 + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + None, + ) + + (below_tolerance, comment) = performance.perf_compare_throughput_baseline( + case + ) + + assert below_tolerance + assert ( + comment + == "TPUTCOMP: Computation time changed by -0.80% relative to baseline" + )
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_throughput") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_throughput_baseline_above_threshold( + self, get_latest_cpl_logs, read_baseline_file, _perf_get_throughput + ): + read_baseline_file.return_value = "1000" + + _perf_get_throughput.return_value = 504 + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_throughput_baseline( + case + ) + + assert not below_tolerance + assert ( + comment == "Error: TPUTCOMP: Computation time increase > 5% from baseline" + )
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance._perf_get_throughput") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_throughput_baseline( + self, get_latest_cpl_logs, read_baseline_file, _perf_get_throughput + ): + read_baseline_file.return_value = "500" + + _perf_get_throughput.return_value = 504 + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_throughput_baseline( + case + ) + + assert below_tolerance + assert ( + comment + == "TPUTCOMP: Computation time changed by -0.80% relative to baseline" + )
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_memory_baseline_no_baseline( + self, get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage + ): + read_baseline_file.return_value = "" + + get_cpl_mem_usage.return_value = [ + (1, 1000.0), + (2, 1001.0), + (3, 1002.0), + (4, 1003.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_memory_baseline(case) + + assert below_tolerance + assert ( + comment + == "MEMCOMP: Memory usage highwater has changed by 0.00% relative to baseline" + )
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_memory_baseline_not_enough_samples( + self, get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage + ): + read_baseline_file.return_value = ["1000.0"] + + get_cpl_mem_usage.return_value = [ + (1, 1000.0), + (2, 1001.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_value.side_effect = ( + str(baseline_root), + "master/ERIO.ne30_g16_rx1.A.docker_gnu", + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_memory_baseline(case) + + assert below_tolerance is None + assert comment == "Found 2 memory usage samples, need atleast 4"
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_memory_baseline_no_baseline_file( + self, get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage + ): + read_baseline_file.side_effect = FileNotFoundError + + get_cpl_mem_usage.return_value = [ + (1, 1000.0), + (2, 1001.0), + (3, 1002.0), + (4, 1003.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_value.side_effect = ( + str(baseline_root), + "master/ERIO.ne30_g16_rx1.A.docker_gnu", + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_memory_baseline(case) + + assert below_tolerance is None + assert comment == "Could not read baseline memory usage: "
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_memory_baseline_no_tolerance( + self, get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage + ): + read_baseline_file.return_value = "1000.0" + + get_cpl_mem_usage.return_value = [ + (1, 1000.0), + (2, 1001.0), + (3, 1002.0), + (4, 1003.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + None, + ) + + (below_tolerance, comment) = performance.perf_compare_memory_baseline(case) + + assert below_tolerance + assert ( + comment + == "MEMCOMP: Memory usage highwater has changed by 0.30% relative to baseline" + )
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_memory_baseline_above_threshold( + self, get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage + ): + read_baseline_file.return_value = "1000.0" + + get_cpl_mem_usage.return_value = [ + (1, 2000.0), + (2, 2001.0), + (3, 2002.0), + (4, 2003.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_memory_baseline(case) + + assert not below_tolerance + assert ( + comment + == "Error: Memory usage increase >5% from baseline's 1000.000000 to 2003.000000" + )
    + + +
    +[docs] + @mock.patch("CIME.baselines.performance.get_cpl_mem_usage") + @mock.patch("CIME.baselines.performance.read_baseline_file") + @mock.patch("CIME.baselines.performance.get_latest_cpl_logs") + def test_perf_compare_memory_baseline( + self, get_latest_cpl_logs, read_baseline_file, get_cpl_mem_usage + ): + read_baseline_file.return_value = "1000.0" + + get_cpl_mem_usage.return_value = [ + (1, 1000.0), + (2, 1001.0), + (3, 1002.0), + (4, 1003.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + case, _, _, baseline_root = create_mock_case(tempdir, get_latest_cpl_logs) + + case.get_baseline_dir.return_value = str( + baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + ) + + case.get_value.side_effect = ( + "/tmp/components/cpl", + 0.05, + ) + + (below_tolerance, comment) = performance.perf_compare_memory_baseline(case) + + assert below_tolerance + assert ( + comment + == "MEMCOMP: Memory usage highwater has changed by 0.30% relative to baseline" + )
    + + +
    +[docs] + def test_get_latest_cpl_logs_found_multiple(self): + with tempfile.TemporaryDirectory() as tempdir: + run_dir = Path(tempdir) / "run" + run_dir.mkdir(parents=True, exist_ok=False) + + cpl_log_path = run_dir / "cpl.log.gz" + cpl_log_path.touch() + + cpl_log_2_path = run_dir / "cpl-2023-01-01.log.gz" + cpl_log_2_path.touch() + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(run_dir), + "mct", + ) + + latest_cpl_logs = performance.get_latest_cpl_logs(case) + + assert len(latest_cpl_logs) == 2 + assert sorted(latest_cpl_logs) == sorted( + [str(cpl_log_path), str(cpl_log_2_path)] + )
    + + +
    +[docs] + def test_get_latest_cpl_logs_found_single(self): + with tempfile.TemporaryDirectory() as tempdir: + run_dir = Path(tempdir) / "run" + run_dir.mkdir(parents=True, exist_ok=False) + + cpl_log_path = run_dir / "cpl.log.gz" + cpl_log_path.touch() + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(run_dir), + "mct", + ) + + latest_cpl_logs = performance.get_latest_cpl_logs(case) + + assert len(latest_cpl_logs) == 1 + assert latest_cpl_logs[0] == str(cpl_log_path)
    + + +
    +[docs] + def test_get_latest_cpl_logs(self): + case = mock.MagicMock() + case.get_value.side_effect = ( + f"/tmp/run", + "mct", + ) + + latest_cpl_logs = performance.get_latest_cpl_logs(case) + + assert len(latest_cpl_logs) == 0
    +
    + +
    + +
    +
    +
    + +
    + +
    +

    © Copyright 2017, U.S. National Science Foundation and U.S. Department of Energy.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + + + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/versions/master/html/_modules/CIME/tests/test_unit_case.html b/versions/master/html/_modules/CIME/tests/test_unit_case.html index e939dc6e8f8..9a6ef181852 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_case.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_case.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.tests.test_unit_case

     from CIME import utils as cime_utils
     
     
    -
    [docs]def make_valid_case(path): +
    +[docs] +def make_valid_case(path): """Make the given path look like a valid case to avoid errors""" # Case validity is determined by checking for an env_case.xml file. So put one there # to suggest that this directory is a valid case directory. Open in append mode in @@ -105,14 +107,35 @@

    Source code for CIME.tests.test_unit_case

             pass
    -
    [docs]class TestCaseSubmit(unittest.TestCase): -
    [docs] def test_check_case(self): + +
    +[docs] +class TestCaseSubmit(unittest.TestCase): +
    +[docs] + def test_check_case(self): case = mock.MagicMock() + # get_value arguments TEST, COMP_WAV, COMP_INTERFACE, BUILD_COMPLETE + case.get_value.side_effect = [False, "", "", True] case_submit.check_case(case, chksum=True) case.check_all_input_data.assert_called_with(chksum=True)
    -
    [docs] @mock.patch("CIME.case.case_submit.lock_file") + +
    +[docs] + def test_check_case_test(self): + case = mock.MagicMock() + # get_value arguments TEST, COMP_WAV, COMP_INTERFACE, BUILD_COMPLETE + case.get_value.side_effect = [True, "", "", True] + case_submit.check_case(case, chksum=True) + + case.check_all_input_data.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.case.case_submit.lock_file") @mock.patch("CIME.case.case_submit.unlock_file") @mock.patch("os.path.basename") def test__submit( @@ -124,7 +147,10 @@

    Source code for CIME.tests.test_unit_case

     
             case.check_case.assert_called_with(skip_pnl=False, chksum=True)
    -
    [docs] @mock.patch("CIME.case.case_submit._submit") + +
    +[docs] + @mock.patch("CIME.case.case_submit._submit") @mock.patch("CIME.case.case.Case.initialize_derived_attributes") @mock.patch("CIME.case.case.Case.get_value") @mock.patch("CIME.case.case.Case.read_xml") @@ -162,15 +188,24 @@

    Source code for CIME.tests.test_unit_case

                     batch_args=None,
                     workflow=True,
                     chksum=True,
    -            )
    + )
    +
    -
    [docs]class TestCase(unittest.TestCase): -
    [docs] def setUp(self): + +
    +[docs] +class TestCase(unittest.TestCase): +
    +[docs] + def setUp(self): self.srcroot = os.path.abspath(cime_utils.get_src_root()) self.tempdir = tempfile.TemporaryDirectory()
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") def test_fix_sys_argv_quotes(self, read_xml): input_data = ["./xmlquery", "--val", "PIO"] expected_data = ["./xmlquery", "--val", "PIO"] @@ -183,7 +218,10 @@

    Source code for CIME.tests.test_unit_case

     
             assert output_data == expected_data
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") def test_fix_sys_argv_quotes_incomplete(self, read_xml): input_data = ["./xmlquery", "--val"] expected_data = ["./xmlquery", "--val"] @@ -196,7 +234,10 @@

    Source code for CIME.tests.test_unit_case

     
             assert output_data == expected_data
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") def test_fix_sys_argv_quotes_val(self, read_xml): input_data = ["./xmlquery", "--val", "-test"] expected_data = ["./xmlquery", "--val", "-test"] @@ -209,7 +250,10 @@

    Source code for CIME.tests.test_unit_case

     
             assert output_data == expected_data
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") def test_fix_sys_argv_quotes_val_quoted(self, read_xml): input_data = ["./xmlquery", "--val", " -nlev 267 "] expected_data = ["./xmlquery", "--val", '" -nlev 267 "'] @@ -222,7 +266,10 @@

    Source code for CIME.tests.test_unit_case

     
             assert output_data == expected_data
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") def test_fix_sys_argv_quotes_kv(self, read_xml): input_data = ["./xmlquery", "CAM_CONFIG_OPTS= -nlev 267", "OTHER_OPTS=-test"] expected_data = [ @@ -239,7 +286,10 @@

    Source code for CIME.tests.test_unit_case

     
             assert output_data == expected_data
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") @mock.patch("sys.argv", ["/src/create_newcase", "--machine", "docker"]) @mock.patch("time.strftime", return_value="00:00:00") @mock.patch("socket.getfqdn", return_value="host1") @@ -270,7 +320,10 @@

    Source code for CIME.tests.test_unit_case

     
                     self.assertTrue(value == expected, "{} != {}".format(value, expected))
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") @mock.patch("sys.argv", ["/src/create_newcase", "--machine", "docker"]) @mock.patch("time.strftime", return_value="00:00:00") @mock.patch("CIME.case.case.lock_file") @@ -354,7 +407,10 @@

    Source code for CIME.tests.test_unit_case

     
                         set_value.assert_called_with("CASE_HASH", expected_second_hash)
    -
    [docs] @mock.patch("CIME.case.case.Case.read_xml") + +
    +[docs] + @mock.patch("CIME.case.case.Case.read_xml") @mock.patch("sys.argv", ["/src/create_newcase", "--machine", "docker"]) @mock.patch("time.strftime", return_value="00:00:00") @mock.patch("CIME.case.case.lock_file") @@ -424,20 +480,32 @@

    Source code for CIME.tests.test_unit_case

                     set_lookup_value.assert_called_with(
                         "CASE_HASH",
                         "134a939f62115fb44bf08a46bfb2bd13426833b5c8848cf7c4884af7af05b91a",
    -                )
    + )
    +
    -
    [docs]class TestCase_RecordCmd(unittest.TestCase): -
    [docs] def setUp(self): + +
    +[docs] +class TestCase_RecordCmd(unittest.TestCase): +
    +[docs] + def setUp(self): self.tempdir = tempfile.TemporaryDirectory()
    -
    [docs] def assert_calls_match(self, calls, expected): + +
    +[docs] + def assert_calls_match(self, calls, expected): self.assertTrue(len(calls) == len(expected), calls) for x, y in zip(calls, expected): self.assertTrue(x == y, calls)
    -
    [docs] @mock.patch("CIME.case.case.Case.__init__", return_value=None) + +
    +[docs] + @mock.patch("CIME.case.case.Case.__init__", return_value=None) @mock.patch("CIME.case.case.Case.flush") @mock.patch("CIME.case.case.Case.get_value") @mock.patch("CIME.case.case.open", mock.mock_open()) @@ -462,7 +530,10 @@

    Source code for CIME.tests.test_unit_case

                     make_valid_case(tempdir)
                     case.record_cmd()
    -
    [docs] @mock.patch("CIME.case.case.Case.__init__", return_value=None) + +
    +[docs] + @mock.patch("CIME.case.case.Case.__init__", return_value=None) @mock.patch("CIME.case.case.Case.flush") @mock.patch("CIME.case.case.Case.get_value") @mock.patch("CIME.case.case.open", mock.mock_open()) @@ -496,7 +567,10 @@

    Source code for CIME.tests.test_unit_case

                 ]
             )
    -
    [docs] @mock.patch("CIME.case.case.Case.__init__", return_value=None) + +
    +[docs] + @mock.patch("CIME.case.case.Case.__init__", return_value=None) @mock.patch("CIME.case.case.Case.flush") @mock.patch("CIME.case.case.Case.get_value") @mock.patch("CIME.case.case.open", mock.mock_open()) @@ -527,7 +601,10 @@

    Source code for CIME.tests.test_unit_case

             handle = mocked_open()
             handle.writelines.assert_called_with(expected)
    -
    [docs] @mock.patch("CIME.case.case.Case.__init__", return_value=None) + +
    +[docs] + @mock.patch("CIME.case.case.Case.__init__", return_value=None) @mock.patch("CIME.case.case.Case.flush") @mock.patch("CIME.case.case.Case.get_value") def test_cmd_arg(self, get_value, flush, init): # pylint: disable=unused-argument @@ -553,7 +630,9 @@

    Source code for CIME.tests.test_unit_case

             ]
     
             handle = mocked_open()
    -        handle.writelines.assert_called_with(expected)
    + handle.writelines.assert_called_with(expected)
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_case_fake.html b/versions/master/html/_modules/CIME/tests/test_unit_case_fake.html index 222d39b437a..0b3a40e5013 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_case_fake.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_case_fake.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,14 +98,24 @@

    Source code for CIME.tests.test_unit_case_fake

    from CIME.tests.case_fake import CaseFake -

    [docs]class TestCaseFake(unittest.TestCase): -
    [docs] def setUp(self): +
    +[docs] +class TestCaseFake(unittest.TestCase): +
    +[docs] + def setUp(self): self.tempdir = tempfile.mkdtemp()
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): shutil.rmtree(self.tempdir, ignore_errors=True)
    -
    [docs] def test_create_clone(self): + +
    +[docs] + def test_create_clone(self): # Setup old_caseroot = os.path.join(self.tempdir, "oldcase") oldcase = CaseFake(old_caseroot) @@ -120,7 +130,9 @@

    Source code for CIME.tests.test_unit_case_fake

    self.assertEqual("newcase", clone.get_value("CASE")) self.assertEqual("newcase", clone.get_value("CASEBASEID")) self.assertEqual(new_caseroot, clone.get_value("CASEROOT")) - self.assertEqual(os.path.join(new_caseroot, "run"), clone.get_value("RUNDIR"))

    + self.assertEqual(os.path.join(new_caseroot, "run"), clone.get_value("RUNDIR"))
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_case_setup.html b/versions/master/html/_modules/CIME/tests/test_unit_case_setup.html index 5577efd3684..c5c6d2e3813 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_case_setup.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_case_setup.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,7 +96,9 @@

    Source code for CIME.tests.test_unit_case_setup

    < from CIME.case import case_setup -
    [docs]@contextlib.contextmanager +
    +[docs] +@contextlib.contextmanager def create_machines_dir(): """Creates temp machines directory with fake content""" with tempfile.TemporaryDirectory() as temp_path: @@ -109,7 +111,10 @@

    Source code for CIME.tests.test_unit_case_setup

    < yield temp_path
    -
    [docs]@contextlib.contextmanager + +
    +[docs] +@contextlib.contextmanager def chdir(path): old_path = os.getcwd() os.chdir(path) @@ -120,9 +125,14 @@

    Source code for CIME.tests.test_unit_case_setup

    < os.chdir(old_path)
    + # pylint: disable=protected-access -
    [docs]class TestCaseSetup(unittest.TestCase): -
    [docs] @mock.patch("CIME.case.case_setup.copy_depends_files") +
    +[docs] +class TestCaseSetup(unittest.TestCase): +
    +[docs] + @mock.patch("CIME.case.case_setup.copy_depends_files") def test_create_macros_cmake(self, copy_depends_files): machine_mock = mock.MagicMock() machine_mock.get_machine_name.return_value = "test" @@ -155,7 +165,10 @@

    Source code for CIME.tests.test_unit_case_setup

    < "test", machines_path, case_path, "gnu-test" )
    -
    [docs] @mock.patch("CIME.case.case_setup._create_macros_cmake") + +
    +[docs] + @mock.patch("CIME.case.case_setup._create_macros_cmake") def test_create_macros(self, _create_macros_cmake): case_mock = mock.MagicMock() @@ -202,7 +215,10 @@

    Source code for CIME.tests.test_unit_case_setup

    < os.path.join(case_path, "cmake_macros"), )
    -
    [docs] def test_create_macros_copy_user(self): + +
    +[docs] + def test_create_macros_copy_user(self): case_mock = mock.MagicMock() machine_mock = mock.MagicMock() @@ -250,7 +266,10 @@

    Source code for CIME.tests.test_unit_case_setup

    < assert os.path.exists(os.path.join(case_path, "cmake_macros", "user.cmake"))
    -
    [docs] def test_create_macros_copy_extra(self): + +
    +[docs] + def test_create_macros_copy_extra(self): case_mock = mock.MagicMock() machine_mock = mock.MagicMock() @@ -297,7 +316,9 @@

    Source code for CIME.tests.test_unit_case_setup

    < assert os.path.exists( os.path.join(case_path, "cmake_macros", "extra.cmake") - )
    + )
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_compare_test_results.html b/versions/master/html/_modules/CIME/tests/test_unit_compare_test_results.html index ebf625ac179..fc5c047ae57 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_compare_test_results.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_compare_test_results.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -101,8 +101,12 @@

    Source code for CIME.tests.test_unit_compare_test_results

    from CIME.tests.case_fake import CaseFake -
    [docs]class TestCaseFake(unittest.TestCase): -
    [docs] def setUp(self): +
    +[docs] +class TestCaseFake(unittest.TestCase): +
    +[docs] + def setUp(self): self.tempdir = tempfile.mkdtemp() self.test_root = os.path.join(self.tempdir, "tests") self.baseline_root = os.path.join(self.test_root, "baselines") @@ -119,13 +123,17 @@

    Source code for CIME.tests.test_unit_compare_test_results

    self._old_case = compare_test_results.Case compare_test_results.Case = CaseFake
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): utils.time.strftime = self._old_strftime CaseFake.__init__ = self._old_init compare_test_results.Case = self._old_case shutil.rmtree(self.tempdir, ignore_errors=True)
    + def _compare_test_results(self, baseline, test_id, phases, **kwargs): test_status_root = os.path.join(self.test_root, "gnu." + test_id) os.makedirs(test_status_root) @@ -144,7 +152,9 @@

    Source code for CIME.tests.test_unit_compare_test_results

    self.assertTrue(os.path.exists(compare_log)) -
    [docs] def test_namelists_only(self): +
    +[docs] + def test_namelists_only(self): compare_test_results.compare_namelists = lambda *args: True compare_test_results.compare_history = lambda *args: (True, "Detail comments") @@ -157,7 +167,10 @@

    Source code for CIME.tests.test_unit_compare_test_results

    "test1", "test-baseline", phases, namelists_only=True )
    -
    [docs] def test_hist_only(self): + +
    +[docs] + def test_hist_only(self): compare_test_results.compare_namelists = lambda *args: True compare_test_results.compare_history = lambda *args: (True, "Detail comments") @@ -168,7 +181,10 @@

    Source code for CIME.tests.test_unit_compare_test_results

    self._compare_test_results("test1", "test-baseline", phases, hist_only=True)
    -
    [docs] def test_failed_early(self): + +
    +[docs] + def test_failed_early(self): compare_test_results.compare_namelists = lambda *args: True compare_test_results.compare_history = lambda *args: (True, "Detail comments") @@ -178,7 +194,10 @@

    Source code for CIME.tests.test_unit_compare_test_results

    self._compare_test_results("test1", "test-baseline", phases)
    -
    [docs] def test_baseline(self): + +
    +[docs] + def test_baseline(self): compare_test_results.compare_namelists = lambda *args: True compare_test_results.compare_history = lambda *args: (True, "Detail comments") @@ -187,7 +206,9 @@

    Source code for CIME.tests.test_unit_compare_test_results

    (RUN_PHASE, "PASS"), ] - self._compare_test_results("test1", "test-baseline", phases)
    + self._compare_test_results("test1", "test-baseline", phases)
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_compare_two.html b/versions/master/html/_modules/CIME/tests/test_unit_compare_two.html index 7cb9ab79b99..e28df119499 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_compare_two.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_compare_two.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -156,7 +156,9 @@

    Source code for CIME.tests.test_unit_compare_two

    # is a list of Call objects (see above for their definition). -
    [docs]class SystemTestsCompareTwoFake(SystemTestsCompareTwo): +
    +[docs] +class SystemTestsCompareTwoFake(SystemTestsCompareTwo): def __init__( self, case1, @@ -248,7 +250,9 @@

    Source code for CIME.tests.test_unit_compare_two

    # SystemTestsCommon # ------------------------------------------------------------------------ -
    [docs] def run_indv( +
    +[docs] + def run_indv( self, suffix="base", st_archive=False, @@ -276,6 +280,7 @@

    Source code for CIME.tests.test_unit_compare_two

    if caseroot not in self.run_pass_caseroot: raise RuntimeError("caseroot not in run_pass_caseroot")
    + def _do_compare_test(self, suffix1, suffix2, ignore_fieldlist_diffs=False): """ This fake implementation allows controlling whether compare_test @@ -337,25 +342,36 @@

    Source code for CIME.tests.test_unit_compare_two

    self.log.append(Call(METHOD_case_two_custom_postrun_action, {}))
    + # ======================================================================== # Test class itself # ======================================================================== -
    [docs]class TestSystemTestsCompareTwo(unittest.TestCase): -
    [docs] def setUp(self): +
    +[docs] +class TestSystemTestsCompareTwo(unittest.TestCase): +
    +[docs] + def setUp(self): self.original_wd = os.getcwd() # create a sandbox in which case directories can be created self.tempdir = tempfile.mkdtemp()
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): # Some tests trigger a chdir call in the SUT; make sure we return to the # original directory at the end of the test os.chdir(self.original_wd) shutil.rmtree(self.tempdir, ignore_errors=True)
    -
    [docs] def get_caseroots(self, casename="mytest"): + +
    +[docs] + def get_caseroots(self, casename="mytest"): """ Returns a tuple (case1root, case2root) """ @@ -363,7 +379,10 @@

    Source code for CIME.tests.test_unit_compare_two

    case2root = os.path.join(case1root, "case2", casename) return case1root, case2root
    -
    [docs] def get_compare_phase_name(self, mytest): + +
    +[docs] + def get_compare_phase_name(self, mytest): """ Returns a string giving the compare phase name for this test """ @@ -374,7 +393,10 @@

    Source code for CIME.tests.test_unit_compare_two

    ) return compare_phase_name
    -
    [docs] def test_resetup_case_single_exe(self): + +
    +[docs] + def test_resetup_case_single_exe(self): # Setup case1root = os.path.join(self.tempdir, "case1") case1 = CaseFake(case1root) @@ -408,7 +430,10 @@

    Source code for CIME.tests.test_unit_compare_two

    case1.set_value.assert_called_with("BUILD_COMPLETE", True)
    -
    [docs] def test_setup(self): + +
    +[docs] + def test_setup(self): # Ensure that test setup properly sets up case 1 and case 2 # Setup @@ -437,7 +462,10 @@

    Source code for CIME.tests.test_unit_compare_two

    self.assertEqual("case1val", mytest._case1.get_value("var_set_in_setup")) self.assertEqual("case2val", mytest._case2.get_value("var_set_in_setup"))
    -
    [docs] def test_setup_separate_builds_sharedlibroot(self): + +
    +[docs] + def test_setup_separate_builds_sharedlibroot(self): # If we're using separate_builds, the two cases should still use # the same sharedlibroot @@ -454,7 +482,10 @@

    Source code for CIME.tests.test_unit_compare_two

    case1.get_value("SHAREDLIBROOT"), mytest._case2.get_value("SHAREDLIBROOT") )
    -
    [docs] def test_setup_case2_exists(self): + +
    +[docs] + def test_setup_case2_exists(self): # If case2 already exists, then setup code should not be called # Setup @@ -478,7 +509,10 @@

    Source code for CIME.tests.test_unit_compare_two

    self.assertIsNone(mytest._case1.get_value("var_set_in_setup")) self.assertIsNone(mytest._case2.get_value("var_set_in_setup"))
    -
    [docs] def test_setup_error(self): + +
    +[docs] + def test_setup_error(self): # If there is an error in setup, an exception should be raised and the # case2 directory should be removed @@ -495,7 +529,10 @@

    Source code for CIME.tests.test_unit_compare_two

    # Verify self.assertFalse(os.path.exists(os.path.join(case1root, "case1.test")))
    -
    [docs] def test_run_phase_passes(self): + +
    +[docs] + def test_run_phase_passes(self): # Make sure the run phase behaves properly when all runs succeed. # Setup @@ -512,7 +549,10 @@

    Source code for CIME.tests.test_unit_compare_two

    mytest._test_status.get_status(test_status.RUN_PHASE), )
    -
    [docs] def test_run_phase_internal_calls(self): + +
    +[docs] + def test_run_phase_internal_calls(self): # Make sure that the correct calls are made to methods stubbed out by # SystemTestsCompareTwoFake (when runs succeed) # @@ -545,7 +585,10 @@

    Source code for CIME.tests.test_unit_compare_two

    ] self.assertEqual(expected_calls, mytest.log)
    -
    [docs] def test_run_phase_internal_calls_multisubmit_phase1(self): + +
    +[docs] + def test_run_phase_internal_calls_multisubmit_phase1(self): # Make sure that the correct calls are made to methods stubbed out by # SystemTestsCompareTwoFake (when runs succeed), when we have a # multi-submit test, in the first phase @@ -582,7 +625,10 @@

    Source code for CIME.tests.test_unit_compare_two

    mytest._test_status.get_status(compare_phase_name), )
    -
    [docs] def test_run_phase_internal_calls_multisubmit_phase2(self): + +
    +[docs] + def test_run_phase_internal_calls_multisubmit_phase2(self): # Make sure that the correct calls are made to methods stubbed out by # SystemTestsCompareTwoFake (when runs succeed), when we have a # multi-submit test, in the second phase @@ -621,7 +667,10 @@

    Source code for CIME.tests.test_unit_compare_two

    mytest._test_status.get_status(compare_phase_name), )
    -
    [docs] def test_internal_calls_multisubmit_failed_state(self): + +
    +[docs] + def test_internal_calls_multisubmit_failed_state(self): run_one_suffix = "base" run_two_suffix = "run2" case1root, _ = self.get_caseroots() @@ -672,7 +721,10 @@

    Source code for CIME.tests.test_unit_compare_two

    self.assertEqual(expected_calls, mytest.log)
    -
    [docs] def test_run1_fails(self): + +
    +[docs] + def test_run1_fails(self): # Make sure that a failure in run1 is reported correctly # Setup @@ -692,7 +744,10 @@

    Source code for CIME.tests.test_unit_compare_two

    mytest._test_status.get_status(test_status.RUN_PHASE), )
    -
    [docs] def test_run2_fails(self): + +
    +[docs] + def test_run2_fails(self): # Make sure that a failure in run2 is reported correctly # Setup @@ -712,7 +767,10 @@

    Source code for CIME.tests.test_unit_compare_two

    mytest._test_status.get_status(test_status.RUN_PHASE), )
    -
    [docs] def test_compare_passes(self): + +
    +[docs] + def test_compare_passes(self): # Make sure that a pass in the comparison is reported correctly # Setup @@ -730,7 +788,10 @@

    Source code for CIME.tests.test_unit_compare_two

    mytest._test_status.get_status(compare_phase_name), )
    -
    [docs] def test_compare_fails(self): + +
    +[docs] + def test_compare_fails(self): # Make sure that a failure in the comparison is reported correctly # Setup @@ -746,7 +807,9 @@

    Source code for CIME.tests.test_unit_compare_two

    self.assertEqual( test_status.TEST_FAIL_STATUS, mytest._test_status.get_status(compare_phase_name), - )
    + )
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_config.html b/versions/master/html/_modules/CIME/tests/test_unit_config.html index 289903cd258..1fd71340259 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_config.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_config.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -91,8 +91,12 @@

    Source code for CIME.tests.test_unit_config

     from CIME.config import Config
     
     
    -
    [docs]class TestConfig(unittest.TestCase): -
    [docs] def test_class_external(self): +
    +[docs] +class TestConfig(unittest.TestCase): +
    +[docs] + def test_class_external(self): with tempfile.TemporaryDirectory() as tempdir: complex_file = os.path.join(tempdir, "01_complex.py") @@ -136,7 +140,10 @@

    Source code for CIME.tests.test_unit_config

                 with self.assertRaises(AttributeError):
                     config.postrun_provenance("test")
    -
    [docs] def test_class(self): + +
    +[docs] + def test_class(self): with tempfile.TemporaryDirectory() as tempdir: test_file = os.path.join(tempdir, "test.py") @@ -171,7 +178,10 @@

    Source code for CIME.tests.test_unit_config

                 with self.assertRaises(AttributeError):
                     config.postrun_provenance("test")
    -
    [docs] def test_load(self): + +
    +[docs] + def test_load(self): with tempfile.TemporaryDirectory() as tempdir: test_file = os.path.join(tempdir, "test.py") @@ -198,7 +208,10 @@

    Source code for CIME.tests.test_unit_config

                 with self.assertRaises(AttributeError):
                     config.postrun_provenance("test")
    -
    [docs] def test_overwrite(self): + +
    +[docs] + def test_overwrite(self): with tempfile.TemporaryDirectory() as tempdir: test_file = os.path.join(tempdir, "test.py") @@ -219,7 +232,9 @@

    Source code for CIME.tests.test_unit_config

     
                 config = Config.load(tempdir)
     
    -            assert config.use_feature1
    + assert config.use_feature1
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_cs_status.html b/versions/master/html/_modules/CIME/tests/test_unit_cs_status.html index a8c1456fbf8..2fb078e3aaa 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_cs_status.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_cs_status.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -97,7 +97,9 @@

    Source code for CIME.tests.test_unit_cs_status

    from CIME.tests.custom_assertions_test_status import CustomAssertionsTestStatus -

    [docs]class TestCsStatus(CustomAssertionsTestStatus): +
    +[docs] +class TestCsStatus(CustomAssertionsTestStatus): # ------------------------------------------------------------------------ # Test helper functions @@ -109,15 +111,23 @@

    Source code for CIME.tests.test_unit_cs_status

    # Another arbitrary phase if we need two different non-core phases _NON_CORE_PHASE2 = test_status.BASELINE_PHASE -

    [docs] def setUp(self): +
    +[docs] + def setUp(self): self._testroot = tempfile.mkdtemp() self._output = io.StringIO()
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): self._output.close() shutil.rmtree(self._testroot, ignore_errors=True)
    -
    [docs] def create_test_dir(self, test_dir): + +
    +[docs] + def create_test_dir(self, test_dir): """Creates the given test directory under testroot. Returns the full path to the created test directory. @@ -126,7 +136,10 @@

    Source code for CIME.tests.test_unit_cs_status

    os.makedirs(fullpath) return fullpath

    -
    [docs] @staticmethod + +
    +[docs] + @staticmethod def create_test_status_core_passes(test_dir_path, test_name): """Creates a TestStatus file in the given path, with PASS status for all core phases""" @@ -134,7 +147,10 @@

    Source code for CIME.tests.test_unit_cs_status

    for phase in test_status.CORE_PHASES: ts.set_status(phase, test_status.TEST_PASS_STATUS)

    -
    [docs] def set_last_core_phase_to_fail(self, test_dir_path, test_name): + +
    +[docs] + def set_last_core_phase_to_fail(self, test_dir_path, test_name): """Sets the last core phase to FAIL Returns the name of this phase""" @@ -147,17 +163,23 @@

    Source code for CIME.tests.test_unit_cs_status

    ) return fail_phase

    -
    [docs] @staticmethod + +
    +[docs] + @staticmethod def set_phase_to_status(test_dir_path, test_name, phase, status): """Sets the given phase to the given status for this test""" with test_status.TestStatus(test_dir=test_dir_path, test_name=test_name) as ts: ts.set_status(phase, status)
    + # ------------------------------------------------------------------------ # Begin actual tests # ------------------------------------------------------------------------ -
    [docs] def test_force_rebuild(self): +
    +[docs] + def test_force_rebuild(self): test_name = "my.test.name" test_dir = "my.test.name.testid" test_dir_path = self.create_test_dir(test_dir) @@ -174,7 +196,10 @@

    Source code for CIME.tests.test_unit_cs_status

    test_name, )

    -
    [docs] def test_single_test(self): + +
    +[docs] + def test_single_test(self): """cs_status for a single test should include some minimal expected output""" test_name = "my.test.name" test_dir = "my.test.name.testid" @@ -183,7 +208,10 @@

    Source code for CIME.tests.test_unit_cs_status

    cs_status([os.path.join(test_dir_path, "TestStatus")], out=self._output) self.assert_core_phases(self._output.getvalue(), test_name, fails=[])

    -
    [docs] def test_two_tests(self): + +
    +[docs] + def test_two_tests(self): """cs_status for two tests (one with a FAIL) should include some minimal expected output""" test_name1 = "my.test.name1" test_name2 = "my.test.name2" @@ -206,7 +234,10 @@

    Source code for CIME.tests.test_unit_cs_status

    self._output.getvalue(), test_name2, fails=[test2_fail_phase] )

    -
    [docs] def test_fails_only(self): + +
    +[docs] + def test_fails_only(self): """With fails_only flag, only fails and pends should appear in the output""" test_name = "my.test.name" test_dir = "my.test.name.testid" @@ -244,7 +275,10 @@

    Source code for CIME.tests.test_unit_cs_status

    ) self.assertNotRegex(self._output.getvalue(), r"Overall:")

    -
    [docs] def test_count_fails(self): + +
    +[docs] + def test_count_fails(self): """Test the count of fails with three tests For first phase of interest: First test FAILs, second PASSes, @@ -316,7 +350,10 @@

    Source code for CIME.tests.test_unit_cs_status

    count_regex2 = r"{} +non-passes: +1".format(re.escape(phase_of_interest2)) self.assertRegex(self._output.getvalue(), count_regex2)

    -
    [docs] def test_expected_fails(self): + +
    +[docs] + def test_expected_fails(self): """With the expected_fails_file flag, expected failures should be flagged as such""" test_name1 = "my.test.name1" test_name2 = "my.test.name2" @@ -381,7 +418,9 @@

    Source code for CIME.tests.test_unit_cs_status

    # Make sure that no other phases are mistakenly labeled as expected failures: self.assert_num_expected_unexpected_fails( self._output.getvalue(), num_expected=1, num_unexpected=0 - )

    + )
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_custom_assertions_test_status.html b/versions/master/html/_modules/CIME/tests/test_unit_custom_assertions_test_status.html index eab5199ef12..56d59dffcf9 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_custom_assertions_test_status.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_custom_assertions_test_status.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,11 +95,15 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    from CIME.tests.custom_assertions_test_status import CustomAssertionsTestStatus -
    [docs]class TestCustomAssertions(CustomAssertionsTestStatus): +
    +[docs] +class TestCustomAssertions(CustomAssertionsTestStatus): _UNEXPECTED_COMMENT = test_status.TEST_UNEXPECTED_FAILURE_COMMENT_START + " blah)" -
    [docs] @staticmethod +
    +[docs] + @staticmethod def output_line(status, test_name, phase, extra=""): output = status + " " + test_name + " " + phase if extra: @@ -107,7 +111,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output += "\n" return output
    -
    [docs] def test_assertPhaseAbsent_passes(self): + +
    +[docs] + def test_assertPhaseAbsent_passes(self): """assert_phase_absent should pass when the phase is absent for the given test_name""" test_name1 = "my.test.name1" @@ -118,7 +125,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    self.assert_phase_absent(output, "PHASE2", test_name1) self.assert_phase_absent(output, "PHASE1", test_name2)
    -
    [docs] def test_assertPhaseAbsent_fails(self): + +
    +[docs] + def test_assertPhaseAbsent_fails(self): """assert_phase_absent should fail when the phase is present for the given test_name""" test_name = "my.test.name" @@ -127,7 +137,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    with self.assertRaises(AssertionError): self.assert_phase_absent(output, "PHASE1", test_name)
    -
    [docs] def test_assertCorePhases_passes(self): + +
    +[docs] + def test_assertCorePhases_passes(self): """assert_core_phases passes when it should""" output = "" fails = [test_status.CORE_PHASES[1]] @@ -141,7 +154,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    self.assert_core_phases(output, test_name, fails)
    -
    [docs] def test_assertCorePhases_missingPhase_fails(self): + +
    +[docs] + def test_assertCorePhases_missingPhase_fails(self): """assert_core_phases fails if there is a missing phase""" output = "" test_name = "my.test.name" @@ -154,7 +170,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    with self.assertRaises(AssertionError): self.assert_core_phases(output, test_name, fails=[])
    -
    [docs] def test_assertCorePhases_wrongStatus_fails(self): + +
    +[docs] + def test_assertCorePhases_wrongStatus_fails(self): """assert_core_phases fails if a phase has the wrong status""" output = "" test_name = "my.test.name" @@ -168,7 +187,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output, test_name, fails=[test_status.CORE_PHASES[1]] )
    -
    [docs] def test_assertCorePhases_wrongName_fails(self): + +
    +[docs] + def test_assertCorePhases_wrongName_fails(self): """assert_core_phases fails if the test name is wrong""" output = "" test_name = "my.test.name" @@ -180,11 +202,14 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    with self.assertRaises(AssertionError): self.assert_core_phases(output, "my.test", fails=[])
    + # Note: Basic functionality of assert_status_of_phase is covered sufficiently via # tests of assert_core_phases. Below we just cover some other aspects that aren't # already covered. -
    [docs] def test_assertStatusOfPhase_withExtra_passes(self): +
    +[docs] + def test_assertStatusOfPhase_withExtra_passes(self): """Make sure assert_status_of_phase passes when there is some extra text at the end of the line""" test_name = "my.test.name" @@ -198,7 +223,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output, test_status.TEST_FAIL_STATUS, test_status.CORE_PHASES[0], test_name )
    -
    [docs] def test_assertStatusOfPhase_xfailNo_passes(self): + +
    +[docs] + def test_assertStatusOfPhase_xfailNo_passes(self): """assert_status_of_phase should pass when xfail='no' and there is no EXPECTED/UNEXPECTED on the line""" test_name = "my.test.name" @@ -217,7 +245,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output, num_expected=0, num_unexpected=0 )
    -
    [docs] def test_assertStatusOfPhase_xfailNo_fails(self): + +
    +[docs] + def test_assertStatusOfPhase_xfailNo_fails(self): """assert_status_of_phase should fail when xfail='no' but the line contains the EXPECTED comment""" test_name = "my.test.name" @@ -241,7 +272,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output, num_expected=1, num_unexpected=0 )
    -
    [docs] def test_assertStatusOfPhase_xfailExpected_passes(self): + +
    +[docs] + def test_assertStatusOfPhase_xfailExpected_passes(self): """assert_status_of_phase should pass when xfail='expected' and the line contains the EXPECTED comment""" test_name = "my.test.name" @@ -263,7 +297,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output, num_expected=1, num_unexpected=0 )
    -
    [docs] def test_assertStatusOfPhase_xfailExpected_fails(self): + +
    +[docs] + def test_assertStatusOfPhase_xfailExpected_fails(self): """assert_status_of_phase should fail when xfail='expected' but the line does NOT contain the EXPECTED comment""" test_name = "my.test.name" @@ -291,7 +328,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output, num_expected=0, num_unexpected=1 )
    -
    [docs] def test_assertStatusOfPhase_xfailUnexpected_passes(self): + +
    +[docs] + def test_assertStatusOfPhase_xfailUnexpected_passes(self): """assert_status_of_phase should pass when xfail='unexpected' and the line contains the UNEXPECTED comment""" test_name = "my.test.name" @@ -313,7 +353,10 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    output, num_expected=0, num_unexpected=1 )
    -
    [docs] def test_assertStatusOfPhase_xfailUnexpected_fails(self): + +
    +[docs] + def test_assertStatusOfPhase_xfailUnexpected_fails(self): """assert_status_of_phase should fail when xfail='unexpected' but the line does NOT contain the UNEXPECTED comment""" test_name = "my.test.name" @@ -339,7 +382,9 @@

    Source code for CIME.tests.test_unit_custom_assertions_test_status

    # While we're at it, also test assert_num_expected_unexpected_fails self.assert_num_expected_unexpected_fails( output, num_expected=1, num_unexpected=0 - )
    + )
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_doctest.html b/versions/master/html/_modules/CIME/tests/test_unit_doctest.html index 9e00e7eb711..e9f6b65e821 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_doctest.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_doctest.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -101,8 +101,12 @@

    Source code for CIME.tests.test_unit_doctest

    from CIME.tests import base
     
     
    -
    [docs]class TestDocs(base.BaseTestCase): -
    [docs] def test_lib_docs(self): +
    +[docs] +class TestDocs(base.BaseTestCase): +
    +[docs] + def test_lib_docs(self): cime_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) ignore_patterns = [ @@ -123,7 +127,9 @@

    Source code for CIME.tests.test_unit_doctest

    self.run_cmd_assert_result(
                         f"PYTHONPATH={cime_root}:$PYTHONPATH python3 -m doctest {filepath} 2>&1",
                         from_dir=cime_root,
    -                )
    + )
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_expected_fails_file.html b/versions/master/html/_modules/CIME/tests/test_unit_expected_fails_file.html index 69ce34f7221..ef28d17ac59 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_expected_fails_file.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_expected_fails_file.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,15 +95,25 @@

    Source code for CIME.tests.test_unit_expected_fails_file

    from CIME.expected_fails import ExpectedFails -
    [docs]class TestExpectedFailsFile(unittest.TestCase): -
    [docs] def setUp(self): +
    +[docs] +class TestExpectedFailsFile(unittest.TestCase): +
    +[docs] + def setUp(self): self._workdir = tempfile.mkdtemp() self._xml_filepath = os.path.join(self._workdir, "expected_fails.xml")
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): shutil.rmtree(self._workdir)
    -
    [docs] def test_basic(self): + +
    +[docs] + def test_basic(self): """Basic test of the parsing of an expected fails file""" contents = """<?xml version= "1.0"?> <expectedFails version="1.1"> @@ -145,7 +155,10 @@

    Source code for CIME.tests.test_unit_expected_fails_file

    self.assertEqual(xfails, expected)
    -
    [docs] def test_same_test_appears_twice(self): + +
    +[docs] + def test_same_test_appears_twice(self): """If the same test appears twice, its information should be appended. This is not the typical, expected layout of the file, but it should be handled @@ -180,7 +193,10 @@

    Source code for CIME.tests.test_unit_expected_fails_file

    self.assertEqual(xfails, expected)
    -
    [docs] def test_invalid_file(self): + +
    +[docs] + def test_invalid_file(self): """Given an invalid file, an exception should be raised in schema validation""" # This file is missing a <status> element in the <phase> block. @@ -199,7 +215,9 @@

    Source code for CIME.tests.test_unit_expected_fails_file

    xml_file.write(contents) with self.assertRaisesRegex(CIMEError, "Schemas validity error"): - _ = ExpectedFailsFile(self._xml_filepath)
    + _ = ExpectedFailsFile(self._xml_filepath)
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_grids.html b/versions/master/html/_modules/CIME/tests/test_unit_grids.html index 9ac4a751b27..a70633ce1c6 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_grids.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_grids.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -108,7 +108,9 @@

    Source code for CIME.tests.test_unit_grids

     from CIME.utils import CIMEError
     
     
    -
    [docs]class TestGrids(unittest.TestCase): +
    +[docs] +class TestGrids(unittest.TestCase): """Tests some functionality of CIME.XML.grids Note that much of the functionality of CIME.XML.grids is NOT covered here @@ -264,13 +266,19 @@

    Source code for CIME.tests.test_unit_grids

         </gridmap>
     """
     
    -
    [docs] def setUp(self): +
    +[docs] + def setUp(self): self._workdir = tempfile.mkdtemp() self._xml_filepath = os.path.join(self._workdir, "config_grids.xml")
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): shutil.rmtree(self._workdir)
    + def _create_grids_xml( self, model_grid_entries, @@ -289,7 +297,9 @@

    Source code for CIME.tests.test_unit_grids

             with open(self._xml_filepath, "w", encoding="UTF-8") as xml_file:
                 xml_file.write(grids_xml)
     
    -
    [docs] def assert_grid_info_f09_g17(self, grid_info): +
    +[docs] + def assert_grid_info_f09_g17(self, grid_info): """Asserts that expected grid info is present and correct when using _MODEL_GRID_F09_G17""" self.assertEqual(grid_info["ATM_NX"], 288) self.assertEqual(grid_info["ATM_NY"], 192) @@ -319,7 +329,10 @@

    Source code for CIME.tests.test_unit_grids

             )
             self.assertFalse("OCN2ATM_SHOULDBEABSENT" in grid_info)
    -
    [docs] def assert_grid_info_f09_g17_3glc(self, grid_info): + +
    +[docs] + def assert_grid_info_f09_g17_3glc(self, grid_info): """Asserts that all domain info is present & correct for _MODEL_GRID_F09_G17_3GLC""" self.assert_grid_info_f09_g17(grid_info) @@ -339,7 +352,10 @@

    Source code for CIME.tests.test_unit_grids

                 "map_ais8_to_gx1v7_ice.nc:map_gris4_to_gx1v7_ice.nc:map_lis12_to_gx1v7_ice.nc",
             )
    -
    [docs] def test_get_grid_info_basic(self): + +
    +[docs] + def test_get_grid_info_basic(self): """Basic test of get_grid_info""" model_grid_entries = self._MODEL_GRID_F09_G17 domain_entries = self._DOMAIN_F09 + self._DOMAIN_G17 @@ -359,7 +375,10 @@

    Source code for CIME.tests.test_unit_grids

     
             self.assert_grid_info_f09_g17(grid_info)
    -
    [docs] def test_get_grid_info_extra_required_gridmaps(self): + +
    +[docs] + def test_get_grid_info_extra_required_gridmaps(self): """Test of get_grid_info with some extra required gridmaps""" model_grid_entries = self._MODEL_GRID_F09_G17 domain_entries = self._DOMAIN_F09 + self._DOMAIN_G17 @@ -387,7 +406,10 @@

    Source code for CIME.tests.test_unit_grids

             self.assertEqual(grid_info["ATM2OCN_EXTRA"], "unset")
             self.assertEqual(grid_info["OCN2ATM_EXTRA"], "unset")
    -
    [docs] def test_get_grid_info_extra_gridmaps(self): + +
    +[docs] + def test_get_grid_info_extra_gridmaps(self): """Test of get_grid_info with some extra gridmaps""" model_grid_entries = self._MODEL_GRID_F09_G17 domain_entries = self._DOMAIN_F09 + self._DOMAIN_G17 @@ -416,7 +438,10 @@

    Source code for CIME.tests.test_unit_grids

             self.assertEqual(grid_info["ATM2OCN_EXTRA"], "map_fv0.9x1.25_TO_gx1v7_extra.nc")
             self.assertEqual(grid_info["OCN2ATM_EXTRA"], "map_gx1v7_TO_fv0.9x1.25_extra.nc")
    -
    [docs] def test_get_grid_info_3glc(self): + +
    +[docs] + def test_get_grid_info_3glc(self): """Test of get_grid_info with 3 glc grids""" model_grid_entries = self._MODEL_GRID_F09_G17_3GLC domain_entries = ( @@ -452,10 +477,14 @@

    Source code for CIME.tests.test_unit_grids

             )
     
             self.assert_grid_info_f09_g17_3glc(grid_info)
    -        self.assertEqual(grid_info["GLC2ATM_EXTRA"], "unset")
    + self.assertEqual(grid_info["GLC2ATM_EXTRA"], "unset")
    +
    + -
    [docs]class TestComponentGrids(unittest.TestCase): +
    +[docs] +class TestComponentGrids(unittest.TestCase): """Tests the _ComponentGrids helper class defined in CIME.XML.grids""" # A valid grid long name used in a lot of these tests; there are two rof grids and @@ -472,7 +501,9 @@

    Source code for CIME.tests.test_unit_grids

         # TestGrids class.
         # ------------------------------------------------------------------------
     
    -
    [docs] def test_check_num_elements_right_ndomains(self): +
    +[docs] + def test_check_num_elements_right_ndomains(self): """With the right number of domains for a component, check_num_elements should pass""" component_grids = _ComponentGrids(self._GRID_LONGNAME) gridinfo = {"GLC_DOMAIN_MESH": "foo:bar:baz"} @@ -480,7 +511,10 @@

    Source code for CIME.tests.test_unit_grids

             # The test passes as long as the following call doesn't generate any errors
             component_grids.check_num_elements(gridinfo)
    -
    [docs] def test_check_num_elements_wrong_ndomains(self): + +
    +[docs] + def test_check_num_elements_wrong_ndomains(self): """With the wrong number of domains for a component, check_num_elements should fail""" component_grids = _ComponentGrids(self._GRID_LONGNAME) # In the following, there should be 3 elements, but we only specify 2 @@ -493,7 +527,10 @@

    Source code for CIME.tests.test_unit_grids

                 gridinfo,
             )
    -
    [docs] def test_check_num_elements_right_nmaps(self): + +
    +[docs] + def test_check_num_elements_right_nmaps(self): """With the right number of maps between two components, check_num_elements should pass""" component_grids = _ComponentGrids(self._GRID_LONGNAME) gridinfo = {"GLC2ROF_RMAPNAME": "map1:map2:map3:map4:map5:map6"} @@ -501,7 +538,10 @@

    Source code for CIME.tests.test_unit_grids

             # The test passes as long as the following call doesn't generate any errors
             component_grids.check_num_elements(gridinfo)
    -
    [docs] def test_check_num_elements_wrong_nmaps(self): + +
    +[docs] + def test_check_num_elements_wrong_nmaps(self): """With the wrong number of maps between two components, check_num_elements should fail""" component_grids = _ComponentGrids(self._GRID_LONGNAME) # In the following, there should be 6 elements, but we only specify 5 @@ -512,10 +552,14 @@

    Source code for CIME.tests.test_unit_grids

                 "Unexpected number of colon-delimited elements",
                 component_grids.check_num_elements,
                 gridinfo,
    -        )
    + )
    +
    -
    [docs]class TestGridsFunctions(unittest.TestCase): + +
    +[docs] +class TestGridsFunctions(unittest.TestCase): """Tests helper functions defined in CIME.XML.grids These tests are in a separate class to avoid the unnecessary setUp and tearDown @@ -527,38 +571,54 @@

    Source code for CIME.tests.test_unit_grids

         # Tests of _add_grid_info
         # ------------------------------------------------------------------------
     
    -
    [docs] def test_add_grid_info_initial(self): +
    +[docs] + def test_add_grid_info_initial(self): """Test of _add_grid_info for the initial add of a given key""" grid_info = {"foo": "a"} _add_grid_info(grid_info, "bar", "b") self.assertEqual(grid_info, {"foo": "a", "bar": "b"})
    -
    [docs] def test_add_grid_info_existing(self): + +
    +[docs] + def test_add_grid_info_existing(self): """Test of _add_grid_info when the given key already exists""" grid_info = {"foo": "bar"} _add_grid_info(grid_info, "foo", "baz") self.assertEqual(grid_info, {"foo": "bar:baz"})
    -
    [docs] def test_add_grid_info_existing_with_value_for_multiple(self): + +
    +[docs] + def test_add_grid_info_existing_with_value_for_multiple(self): """Test of _add_grid_info when the given key already exists and value_for_multiple is provided""" grid_info = {"foo": 1} _add_grid_info(grid_info, "foo", 2, value_for_multiple=0) self.assertEqual(grid_info, {"foo": 0})
    + # ------------------------------------------------------------------------ # Tests of strip_grid_from_name # ------------------------------------------------------------------------ -
    [docs] def test_strip_grid_from_name_basic(self): +
    +[docs] + def test_strip_grid_from_name_basic(self): """Basic test of _strip_grid_from_name""" result = _strip_grid_from_name("atm_grid") self.assertEqual(result, "atm")
    -
    [docs] def test_strip_grid_from_name_badname(self): + +
    +[docs] + def test_strip_grid_from_name_badname(self): """_strip_grid_from_name should raise an exception for a name not ending with _grid""" self.assertRaisesRegex( CIMEError, "does not end with _grid", _strip_grid_from_name, name="atm" - )
    + )
    +
    + # ------------------------------------------------------------------------ # Tests of _check_grid_info_component_counts diff --git a/versions/master/html/_modules/CIME/tests/test_unit_hist_utils.html b/versions/master/html/_modules/CIME/tests/test_unit_hist_utils.html index 564e6aed65b..72090f3f982 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_hist_utils.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_hist_utils.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -92,8 +92,12 @@

    Source code for CIME.tests.test_unit_hist_utils

    < from CIME.XML.archive import Archive -
    [docs]class TestHistUtils(unittest.TestCase): -
    [docs] @mock.patch("CIME.hist_utils.safe_copy") +
    +[docs] +class TestHistUtils(unittest.TestCase): +
    +[docs] + @mock.patch("CIME.hist_utils.safe_copy") def test_copy_histfiles_exclude(self, safe_copy): case = mock.MagicMock() @@ -123,7 +127,10 @@

    Source code for CIME.tests.test_unit_hist_utils

    < assert num_copied == 1
    -
    [docs] @mock.patch("CIME.hist_utils.safe_copy") + +
    +[docs] + @mock.patch("CIME.hist_utils.safe_copy") def test_copy_histfiles(self, safe_copy): case = mock.MagicMock() @@ -149,7 +156,9 @@

    Source code for CIME.tests.test_unit_hist_utils

    < with mock.patch("os.listdir", return_value=test_files): comments, num_copied = copy_histfiles(case, "base") - assert num_copied == 1
    + assert num_copied == 1
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_nmlgen.html b/versions/master/html/_modules/CIME/tests/test_unit_nmlgen.html index c8597ac0e76..dd115ab56e6 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_nmlgen.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_nmlgen.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -92,8 +92,12 @@

    Source code for CIME.tests.test_unit_nmlgen

     from CIME.nmlgen import NamelistGenerator
     
     # pylint: disable=protected-access
    -
    [docs]class TestNamelistGenerator(unittest.TestCase): -
    [docs] def test_init_defaults(self): +
    +[docs] +class TestNamelistGenerator(unittest.TestCase): +
    +[docs] + def test_init_defaults(self): test_nml_infile = b"""&test test1 = 'test1_updated' /""" @@ -138,7 +142,9 @@

    Source code for CIME.tests.test_unit_nmlgen

                     {"test_nml": {"test1": ["'test1_updated'"], "test2": ['"test2_value"']}}
                 )
     
    -            assert nmlgen._namelist._groups == expected_groups
    + assert nmlgen._namelist._groups == expected_groups
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_paramgen.html b/versions/master/html/_modules/CIME/tests/test_unit_paramgen.html index 0c1ce1a9921..0c0e19b4e32 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_paramgen.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_paramgen.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -210,16 +210,22 @@

    Source code for CIME.tests.test_unit_paramgen

    ############################ -
    [docs]class DummyCase: +
    +[docs] +class DummyCase: """A dummy Case class that mimics CIME class objects' get_value method.""" -
    [docs] def get_value(self, varname): +
    +[docs] + def get_value(self, varname): d = { "DIN_LOC_ROOT": "/foo/inputdata", "OCN_GRID": "tx0.66v1", "COMP_ATM": "datm", } - return d[varname] if varname in d else None
    + return d[varname] if varname in d else None
    +
    + case = DummyCase() @@ -243,13 +249,17 @@

    Source code for CIME.tests.test_unit_paramgen

    ################ -
    [docs]class TestParamGen(unittest.TestCase): +
    +[docs] +class TestParamGen(unittest.TestCase): """ Tests some basic functionality of the CIME.ParamGen.paramgen's ParamGen class """ -
    [docs] def test_init_data(self): +
    +[docs] + def test_init_data(self): """Tests the ParamGen initializer with and without an initial data.""" # empty _ = ParamGen({}) @@ -257,21 +267,30 @@

    Source code for CIME.tests.test_unit_paramgen

    data_dict = {"a": 1, "b": 2} _ = ParamGen(data_dict)
    -
    [docs] def test_reduce(self): + +
    +[docs] + def test_reduce(self): """Tests the reduce method of ParamGen on data with explicit guards (True or False).""" data_dict = {"False": 1, "True": 2} obj = ParamGen(data_dict) obj.reduce() self.assertEqual(obj.data, 2)
    -
    [docs] def test_nested_reduce(self): + +
    +[docs] + def test_nested_reduce(self): """Tests the reduce method of ParamGen on data with nested guards.""" data_dict = {"False": 1, "True": {"2>3": 0, "2<3": 2}} obj = ParamGen(data_dict) obj.reduce() self.assertEqual(obj.data, 2)
    -
    [docs] def test_outer_guards(self): + +
    +[docs] + def test_outer_guards(self): """Tests the reduce method on data with outer guards enclosing parameter definitions.""" data_dict = { "False": {"param": "foo"}, @@ -281,7 +300,10 @@

    Source code for CIME.tests.test_unit_paramgen

    obj.reduce() self.assertEqual(obj.data, {"param": "bar"})
    -
    [docs] def test_match(self): + +
    +[docs] + def test_match(self): """Tests the default behavior of returning the last match and the optional behavior of returning the first match.""" @@ -299,7 +321,10 @@

    Source code for CIME.tests.test_unit_paramgen

    obj.reduce() self.assertEqual(obj.data, "foo")
    -
    [docs] def test_undefined_var(self): + +
    +[docs] + def test_undefined_var(self): """Tests the reduce method of ParamGen on nested guards where an undefined expandable var is specified below a guard that evaluates to False. The undefined var should not lead to an error since the enclosing guard evaluates to false.""" @@ -316,7 +341,10 @@

    Source code for CIME.tests.test_unit_paramgen

    obj.reduce(expand_func) self.assertEqual(obj.data, {"param": "foo"})
    -
    [docs] def test_expandable_vars(self): + +
    +[docs] + def test_expandable_vars(self): """Tests the reduce method of ParamGen expandable vars in guards.""" # define an expansion function, i.e., a mapping for expandable var names to their values @@ -333,7 +361,10 @@

    Source code for CIME.tests.test_unit_paramgen

    obj.reduce(expand_func) self.assertEqual(obj.data, {"param": "baz"})
    -
    [docs] def test_formula_expansion(self): + +
    +[docs] + def test_formula_expansion(self): """Tests the formula expansion feature of ParamGen.""" # define an expansion function, i.e., a mapping for expandable var names to their values @@ -347,16 +378,22 @@

    Source code for CIME.tests.test_unit_paramgen

    obj = ParamGen(data_dict) obj.reduce(expand_func) self.assertEqual(obj.data["x"], 9) - self.assertEqual(obj.data["y"], [0, 1, 2])
    + self.assertEqual(obj.data["y"], [0, 1, 2])
    +
    + ##### -
    [docs]class TestParamGenYamlConstructor(unittest.TestCase): +
    +[docs] +class TestParamGenYamlConstructor(unittest.TestCase): """A unit test class for testing ParamGen's yaml constructor.""" -
    [docs] def test_mom_input(self): +
    +[docs] + def test_mom_input(self): """Test MOM_input file generation via a subset of original MOM_input.yaml""" # Create temporary YAML file: @@ -394,7 +431,10 @@

    Source code for CIME.tests.test_unit_paramgen

    }, )
    -
    [docs] def test_input_data_list(self): + +
    +[docs] + def test_input_data_list(self): """Test mom.input_data_list file generation via a subset of original input_data_list.yaml""" # Create temporary YAML file: @@ -437,16 +477,22 @@

    Source code for CIME.tests.test_unit_paramgen

    "tempsalt": "/foo/inputdata/ocn/mom/tx0.66v1/woa18_04_initial_conditions.nc", } }, - )
    + )
    +
    + ##### -
    [docs]class TestParamGenXmlConstructor(unittest.TestCase): +
    +[docs] +class TestParamGenXmlConstructor(unittest.TestCase): """A unit test class for testing ParamGen's xml constructor.""" -
    [docs] def test_single_key_val_guard(self): +
    +[docs] + def test_single_key_val_guard(self): """Test xml entry values with single key=value guards""" # Create temporary YAML file: @@ -463,7 +509,10 @@

    Source code for CIME.tests.test_unit_paramgen

    # Check output: self.assertEqual(pg.data["test_nml"]["foo"]["values"], "beta")
    -
    [docs] def test_mixed_guard(self): + +
    +[docs] + def test_mixed_guard(self): """Tests multiple key=value guards mixed with explicit (flexible) guards.""" # Create temporary YAML file: @@ -480,7 +529,10 @@

    Source code for CIME.tests.test_unit_paramgen

    # Check output: self.assertEqual(pg.data["test_nml"]["bar"]["values"], "epsilon")
    -
    [docs] def test_mixed_guard_first(self): + +
    +[docs] + def test_mixed_guard_first(self): """Tests multiple key=value guards mixed with explicit (flexible) guards with match=first option.""" @@ -498,7 +550,10 @@

    Source code for CIME.tests.test_unit_paramgen

    # Check output: self.assertEqual(pg.data["test_nml"]["bar"]["values"], "delta")
    -
    [docs] def test_no_match(self): + +
    +[docs] + def test_no_match(self): """Tests an xml entry with no match, i.e., no guards evaluating to True.""" # Create temporary YAML file: @@ -515,7 +570,10 @@

    Source code for CIME.tests.test_unit_paramgen

    # Check output: self.assertEqual(pg.data["test_nml"]["baz"]["values"], None)
    -
    [docs] def test_default_var(self): + +
    +[docs] + def test_default_var(self): """Test to check if default val is assigned when all guards eval to False""" # Create temporary YAML file: @@ -532,7 +590,10 @@

    Source code for CIME.tests.test_unit_paramgen

    # Check output: self.assertEqual(pg.data["test_nml"]["foo"]["values"], "alpha")
    -
    [docs] def test_duplicate_entry_error(self): + +
    +[docs] + def test_duplicate_entry_error(self): """ Test to make sure duplicate ids raise the correct error when the "no_duplicates" flag is True. @@ -547,7 +608,9 @@

    Source code for CIME.tests.test_unit_paramgen

    _ = ParamGen.from_xml_nml(temp.name, no_duplicates=True) emsg = "Entry id 'foo' listed twice in file:\n'./xml_test_files/duplicate_ids.xml'" - self.assertEqual(emsg, str(verr.exception))
    + self.assertEqual(emsg, str(verr.exception))
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_system_tests.html b/versions/master/html/_modules/CIME/tests/test_unit_system_tests.html index a3c79f302d1..5048ca90a50 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_system_tests.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_system_tests.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -87,18 +87,563 @@

    Source code for CIME.tests.test_unit_system_tests

    #!/usr/bin/env python3 import os +import tempfile +import gzip from re import A import unittest from unittest import mock from pathlib import Path +from CIME.config import Config from CIME.SystemTests.system_tests_common import SystemTestsCommon from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo from CIME.SystemTests.system_tests_compare_n import SystemTestsCompareN +CPLLOG = """ + tStamp_write: model date = 00010102 0 wall clock = 2023-09-19 19:39:42 avg dt = 0.33 dt = 0.33 + memory_write: model date = 00010102 0 memory = 1673.89 MB (highwater) 387.77 MB (usage) (pe= 0 comps= cpl ATM LND ICE OCN GLC ROF WAV IAC ESP) + tStamp_write: model date = 00010103 0 wall clock = 2023-09-19 19:39:42 avg dt = 0.33 dt = 0.33 + memory_write: model date = 00010103 0 memory = 1673.89 MB (highwater) 390.09 MB (usage) (pe= 0 comps= cpl ATM LND ICE OCN GLC ROF WAV IAC ESP) + tStamp_write: model date = 00010104 0 wall clock = 2023-09-19 19:39:42 avg dt = 0.33 dt = 0.33 + memory_write: model date = 00010104 0 memory = 1673.89 MB (highwater) 391.64 MB (usage) (pe= 0 comps= cpl ATM LND ICE OCN GLC ROF WAV IAC ESP) + tStamp_write: model date = 00010105 0 wall clock = 2023-09-19 19:39:43 avg dt = 0.33 dt = 0.33 + memory_write: model date = 00010105 0 memory = 1673.89 MB (highwater) 392.67 MB (usage) (pe= 0 comps= cpl ATM LND ICE OCN GLC ROF WAV IAC ESP) + tStamp_write: model date = 00010106 0 wall clock = 2023-09-19 19:39:43 avg dt = 0.33 dt = 0.33 + memory_write: model date = 00010106 0 memory = 1673.89 MB (highwater) 393.44 MB (usage) (pe= 0 comps= cpl ATM LND ICE OCN GLC ROF WAV IAC ESP) + +(seq_mct_drv): =============== SUCCESSFUL TERMINATION OF CPL7-e3sm =============== +(seq_mct_drv): =============== at YMD,TOD = 00010106 0 =============== +(seq_mct_drv): =============== # simulated days (this run) = 5.000 =============== +(seq_mct_drv): =============== compute time (hrs) = 0.000 =============== +(seq_mct_drv): =============== # simulated years / cmp-day = 719.635 =============== +(seq_mct_drv): =============== pes min memory highwater (MB) 851.957 =============== +(seq_mct_drv): =============== pes max memory highwater (MB) 1673.891 =============== +(seq_mct_drv): =============== pes min memory last usage (MB) 182.742 =============== +(seq_mct_drv): =============== pes max memory last usage (MB) 393.441 =============== +""" + + +
    +[docs] +def create_mock_case(tempdir, idx=None, cpllog_data=None): + if idx is None: + idx = 0 + + case = mock.MagicMock() + + caseroot = Path(tempdir, str(idx), "caseroot") + baseline_root = caseroot.parent / "baselines" + run_dir = caseroot / "run" + run_dir.mkdir(parents=True, exist_ok=False) + + if cpllog_data is not None: + cpllog = run_dir / "cpl.log.gz" + + with gzip.open(cpllog, "w") as fd: + fd.write(cpllog_data.encode("utf-8")) + + case.get_latest_cpl_log.return_value = str(cpllog) + + hist_file = run_dir / "cpl.hi.2023-01-01.nc" + hist_file.touch() + + case.get_env.return_value.get_latest_hist_files.return_value = [str(hist_file)] + + case.get_compset_components.return_value = [] + + return case, caseroot, baseline_root, run_dir
    + + + +
    +[docs] +class TestUnitSystemTests(unittest.TestCase): +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.load_coupler_customization") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + @mock.patch("CIME.SystemTests.system_tests_common._perf_get_memory") + @mock.patch("CIME.SystemTests.system_tests_common.get_latest_cpl_logs") + def test_check_for_memleak_runtime_error( + self, + get_latest_cpl_logs, + _perf_get_memory, + append_testlog, + load_coupler_customization, + ): + load_coupler_customization.return_value.perf_check_for_memory_leak.side_effect = ( + AttributeError + ) + + _perf_get_memory.side_effect = RuntimeError + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + rundir = caseroot / "run" + rundir.mkdir(parents=True, exist_ok=False) + + cpllog = rundir / "cpl.log.gz" + + get_latest_cpl_logs.return_value = [ + str(cpllog), + ] + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + 0.01, + ) + + common = SystemTestsCommon(case) + + common._test_status = mock.MagicMock() + + common._check_for_memleak() + + common._test_status.set_status.assert_any_call( + "MEMLEAK", "PASS", comments="insufficient data for memleak test" + ) + + append_testlog.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.load_coupler_customization") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + @mock.patch("CIME.SystemTests.system_tests_common._perf_get_memory") + @mock.patch("CIME.SystemTests.system_tests_common.get_latest_cpl_logs") + def test_check_for_memleak_not_enough_samples( + self, + get_latest_cpl_logs, + _perf_get_memory, + append_testlog, + load_coupler_customization, + ): + load_coupler_customization.return_value.perf_check_for_memory_leak.side_effect = ( + AttributeError + ) + + _perf_get_memory.return_value = [ + (1, 1000.0), + (2, 0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + rundir = caseroot / "run" + rundir.mkdir(parents=True, exist_ok=False) + + cpllog = rundir / "cpl.log.gz" + + get_latest_cpl_logs.return_value = [ + str(cpllog), + ] + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + 0.01, + ) + + common = SystemTestsCommon(case) + + common._test_status = mock.MagicMock() + + common._check_for_memleak() + + common._test_status.set_status.assert_any_call( + "MEMLEAK", "PASS", comments="data for memleak test is insufficient" + ) + + append_testlog.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.load_coupler_customization") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + @mock.patch("CIME.SystemTests.system_tests_common._perf_get_memory") + @mock.patch("CIME.SystemTests.system_tests_common.get_latest_cpl_logs") + def test_check_for_memleak_found( + self, + get_latest_cpl_logs, + _perf_get_memory, + append_testlog, + load_coupler_customization, + ): + load_coupler_customization.return_value.perf_check_for_memory_leak.side_effect = ( + AttributeError + ) + + _perf_get_memory.return_value = [ + (1, 1000.0), + (2, 2000.0), + (3, 3000.0), + (4, 3000.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + rundir = caseroot / "run" + rundir.mkdir(parents=True, exist_ok=False) + + cpllog = rundir / "cpl.log.gz" + + get_latest_cpl_logs.return_value = [ + str(cpllog), + ] + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + 0.01, + ) + + common = SystemTestsCommon(case) + + common._test_status = mock.MagicMock() + + common._check_for_memleak() + + expected_comment = "memleak detected, memory went from 2000.000000 to 3000.000000 in 2 days" + + common._test_status.set_status.assert_any_call( + "MEMLEAK", "FAIL", comments=expected_comment + ) + + append_testlog.assert_any_call(expected_comment, str(caseroot))
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.load_coupler_customization") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + @mock.patch("CIME.SystemTests.system_tests_common._perf_get_memory") + @mock.patch("CIME.SystemTests.system_tests_common.get_latest_cpl_logs") + def test_check_for_memleak( + self, + get_latest_cpl_logs, + _perf_get_memory, + append_testlog, + load_coupler_customization, + ): + load_coupler_customization.return_value.perf_check_for_memory_leak.side_effect = ( + AttributeError + ) + + _perf_get_memory.return_value = [ + (1, 3040.0), + (2, 3002.0), + (3, 3030.0), + (4, 3008.0), + ] + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + rundir = caseroot / "run" + rundir.mkdir(parents=True, exist_ok=False) + + cpllog = rundir / "cpl.log.gz" + + get_latest_cpl_logs.return_value = [ + str(cpllog), + ] + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + 0.01, + ) + + common = SystemTestsCommon(case) + + common._test_status = mock.MagicMock() -
    [docs]class TestCaseSubmit(unittest.TestCase): -
    [docs] def test_kwargs(self): + common._check_for_memleak() + + common._test_status.set_status.assert_any_call( + "MEMLEAK", "PASS", comments="" + ) + + append_testlog.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.perf_compare_throughput_baseline") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + def test_compare_throughput(self, append_testlog, perf_compare_throughput_baseline): + perf_compare_throughput_baseline.return_value = ( + True, + "TPUTCOMP: Computation time changed by 2.00% relative to baseline", + ) + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(Path(tempdir) / "caseroot"), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + ) + + common = SystemTestsCommon(case) + + common._compare_throughput() + + assert common._test_status.get_overall_test_status() == ("PASS", None) + + append_testlog.assert_any_call( + "TPUTCOMP: Computation time changed by 2.00% relative to baseline", + str(caseroot), + )
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.perf_compare_throughput_baseline") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + def test_compare_throughput_error_diff( + self, append_testlog, perf_compare_throughput_baseline + ): + perf_compare_throughput_baseline.return_value = (None, "Error diff value") + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(Path(tempdir) / "caseroot"), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + ) + + common = SystemTestsCommon(case) + + common._compare_throughput() + + assert common._test_status.get_overall_test_status() == ("PASS", None) + + append_testlog.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.perf_compare_throughput_baseline") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + def test_compare_throughput_fail( + self, append_testlog, perf_compare_throughput_baseline + ): + perf_compare_throughput_baseline.return_value = ( + False, + "Error: TPUTCOMP: Computation time increase > 5% from baseline", + ) + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(Path(tempdir) / "caseroot"), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + ) + + common = SystemTestsCommon(case) + + common._compare_throughput() + + assert common._test_status.get_overall_test_status() == ("PASS", None) + + append_testlog.assert_any_call( + "Error: TPUTCOMP: Computation time increase > 5% from baseline", + str(caseroot), + )
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.perf_compare_memory_baseline") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + def test_compare_memory(self, append_testlog, perf_compare_memory_baseline): + perf_compare_memory_baseline.return_value = ( + True, + "MEMCOMP: Memory usage highwater has changed by 2.00% relative to baseline", + ) + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + ) + + common = SystemTestsCommon(case) + + common._compare_memory() + + assert common._test_status.get_overall_test_status() == ("PASS", None) + + append_testlog.assert_any_call( + "MEMCOMP: Memory usage highwater has changed by 2.00% relative to baseline", + str(caseroot), + )
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.perf_compare_memory_baseline") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + def test_compare_memory_erorr_diff( + self, append_testlog, perf_compare_memory_baseline + ): + perf_compare_memory_baseline.return_value = (None, "Error diff value") + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + ) + + common = SystemTestsCommon(case) + + common._compare_memory() + + assert common._test_status.get_overall_test_status() == ("PASS", None) + + append_testlog.assert_not_called()
    + + +
    +[docs] + @mock.patch("CIME.SystemTests.system_tests_common.perf_compare_memory_baseline") + @mock.patch("CIME.SystemTests.system_tests_common.append_testlog") + def test_compare_memory_erorr_fail( + self, append_testlog, perf_compare_memory_baseline + ): + perf_compare_memory_baseline.return_value = ( + False, + "Error: Memory usage increase >5% from baseline's 1000.000000 to 1002.000000", + ) + + with tempfile.TemporaryDirectory() as tempdir: + caseroot = Path(tempdir) / "caseroot" + caseroot.mkdir(parents=True, exist_ok=False) + + case = mock.MagicMock() + case.get_value.side_effect = ( + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + ) + + common = SystemTestsCommon(case) + + common._compare_memory() + + assert common._test_status.get_overall_test_status() == ("PASS", None) + + append_testlog.assert_any_call( + "Error: Memory usage increase >5% from baseline's 1000.000000 to 1002.000000", + str(caseroot), + )
    + + +
    +[docs] + def test_generate_baseline(self): + with tempfile.TemporaryDirectory() as tempdir: + case, caseroot, baseline_root, run_dir = create_mock_case( + tempdir, cpllog_data=CPLLOG + ) + + get_value_calls = [ + str(caseroot), + "ERIO.ne30_g16_rx1.A.docker_gnu", + "mct", + str(run_dir), + "case.std", + str(baseline_root), + "master/ERIO.ne30_g16_rx1.A.docker_gnu", + "ERIO.ne30_g16_rx1.A.docker_gnu.G.20230919_193255_z9hg2w", + "mct", + str(run_dir), + "ERIO", + "ERIO.ne30_g16_rx1.A.docker_gnu", + "master/ERIO.ne30_g16_rx1.A.docker_gnu", + str(baseline_root), + "master/ERIO.ne30_g16_rx1.A.docker_gnu", + str(run_dir), + "mct", + "/tmp/components/cpl", + str(run_dir), + "mct", + str(run_dir), + "mct", + ] + + if Config.instance().create_bless_log: + get_value_calls.insert(12, os.getcwd()) + + case.get_value.side_effect = get_value_calls + + common = SystemTestsCommon(case) + + common._generate_baseline() + + baseline_dir = baseline_root / "master" / "ERIO.ne30_g16_rx1.A.docker_gnu" + + assert (baseline_dir / "cpl.log.gz").exists() + assert (baseline_dir / "cpl-tput.log").exists() + assert (baseline_dir / "cpl-mem.log").exists() + assert (baseline_dir / "cpl.hi.2023-01-01.nc").exists() + + with open(baseline_dir / "cpl-tput.log") as fd: + lines = fd.readlines() + + assert len(lines) == 1 + assert lines[0] == "719.635" + + with open(baseline_dir / "cpl-mem.log") as fd: + lines = fd.readlines() + + assert len(lines) == 1 + assert lines[0] == "1673.89"
    + + +
    +[docs] + def test_kwargs(self): case = mock.MagicMock() case.get_value.side_effect = ( @@ -150,7 +695,10 @@

    Source code for CIME.tests.test_unit_system_tests

    SystemTestsCompareN._get_caseroots = orig
    -
    [docs] def test_dry_run(self): + +
    +[docs] + def test_dry_run(self): case = mock.MagicMock() case.get_value.side_effect = ( @@ -217,7 +765,9 @@

    Source code for CIME.tests.test_unit_system_tests

    system_test._setup_cases_if_not_yet_done.assert_called() - SystemTestsCompareN._setup_cases_if_not_yet_done = orig
    + SystemTestsCompareN._setup_cases_if_not_yet_done = orig
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_test_status.html b/versions/master/html/_modules/CIME/tests/test_unit_test_status.html index 2438f4c4480..f91038262e2 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_test_status.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_test_status.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -93,14 +93,18 @@

    Source code for CIME.tests.test_unit_test_status

    from CIME.tests.custom_assertions_test_status import CustomAssertionsTestStatus -
    [docs]class TestTestStatus(CustomAssertionsTestStatus): +
    +[docs] +class TestTestStatus(CustomAssertionsTestStatus): _TESTNAME = "fake_test" # An arbitrary phase we can use when we want to work with a non-core phase _NON_CORE_PHASE = test_status.MEMLEAK_PHASE -
    [docs] def setUp(self): +
    +[docs] + def setUp(self): self._ts = test_status.TestStatus( test_dir=os.path.join("nonexistent", "path"), test_name=self._TESTNAME, @@ -108,6 +112,7 @@

    Source code for CIME.tests.test_unit_test_status

    ) self._set_core_phases_to_pass()
    + def _set_core_phases_to_pass(self): """Set all core phases of self._ts to pass status""" with self._ts: @@ -127,10 +132,15 @@

    Source code for CIME.tests.test_unit_test_status

    with self._ts: self._ts.set_status(phase, status) -
    [docs] def test_get_latest_phase(self): +
    +[docs] + def test_get_latest_phase(self): assert self._ts.get_latest_phase() == test_status.RUN_PHASE
    -
    [docs] def test_current_is(self): + +
    +[docs] + def test_current_is(self): assert self._ts.current_is(test_status.RUN_PHASE, test_status.TEST_PASS_STATUS) assert not self._ts.current_is( @@ -141,18 +151,24 @@

    Source code for CIME.tests.test_unit_test_status

    test_status.SUBMIT_PHASE, test_status.TEST_PASS_STATUS )
    + # ------------------------------------------------------------------------ # Tests of TestStatus.phase_statuses_dump # ------------------------------------------------------------------------ -
    [docs] def test_psdump_corePhasesPass(self): +
    +[docs] + def test_psdump_corePhasesPass(self): output = self._ts.phase_statuses_dump() self.assert_core_phases(output, self._TESTNAME, fails=[]) self.assert_num_expected_unexpected_fails( output, num_expected=0, num_unexpected=0 )
    -
    [docs] def test_psdump_oneCorePhaseFails(self): + +
    +[docs] + def test_psdump_oneCorePhaseFails(self): fail_phase = self._set_last_core_phase_to_fail() output = self._ts.phase_statuses_dump() self.assert_core_phases(output, self._TESTNAME, fails=[fail_phase]) @@ -160,7 +176,10 @@

    Source code for CIME.tests.test_unit_test_status

    output, num_expected=0, num_unexpected=0 )
    -
    [docs] def test_psdump_oneCorePhaseFailsAbsentFromXFails(self): + +
    +[docs] + def test_psdump_oneCorePhaseFailsAbsentFromXFails(self): """One phase fails. There is an expected fails list, but that phase is not in it.""" fail_phase = self._set_last_core_phase_to_fail() xfails = expected_fails.ExpectedFails() @@ -175,7 +194,10 @@

    Source code for CIME.tests.test_unit_test_status

    output, num_expected=0, num_unexpected=0 )
    -
    [docs] def test_psdump_oneCorePhaseFailsInXFails(self): + +
    +[docs] + def test_psdump_oneCorePhaseFailsInXFails(self): """One phase fails. That phase is in the expected fails list.""" fail_phase = self._set_last_core_phase_to_fail() xfails = expected_fails.ExpectedFails() @@ -194,7 +216,10 @@

    Source code for CIME.tests.test_unit_test_status

    output, num_expected=1, num_unexpected=0 )
    -
    [docs] def test_psdump_oneCorePhasePassesInXFails(self): + +
    +[docs] + def test_psdump_oneCorePhasePassesInXFails(self): """One phase passes despite being in the expected fails list.""" xfail_phase = test_status.CORE_PHASES[-1] xfails = expected_fails.ExpectedFails() @@ -213,7 +238,10 @@

    Source code for CIME.tests.test_unit_test_status

    output, num_expected=0, num_unexpected=1 )
    -
    [docs] def test_psdump_skipPasses(self): + +
    +[docs] + def test_psdump_skipPasses(self): """With the skip_passes argument, only non-passes should appear""" fail_phase = self._set_last_core_phase_to_fail() output = self._ts.phase_statuses_dump(skip_passes=True) @@ -224,7 +252,10 @@

    Source code for CIME.tests.test_unit_test_status

    if phase != fail_phase: self.assert_phase_absent(output, phase, self._TESTNAME)
    -
    [docs] def test_psdump_unexpectedPass_shouldBePresent(self): + +
    +[docs] + def test_psdump_unexpectedPass_shouldBePresent(self): """Even with the skip_passes argument, an unexpected PASS should be present""" xfail_phase = test_status.CORE_PHASES[-1] xfails = expected_fails.ExpectedFails() @@ -241,7 +272,9 @@

    Source code for CIME.tests.test_unit_test_status

    ) for phase in test_status.CORE_PHASES: if phase != xfail_phase: - self.assert_phase_absent(output, phase, self._TESTNAME)
    + self.assert_phase_absent(output, phase, self._TESTNAME)
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_two_link_to_case2_output.html b/versions/master/html/_modules/CIME/tests/test_unit_two_link_to_case2_output.html index 15e1806132c..1331a0c04c8 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_two_link_to_case2_output.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_two_link_to_case2_output.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -109,7 +109,9 @@

    Source code for CIME.tests.test_unit_two_link_to_case2_output

    # ======================================================================== -
    [docs]class SystemTestsCompareTwoFake(SystemTestsCompareTwo): +
    +[docs] +class SystemTestsCompareTwoFake(SystemTestsCompareTwo): def __init__(self, case1, run_two_suffix="test"): SystemTestsCompareTwo.__init__( @@ -141,30 +143,41 @@

    Source code for CIME.tests.test_unit_two_link_to_case2_output

    pass
    + # ======================================================================== # Test class itself # ======================================================================== -
    [docs]class TestLinkToCase2Output(unittest.TestCase): +
    +[docs] +class TestLinkToCase2Output(unittest.TestCase): # ======================================================================== # Test helper functions # ======================================================================== -
    [docs] def setUp(self): +
    +[docs] + def setUp(self): self.original_wd = os.getcwd() # Create a sandbox in which case directories can be created self.tempdir = tempfile.mkdtemp()
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): # Some tests trigger a chdir call in the SUT; make sure we return to the # original directory at the end of the test os.chdir(self.original_wd) shutil.rmtree(self.tempdir, ignore_errors=True)
    -
    [docs] def setup_test_and_directories(self, casename1, run2_suffix): + +
    +[docs] + def setup_test_and_directories(self, casename1, run2_suffix): """ Returns test object """ @@ -177,7 +190,10 @@

    Source code for CIME.tests.test_unit_two_link_to_case2_output

    return mytest
    -
    [docs] def create_file_in_rundir2(self, mytest, core_filename, run2_suffix): + +
    +[docs] + def create_file_in_rundir2(self, mytest, core_filename, run2_suffix): """ Creates a file in rundir2 named CASE2.CORE_FILENAME.nc.RUN2_SUFFIX (where CASE2 is the casename of case2) @@ -191,11 +207,14 @@

    Source code for CIME.tests.test_unit_two_link_to_case2_output

    open(filepath, "w").close() return filepath
    + # ======================================================================== # Begin actual tests # ======================================================================== -
    [docs] def test_basic(self): +
    +[docs] + def test_basic(self): # Setup casename1 = "mytest" run2_suffix = "run2" @@ -222,7 +241,10 @@

    Source code for CIME.tests.test_unit_two_link_to_case2_output

    self.assertTrue(os.path.islink(expected_link_filepath2)) self.assertEqual(filepath2, os.readlink(expected_link_filepath2))
    - +
    + # (No verification: Test passes if no exception was raised) diff --git a/versions/master/html/_modules/CIME/tests/test_unit_user_mod_support.html b/versions/master/html/_modules/CIME/tests/test_unit_user_mod_support.html index 9293df001ed..aeb713c257e 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_user_mod_support.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_user_mod_support.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -100,23 +100,33 @@

    Source code for CIME.tests.test_unit_user_mod_support

    _SOURCEMODS = os.path.join("SourceMods", "src.drv") -
    [docs]class TestUserModSupport(unittest.TestCase): +
    +[docs] +class TestUserModSupport(unittest.TestCase): # ======================================================================== # Test helper functions # ======================================================================== -
    [docs] def setUp(self): +
    +[docs] + def setUp(self): self._caseroot = tempfile.mkdtemp() self._caseroot_sourcemods = os.path.join(self._caseroot, _SOURCEMODS) os.makedirs(self._caseroot_sourcemods) self._user_mods_parent_dir = tempfile.mkdtemp()
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): shutil.rmtree(self._caseroot, ignore_errors=True) shutil.rmtree(self._user_mods_parent_dir, ignore_errors=True)
    -
    [docs] def createUserMod(self, name, include_dirs=None): + +
    +[docs] + def createUserMod(self, name, include_dirs=None): """Create a user_mods directory with the given name. This directory is created within self._user_mods_parent_dir @@ -163,7 +173,10 @@

    Source code for CIME.tests.test_unit_user_mod_support

    os.path.join(self._user_mods_parent_dir, one_include) + "\n" )
    -
    [docs] def assertResults( + +
    +[docs] + def assertResults( self, expected_user_nl_cpl, expected_shell_commands_result, @@ -204,11 +217,14 @@

    Source code for CIME.tests.test_unit_user_mod_support

    contents = sourcemod.read() self.assertEqual(expected_sourcemod, contents)
    + # ======================================================================== # Begin actual tests # ======================================================================== -
    [docs] def test_basic(self): +
    +[docs] + def test_basic(self): self.createUserMod("foo") apply_user_mods(self._caseroot, os.path.join(self._user_mods_parent_dir, "foo")) self.assertResults( @@ -218,7 +234,10 @@

    Source code for CIME.tests.test_unit_user_mod_support

    msg="test_basic", )
    -
    [docs] def test_keepexe(self): + +
    +[docs] + def test_keepexe(self): self.createUserMod("foo") with self.assertRaisesRegex(CIMEError, "cannot have any source mods"): apply_user_mods( @@ -227,7 +246,10 @@

    Source code for CIME.tests.test_unit_user_mod_support

    keepexe=True, )
    -
    [docs] def test_two_applications(self): + +
    +[docs] + def test_two_applications(self): """If apply_user_mods is called twice, the second should appear after the first so that it takes precedence.""" self.createUserMod("foo1") @@ -245,7 +267,10 @@

    Source code for CIME.tests.test_unit_user_mod_support

    msg="test_two_applications", )
    -
    [docs] def test_include(self): + +
    +[docs] + def test_include(self): """If there is an included mod, the main one should appear after the included one so that it takes precedence.""" self.createUserMod("base") @@ -262,7 +287,10 @@

    Source code for CIME.tests.test_unit_user_mod_support

    msg="test_include", )
    -
    [docs] def test_duplicate_includes(self): + +
    +[docs] + def test_duplicate_includes(self): """Test multiple includes, where both include the same base mod. The base mod should only be included once. @@ -291,7 +319,9 @@

    Source code for CIME.tests.test_unit_user_mod_support

    expected_shell_commands_result=expected_contents, expected_sourcemod="derived_combo\n", msg="test_duplicate_includes", - )
    + )
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_user_nl_utils.html b/versions/master/html/_modules/CIME/tests/test_unit_user_nl_utils.html index 7d8e711350c..ba4218e4d93 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_user_nl_utils.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_user_nl_utils.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -93,19 +93,29 @@

    Source code for CIME.tests.test_unit_user_nl_utils

    from CIME.SystemTests.test_utils import user_nl_utils -
    [docs]class TestUserNLCopier(unittest.TestCase): +
    +[docs] +class TestUserNLCopier(unittest.TestCase): # ======================================================================== # Test helper functions # ======================================================================== -
    [docs] def setUp(self): +
    +[docs] + def setUp(self): self._caseroot = tempfile.mkdtemp()
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): shutil.rmtree(self._caseroot, ignore_errors=True)
    -
    [docs] def write_user_nl_file(self, component, contents, suffix=""): + +
    +[docs] + def write_user_nl_file(self, component, contents, suffix=""): """Write contents to a user_nl file in the case directory. Returns the basename (i.e., not the full path) of the file that is created. @@ -122,7 +132,10 @@

    Source code for CIME.tests.test_unit_user_nl_utils

    return filename
    -
    [docs] def assertFileContentsEqual(self, expected, filepath, msg=None): + +
    +[docs] + def assertFileContentsEqual(self, expected, filepath, msg=None): """Asserts that the contents of the file given by 'filepath' are equal to the string given by 'expected'. 'msg' gives an optional message to be printed if the assertion fails.""" @@ -132,11 +145,14 @@

    Source code for CIME.tests.test_unit_user_nl_utils

    self.assertEqual(expected, contents, msg=msg)
    + # ======================================================================== # Begin actual tests # ======================================================================== -
    [docs] def test_append(self): +
    +[docs] + def test_append(self): # Define some variables component = "foo" # deliberately exclude new line from file contents, to make sure that's @@ -158,7 +174,10 @@

    Source code for CIME.tests.test_unit_user_nl_utils

    expected_contents, os.path.join(self._caseroot, filename) )
    -
    [docs] def test_append_list(self): + +
    +[docs] + def test_append_list(self): # Define some variables component = "foo" # deliberately exclude new line from file contents, to make sure that's @@ -192,7 +211,10 @@

    Source code for CIME.tests.test_unit_user_nl_utils

    expected_contents, os.path.join(self._caseroot, filename) )
    -
    [docs] def test_append_multiple_files(self): + +
    +[docs] + def test_append_multiple_files(self): # Simulates a multi-instance test component = "foo" orig_contents1 = "bar = 42" @@ -218,7 +240,10 @@

    Source code for CIME.tests.test_unit_user_nl_utils

    expected_contents2, os.path.join(self._caseroot, filename2) )
    -
    [docs] def test_append_without_files_raises_exception(self): + +
    +[docs] + def test_append_without_files_raises_exception(self): # This test verifies that you get an exception if you call # append_to_user_nl_files when there are no user_nl files of interest @@ -237,7 +262,9 @@

    Source code for CIME.tests.test_unit_user_nl_utils

    caseroot=self._caseroot, component=component_for_append, contents="irrelevant contents to append", - )
    + )
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_utils.html b/versions/master/html/_modules/CIME/tests/test_unit_utils.html index 750479321e3..c6684c6ada9 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_utils.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_utils.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -105,17 +105,24 @@

    Source code for CIME.tests.test_unit_utils

     )
     
     
    -
    [docs]class TestIndentStr(unittest.TestCase): +
    +[docs] +class TestIndentStr(unittest.TestCase): """Test the indent_string function.""" -
    [docs] def test_indent_string_singleline(self): +
    +[docs] + def test_indent_string_singleline(self): """Test the indent_string function with a single-line string""" mystr = "foo" result = indent_string(mystr, 4) expected = " foo" self.assertEqual(expected, result)
    -
    [docs] def test_indent_string_multiline(self): + +
    +[docs] + def test_indent_string_multiline(self): """Test the indent_string function with a multi-line string""" mystr = """hello hi @@ -126,96 +133,150 @@

    Source code for CIME.tests.test_unit_utils

       hi
       goodbye
     """
    -        self.assertEqual(expected, result)
    + self.assertEqual(expected, result)
    +
    -
    [docs]class TestLineDefinesPythonFunction(unittest.TestCase): + +
    +[docs] +class TestLineDefinesPythonFunction(unittest.TestCase): """Tests of _line_defines_python_function""" # ------------------------------------------------------------------------ # Tests of _line_defines_python_function that should return True # ------------------------------------------------------------------------ -
    [docs] def test_def_foo(self): +
    +[docs] + def test_def_foo(self): """Test of a def of the function of interest""" line = "def foo():" self.assertTrue(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_def_foo_space(self): + +
    +[docs] + def test_def_foo_space(self): """Test of a def of the function of interest, with an extra space before the parentheses""" line = "def foo ():" self.assertTrue(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_import_foo(self): + +
    +[docs] + def test_import_foo(self): """Test of an import of the function of interest""" line = "from bar.baz import foo" self.assertTrue(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_import_foo_space(self): + +
    +[docs] + def test_import_foo_space(self): """Test of an import of the function of interest, with trailing spaces""" line = "from bar.baz import foo " self.assertTrue(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_import_foo_then_others(self): + +
    +[docs] + def test_import_foo_then_others(self): """Test of an import of the function of interest, along with others""" line = "from bar.baz import foo, bar" self.assertTrue(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_import_others_then_foo(self): + +
    +[docs] + def test_import_others_then_foo(self): """Test of an import of the function of interest, after others""" line = "from bar.baz import bar, foo" self.assertTrue(_line_defines_python_function(line, "foo"))
    + # ------------------------------------------------------------------------ # Tests of _line_defines_python_function that should return False # ------------------------------------------------------------------------ -
    [docs] def test_def_barfoo(self): +
    +[docs] + def test_def_barfoo(self): """Test of a def of a different function""" line = "def barfoo():" self.assertFalse(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_def_foobar(self): + +
    +[docs] + def test_def_foobar(self): """Test of a def of a different function""" line = "def foobar():" self.assertFalse(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_def_foo_indented(self): + +
    +[docs] + def test_def_foo_indented(self): """Test of a def of the function of interest, but indented""" line = " def foo():" self.assertFalse(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_def_foo_no_parens(self): + +
    +[docs] + def test_def_foo_no_parens(self): """Test of a def of the function of interest, but without parentheses""" line = "def foo:" self.assertFalse(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_import_foo_indented(self): + +
    +[docs] + def test_import_foo_indented(self): """Test of an import of the function of interest, but indented""" line = " from bar.baz import foo" self.assertFalse(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_import_barfoo(self): + +
    +[docs] + def test_import_barfoo(self): """Test of an import of a different function""" line = "from bar.baz import barfoo" self.assertFalse(_line_defines_python_function(line, "foo"))
    -
    [docs] def test_import_foobar(self): + +
    +[docs] + def test_import_foobar(self): """Test of an import of a different function""" line = "from bar.baz import foobar" - self.assertFalse(_line_defines_python_function(line, "foo"))
    + self.assertFalse(_line_defines_python_function(line, "foo"))
    +
    + -
    [docs]class TestFileContainsPythonFunction(unittest.TestCase): +
    +[docs] +class TestFileContainsPythonFunction(unittest.TestCase): """Tests of file_contains_python_function""" -
    [docs] def setUp(self): +
    +[docs] + def setUp(self): self._workdir = tempfile.mkdtemp()
    -
    [docs] def tearDown(self): + +
    +[docs] + def tearDown(self): shutil.rmtree(self._workdir, ignore_errors=True)
    -
    [docs] def create_test_file(self, contents): + +
    +[docs] + def create_test_file(self, contents): """Creates a test file with the given contents, and returns the path to that file""" filepath = os.path.join(self._workdir, "testfile") @@ -224,7 +285,10 @@

    Source code for CIME.tests.test_unit_utils

     
             return filepath
    -
    [docs] def test_contains_correct_def_and_others(self): + +
    +[docs] + def test_contains_correct_def_and_others(self): """Test file_contains_python_function with a correct def mixed with other defs""" contents = """ def bar(): @@ -234,7 +298,10 @@

    Source code for CIME.tests.test_unit_utils

             filepath = self.create_test_file(contents)
             self.assertTrue(file_contains_python_function(filepath, "foo"))
    -
    [docs] def test_does_not_contain_correct_def(self): + +
    +[docs] + def test_does_not_contain_correct_def(self): """Test file_contains_python_function without the correct def""" contents = """ def bar(): @@ -242,10 +309,14 @@

    Source code for CIME.tests.test_unit_utils

     def baz():
     """
             filepath = self.create_test_file(contents)
    -        self.assertFalse(file_contains_python_function(filepath, "foo"))
    + self.assertFalse(file_contains_python_function(filepath, "foo"))
    +
    + -
    [docs]class MockTime(object): +
    +[docs] +class MockTime(object): def __init__(self): self._old = None @@ -257,7 +328,10 @@

    Source code for CIME.tests.test_unit_utils

             setattr(sys.modules["time"], "strftime", self._old)
    -
    [docs]def match_all_lines(data, lines): + +
    +[docs] +def match_all_lines(data, lines): for line in data: for i, x in enumerate(lines): if x == line: @@ -271,8 +345,13 @@

    Source code for CIME.tests.test_unit_utils

         return False, lines
    -
    [docs]class TestUtils(unittest.TestCase): -
    [docs] def setUp(self): + +
    +[docs] +class TestUtils(unittest.TestCase): +
    +[docs] + def setUp(self): self.base_func = lambda *args: None # pylint: disable=unused-argument @@ -281,7 +360,10 @@

    Source code for CIME.tests.test_unit_utils

     
             self.error_func = _error_func
    -
    [docs] def test_import_and_run_sub_or_cmd(self): + +
    +[docs] + def test_import_and_run_sub_or_cmd(self): with self.assertRaisesRegex( Exception, "ERROR: Could not find buildnml file for component test" ): @@ -294,7 +376,10 @@

    Source code for CIME.tests.test_unit_utils

                     "test",
                 )
    -
    [docs] @mock.patch("importlib.import_module") + +
    +[docs] + @mock.patch("importlib.import_module") def test_import_and_run_sub_or_cmd_cime_py(self, importmodule): importmodule.side_effect = Exception("Module has a problem") @@ -311,7 +396,10 @@

    Source code for CIME.tests.test_unit_utils

             # check that we avoid exception chaining
             self.assertTrue(e.exception.__context__ is None)
    -
    [docs] @mock.patch("importlib.import_module") + +
    +[docs] + @mock.patch("importlib.import_module") def test_import_and_run_sub_or_cmd_import(self, importmodule): importmodule.side_effect = Exception("I am being imported") @@ -328,7 +416,10 @@

    Source code for CIME.tests.test_unit_utils

             # check that we avoid exception chaining
             self.assertTrue(e.exception.__context__ is None)
    -
    [docs] @mock.patch("os.path.isfile") + +
    +[docs] + @mock.patch("os.path.isfile") @mock.patch("CIME.utils.run_sub_or_cmd") def test_import_and_run_sub_or_cmd_run(self, func, isfile): isfile.return_value = True @@ -349,7 +440,10 @@

    Source code for CIME.tests.test_unit_utils

                     "test",
                 )
    -
    [docs] @mock.patch("glob.glob") + +
    +[docs] + @mock.patch("glob.glob") @mock.patch("CIME.utils.safe_copy") def test_copy_globs(self, safe_copy, glob): glob.side_effect = [ @@ -372,7 +466,10 @@

    Source code for CIME.tests.test_unit_utils

                 "/src/bld/test.nc", "/storage/output/test.nc.uid", preserve_meta=False
             )
    -
    [docs] def assertMatchAllLines(self, tempdir, test_lines): + +
    +[docs] + def assertMatchAllLines(self, tempdir, test_lines): with open(os.path.join(tempdir, "CaseStatus")) as fd: data = fd.readlines() @@ -388,7 +485,10 @@

    Source code for CIME.tests.test_unit_utils

     
             self.assertTrue(result, msg="\n".join(error))
    -
    [docs] def test_import_from_file(self): + +
    +[docs] + def test_import_from_file(self): with tempfile.NamedTemporaryFile() as fd: fd.writelines( [ @@ -403,7 +503,10 @@

    Source code for CIME.tests.test_unit_utils

     
                 assert module.test() == "value"
    -
    [docs] def test_run_and_log_case_status(self): + +
    +[docs] + def test_run_and_log_case_status(self): test_lines = [ "00:00:00 default starting \n", "00:00:00 default success \n", @@ -414,7 +517,10 @@

    Source code for CIME.tests.test_unit_utils

     
                 self.assertMatchAllLines(tempdir, test_lines)
    -
    [docs] def test_run_and_log_case_status_case_submit_on_batch(self): + +
    +[docs] + def test_run_and_log_case_status_case_submit_on_batch(self): test_lines = [ "00:00:00 case.submit starting \n", "00:00:00 case.submit success \n", @@ -427,7 +533,10 @@

    Source code for CIME.tests.test_unit_utils

     
                 self.assertMatchAllLines(tempdir, test_lines)
    -
    [docs] def test_run_and_log_case_status_case_submit_no_batch(self): + +
    +[docs] + def test_run_and_log_case_status_case_submit_no_batch(self): test_lines = [ "00:00:00 case.submit starting \n", "00:00:00 case.submit success \n", @@ -440,7 +549,10 @@

    Source code for CIME.tests.test_unit_utils

     
                 self.assertMatchAllLines(tempdir, test_lines)
    -
    [docs] def test_run_and_log_case_status_case_submit_error_on_batch(self): + +
    +[docs] + def test_run_and_log_case_status_case_submit_error_on_batch(self): test_lines = [ "00:00:00 case.submit starting \n", "00:00:00 case.submit error \n", @@ -455,7 +567,10 @@

    Source code for CIME.tests.test_unit_utils

     
                 self.assertMatchAllLines(tempdir, test_lines)
    -
    [docs] def test_run_and_log_case_status_custom_msg(self): + +
    +[docs] + def test_run_and_log_case_status_custom_msg(self): test_lines = [ "00:00:00 default starting starting extra\n", "00:00:00 default success success extra\n", @@ -481,7 +596,10 @@

    Source code for CIME.tests.test_unit_utils

             starting_func.assert_called_with()
             success_func.assert_called_with("data")
    -
    [docs] def test_run_and_log_case_status_custom_msg_error_on_batch(self): + +
    +[docs] + def test_run_and_log_case_status_custom_msg_error_on_batch(self): test_lines = [ "00:00:00 default starting starting extra\n", "00:00:00 default success success extra\n", @@ -509,7 +627,10 @@

    Source code for CIME.tests.test_unit_utils

             starting_func.assert_called_with()
             success_func.assert_not_called()
    -
    [docs] def test_run_and_log_case_status_error(self): + +
    +[docs] + def test_run_and_log_case_status_error(self): test_lines = [ "00:00:00 default starting \n", "00:00:00 default error \n", @@ -520,7 +641,9 @@

    Source code for CIME.tests.test_unit_utils

                 with self.assertRaises(Exception):
                     run_and_log_case_status(self.error_func, "default", caseroot=tempdir)
     
    -            self.assertMatchAllLines(tempdir, test_lines)
    + self.assertMatchAllLines(tempdir, test_lines)
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_xml_archive_base.html b/versions/master/html/_modules/CIME/tests/test_unit_xml_archive_base.html index 6721a3c9879..ae135d6c502 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_xml_archive_base.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_xml_archive_base.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -98,7 +98,7 @@

    Source code for CIME.tests.test_unit_xml_archive_base

    TEST_CONFIG = """<components version="2.0"> <comp_archive_spec compname="eam" compclass="atm"> - <hist_file_extension>unique\.name\.unique</hist_file_extension> + <hist_file_extension>unique\.name\.unique.*</hist_file_extension> </comp_archive_spec> </components>""" @@ -121,7 +121,9 @@

    Source code for CIME.tests.test_unit_xml_archive_base

    </components>""" -
    [docs]class TestXMLArchiveBase(unittest.TestCase): +
    +[docs] +class TestXMLArchiveBase(unittest.TestCase): @contextmanager def _setup_environment(self, test_files): with tempfile.TemporaryDirectory() as temp_dir: @@ -130,7 +132,9 @@

    Source code for CIME.tests.test_unit_xml_archive_base

    yield temp_dir -
    [docs] def test_exclude_testing(self): +
    +[docs] + def test_exclude_testing(self): archiver = ArchiveBase() archiver.read_fd(io.StringIO(EXCLUDE_TEST_CONFIG)) @@ -147,7 +151,10 @@

    Source code for CIME.tests.test_unit_xml_archive_base

    # set true assert archiver.exclude_testing("cpl")
    -
    [docs] def test_match_files(self): + +
    +[docs] + def test_match_files(self): archiver = ArchiveBase() archiver.read_fd(io.StringIO(TEST_CONFIG)) @@ -188,7 +195,10 @@

    Source code for CIME.tests.test_unit_xml_archive_base

    for x, y in zip(test_files, hist_files): assert x == y, f"{x} != {y}"
    -
    [docs] def test_extension_included(self): + +
    +[docs] + def test_extension_included(self): archiver = ArchiveBase() archiver.read_fd(io.StringIO(EXACT_TEST_CONFIG)) @@ -228,7 +238,10 @@

    Source code for CIME.tests.test_unit_xml_archive_base

    for x, y in zip(test_files, hist_files): assert x == y, f"{x} != {y}"
    -
    [docs] def test_suffix(self): + +
    +[docs] + def test_suffix(self): archiver = ArchiveBase() archiver.read_fd(io.StringIO(TEST_CONFIG)) @@ -267,7 +280,9 @@

    Source code for CIME.tests.test_unit_xml_archive_base

    test_files.sort() for x, y in zip(hist_files, test_files): - assert x == y, f"{x} != {y}"
    + assert x == y, f"{x} != {y}"
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_xml_env_batch.html b/versions/master/html/_modules/CIME/tests/test_unit_xml_env_batch.html index 9eb1ee108a1..35c7aab9608 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_xml_env_batch.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_xml_env_batch.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -91,13 +91,206 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    import tempfile from unittest import mock -from CIME.XML.env_batch import EnvBatch +from CIME.utils import CIMEError +from CIME.XML.env_batch import EnvBatch, get_job_deps # pylint: disable=unused-argument -
    [docs]class TestXMLEnvBatch(unittest.TestCase): -
    [docs] def test_get_submit_args_job_queue(self): +
    +[docs] +class TestXMLEnvBatch(unittest.TestCase): +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch._submit_single_job") + def test_submit_jobs(self, _submit_single_job): + case = mock.MagicMock() + + case.get_value.side_effect = [ + False, + ] + + env_batch = EnvBatch() + + with self.assertRaises(CIMEError): + env_batch.submit_jobs(case)
    + + +
    +[docs] + @mock.patch("CIME.XML.env_batch.os.path.isfile") + @mock.patch("CIME.XML.env_batch.get_batch_script_for_job") + @mock.patch("CIME.XML.env_batch.EnvBatch._submit_single_job") + def test_submit_jobs_dependency( + self, _submit_single_job, get_batch_script_for_job, isfile + ): + case = mock.MagicMock() + + case.get_env.return_value.get_jobs.return_value = [ + "case.build", + "case.run", + ] + + case.get_env.return_value.get_value.side_effect = [ + None, + "", + None, + "case.build", + ] + + case.get_value.side_effect = [ + False, + ] + + _submit_single_job.side_effect = ["0", "1"] + + isfile.return_value = True + + get_batch_script_for_job.side_effect = [".case.build", ".case.run"] + + env_batch = EnvBatch() + + depid = env_batch.submit_jobs(case) + + _submit_single_job.assert_any_call( + case, + "case.build", + skip_pnl=False, + resubmit_immediate=False, + dep_jobs=[], + allow_fail=False, + no_batch=False, + mail_user=None, + mail_type=None, + batch_args=None, + dry_run=False, + workflow=True, + ) + _submit_single_job.assert_any_call( + case, + "case.run", + skip_pnl=False, + resubmit_immediate=False, + dep_jobs=[ + "0", + ], + allow_fail=False, + no_batch=False, + mail_user=None, + mail_type=None, + batch_args=None, + dry_run=False, + workflow=True, + ) + assert depid == {"case.build": "0", "case.run": "1"}
    + + +
    +[docs] + @mock.patch("CIME.XML.env_batch.os.path.isfile") + @mock.patch("CIME.XML.env_batch.get_batch_script_for_job") + @mock.patch("CIME.XML.env_batch.EnvBatch._submit_single_job") + def test_submit_jobs_single( + self, _submit_single_job, get_batch_script_for_job, isfile + ): + case = mock.MagicMock() + + case.get_env.return_value.get_jobs.return_value = [ + "case.run", + ] + + case.get_env.return_value.get_value.return_value = None + + case.get_value.side_effect = [ + False, + ] + + _submit_single_job.return_value = "0" + + isfile.return_value = True + + get_batch_script_for_job.side_effect = [ + ".case.run", + ] + + env_batch = EnvBatch() + + depid = env_batch.submit_jobs(case) + + _submit_single_job.assert_any_call( + case, + "case.run", + skip_pnl=False, + resubmit_immediate=False, + dep_jobs=[], + allow_fail=False, + no_batch=False, + mail_user=None, + mail_type=None, + batch_args=None, + dry_run=False, + workflow=True, + ) + assert depid == {"case.run": "0"}
    + + +
    +[docs] + def test_get_job_deps(self): + # no jobs + job_deps = get_job_deps("", {}) + + assert job_deps == [] + + # dependency doesn't exist + job_deps = get_job_deps("case.run", {}) + + assert job_deps == [] + + job_deps = get_job_deps("case.run", {"case.run": 0}) + + assert job_deps == [ + "0", + ] + + job_deps = get_job_deps( + "case.run case.post_run_io", {"case.run": 0, "case.post_run_io": 1} + ) + + assert job_deps == ["0", "1"] + + # old syntax + job_deps = get_job_deps("case.run and case.post_run_io", {"case.run": 0}) + + assert job_deps == [ + "0", + ] + + # old syntax + job_deps = get_job_deps( + "(case.run and case.post_run_io) or case.test", {"case.run": 0} + ) + + assert job_deps == [ + "0", + ] + + job_deps = get_job_deps("", {}, user_prereq="2") + + assert job_deps == [ + "2", + ] + + job_deps = get_job_deps("", {}, prev_job="1") + + assert job_deps == [ + "1", + ]
    + + +
    +[docs] + def test_get_submit_args_job_queue(self): with tempfile.NamedTemporaryFile() as tfile: tfile.write( b"""<?xml version="1.0"?> @@ -153,7 +346,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    expected_args = " -w default -w long" assert submit_args == expected_args
    -
    [docs] @mock.patch.dict(os.environ, {"TEST": "GOOD"}) + +
    +[docs] + @mock.patch.dict(os.environ, {"TEST": "GOOD"}) def test_get_submit_args(self): with tempfile.NamedTemporaryFile() as tfile: tfile.write( @@ -245,7 +441,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    assert submit_args == expected_args
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.get") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.get") def test_get_queue_specs(self, get): node = mock.MagicMock() @@ -285,7 +484,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    self.assertTrue(jobmax == None) self.assertFalse(strict)
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") # nodemin, nodemax, jobname, walltimemin, walltimemax, jobmin, jobmax, strict @mock.patch( "CIME.XML.env_batch.EnvBatch.get_queue_specs", @@ -341,7 +543,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    "JOB_WALLCLOCK_TIME", "20:00:00", subgroup="case.run" )
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") # nodemin, nodemax, jobname, walltimemin, walltimemax, jobmin, jobmax, strict @mock.patch( "CIME.XML.env_batch.EnvBatch.get_queue_specs", @@ -397,7 +602,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    "JOB_WALLCLOCK_TIME", "05:00:00", subgroup="case.run" )
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") # nodemin, nodemax, jobname, walltimemax, jobmin, jobmax, strict @mock.patch( "CIME.XML.env_batch.EnvBatch.get_queue_specs", @@ -453,7 +661,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    "JOB_WALLCLOCK_TIME", "10:00:00", subgroup="case.run" )
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") # nodemin, nodemax, jobname, walltimemax, jobmin, jobmax, strict @mock.patch( "CIME.XML.env_batch.EnvBatch.get_queue_specs", @@ -509,7 +720,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    "JOB_WALLCLOCK_TIME", "08:00:00", subgroup="case.run" )
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") # nodemin, nodemax, jobname, walltimemax, jobmin, jobmax, strict @mock.patch( "CIME.XML.env_batch.EnvBatch.get_queue_specs", @@ -565,7 +779,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    "JOB_WALLCLOCK_TIME", "08:00:00", subgroup="case.run" )
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") # nodemin, nodemax, jobname, walltimemax, jobmin, jobmax, strict @mock.patch( "CIME.XML.env_batch.EnvBatch.get_queue_specs", @@ -621,7 +838,10 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    "JOB_WALLCLOCK_TIME", "10:00:00", subgroup="case.run" )
    -
    [docs] @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") + +
    +[docs] + @mock.patch("CIME.XML.env_batch.EnvBatch.text", return_value="default") # nodemin, nodemax, jobname, walltimemax, jobmin, jobmax, strict @mock.patch( "CIME.XML.env_batch.EnvBatch.get_queue_specs", @@ -675,7 +895,9 @@

    Source code for CIME.tests.test_unit_xml_env_batch

    ) env_workflow.set_value.assert_any_call( "JOB_WALLCLOCK_TIME", "12:00:00", subgroup="case.run" - )
    + )
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_xml_env_mach_specific.html b/versions/master/html/_modules/CIME/tests/test_unit_xml_env_mach_specific.html index f7655bd0344..68827c60dc2 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_xml_env_mach_specific.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_xml_env_mach_specific.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -96,8 +96,12 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    # pylint: disable=unused-argument -
    [docs]class TestXMLEnvMachSpecific(unittest.TestCase): -
    [docs] def test_aprun_get_args(self): +
    +[docs] +class TestXMLEnvMachSpecific(unittest.TestCase): +
    +[docs] + def test_aprun_get_args(self): with tempfile.NamedTemporaryFile() as temp: temp.write( b"""<?xml version="1.0"?> @@ -154,7 +158,10 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    assert extra_args == expected_args
    -
    [docs] def test_get_aprun_mode_not_valid(self): + +
    +[docs] + def test_get_aprun_mode_not_valid(self): with tempfile.NamedTemporaryFile() as temp: temp.write( b"""<?xml version="1.0"?> @@ -204,7 +211,10 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    == "ERROR: Value 'custom' for \"aprun_mode\" is not valid, options are 'ignore, default, override'" )
    -
    [docs] def test_get_aprun_mode_user_defined(self): + +
    +[docs] + def test_get_aprun_mode_user_defined(self): with tempfile.NamedTemporaryFile() as temp: temp.write( b"""<?xml version="1.0"?> @@ -250,7 +260,10 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    assert aprun_mode == "default"
    -
    [docs] def test_get_aprun_mode_default(self): + +
    +[docs] + def test_get_aprun_mode_default(self): with tempfile.NamedTemporaryFile() as temp: temp.write( b"""<?xml version="1.0"?> @@ -295,7 +308,10 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    assert aprun_mode == "default"
    -
    [docs] def test_find_best_mpirun_match(self): + +
    +[docs] + def test_find_best_mpirun_match(self): with tempfile.NamedTemporaryFile() as temp: temp.write( b"""<?xml version="1.0"?> @@ -352,7 +368,10 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    assert run_exe is None assert run_misc_suffix is None
    -
    [docs] def test_get_mpirun(self): + +
    +[docs] + def test_get_mpirun(self): with tempfile.NamedTemporaryFile() as temp: temp.write( b"""<?xml version="1.0"?> @@ -406,7 +425,10 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    assert run_exe is None assert run_misc_suffix is None
    -
    [docs] @mock.patch("CIME.XML.env_mach_specific.EnvMachSpecific.get_optional_child") + +
    +[docs] + @mock.patch("CIME.XML.env_mach_specific.EnvMachSpecific.get_optional_child") @mock.patch("CIME.XML.env_mach_specific.EnvMachSpecific.text") @mock.patch.dict("os.environ", {"TEST_VALUE": "/testexec"}) def test_init_path(self, text, get_optional_child): @@ -418,7 +440,10 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    assert value == "/testexec/init/python"
    -
    [docs] @mock.patch("CIME.XML.env_mach_specific.EnvMachSpecific.get_optional_child") + +
    +[docs] + @mock.patch("CIME.XML.env_mach_specific.EnvMachSpecific.get_optional_child") @mock.patch("CIME.XML.env_mach_specific.EnvMachSpecific.text") @mock.patch.dict("os.environ", {"TEST_VALUE": "/testexec"}) def test_cmd_path(self, text, get_optional_child): @@ -428,7 +453,9 @@

    Source code for CIME.tests.test_unit_xml_env_mach_specific

    value = mach_specific.get_module_system_cmd_path("python") - assert value == "/testexec/python"
    + assert value == "/testexec/python"
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_xml_machines.html b/versions/master/html/_modules/CIME/tests/test_unit_xml_machines.html index b12b77edff8..5d73ea87a9e 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_xml_machines.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_xml_machines.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -223,32 +223,48 @@

    Source code for CIME.tests.test_unit_xml_machines

    """ -
    [docs]class TestUnitXMLMachines(unittest.TestCase): -
    [docs] def setUp(self): +
    +[docs] +class TestUnitXMLMachines(unittest.TestCase): +
    +[docs] + def setUp(self): Machines._FILEMAP = {} # read_only=False for github testing - self.machine = Machines(machine="centos7-linux") + # MACHINE IS SET BELOW TO USE DEFINITION IN "MACHINE_TEST_XML" + self.machine = Machines() self.machine.read_fd(io.StringIO(MACHINE_TEST_XML)) self.machine.set_machine("default")
    -
    [docs] def test_has_batch_system(self): + +
    +[docs] + def test_has_batch_system(self): assert self.machine.has_batch_system() self.machine.set_machine("default-no-batch") assert not self.machine.has_batch_system()
    -
    [docs] def test_is_valid_MPIlib(self): + +
    +[docs] + def test_is_valid_MPIlib(self): assert self.machine.is_valid_MPIlib("mpi-serial") assert not self.machine.is_valid_MPIlib("mpi-bogus")
    -
    [docs] def test_is_valid_compiler(self): + +
    +[docs] + def test_is_valid_compiler(self): assert self.machine.is_valid_compiler("gnu") - assert not self.machine.is_valid_compiler("bogus")
    + assert not self.machine.is_valid_compiler("bogus")
    +
    +
    diff --git a/versions/master/html/_modules/CIME/tests/test_unit_xml_namelist_definition.html b/versions/master/html/_modules/CIME/tests/test_unit_xml_namelist_definition.html index ab66fcd900b..2a875e93af7 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_xml_namelist_definition.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_xml_namelist_definition.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -92,8 +92,12 @@

    Source code for CIME.tests.test_unit_xml_namelist_definition

    # pylint: disable=protected-access -
    [docs]class TestXMLNamelistDefinition(unittest.TestCase): -
    [docs] def test_set_nodes(self): +
    +[docs] +class TestXMLNamelistDefinition(unittest.TestCase): +
    +[docs] + def test_set_nodes(self): test_data = """<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="http://www.cgd.ucar.edu/~cam/namelist/namelist_definition.xsl"?> @@ -121,7 +125,9 @@

    Source code for CIME.tests.test_unit_xml_namelist_definition

    assert len(nmldef._nodes) == 2 assert nmldef._entry_types == {"test1": "char", "test2": "char"} assert nmldef._valid_values == {"test1": None, "test2": None} - assert nmldef._group_names == {"test1": None, "test2": None}
    + assert nmldef._group_names == {"test1": None, "test2": None}
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/test_unit_xml_tests.html b/versions/master/html/_modules/CIME/tests/test_unit_xml_tests.html index 90758ff09d7..229cfa12800 100644 --- a/versions/master/html/_modules/CIME/tests/test_unit_xml_tests.html +++ b/versions/master/html/_modules/CIME/tests/test_unit_xml_tests.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,13 +95,20 @@

    Source code for CIME.tests.test_unit_xml_tests

    from CIME.XML.tests import Tests -

    [docs]class TestXMLTests(unittest.TestCase): -
    [docs] def setUp(self): +
    +[docs] +class TestXMLTests(unittest.TestCase): +
    +[docs] + def setUp(self): # reset file caching Tests._FILEMAP = {}
    + # skip hard to mock function call -
    [docs] @mock.patch( +
    +[docs] + @mock.patch( "CIME.SystemTests.system_tests_compare_two.SystemTestsCompareTwo._setup_cases_if_not_yet_done" ) def test_support_single_exe(self, _setup_cases_if_not_yet_done): @@ -133,8 +140,11 @@

    Source code for CIME.tests.test_unit_xml_tests

    tests.support_single_exe(case)

    + # skip hard to mock function call -
    [docs] @mock.patch( +
    +[docs] + @mock.patch( "CIME.SystemTests.system_tests_compare_two.SystemTestsCompareTwo._setup_cases_if_not_yet_done" ) def test_support_single_exe_error(self, _setup_cases_if_not_yet_done): @@ -173,7 +183,9 @@

    Source code for CIME.tests.test_unit_xml_tests

    f"{e.exception}", ) is not None - ), f"{e.exception}"

    + ), f"{e.exception}"
    +
    + if __name__ == "__main__": diff --git a/versions/master/html/_modules/CIME/tests/utils.html b/versions/master/html/_modules/CIME/tests/utils.html index 0d8d396390b..e09afb3c37a 100644 --- a/versions/master/html/_modules/CIME/tests/utils.html +++ b/versions/master/html/_modules/CIME/tests/utils.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -136,12 +136,17 @@

    Source code for CIME.tests.utils

     ]
     
     
    -
    [docs]def parse_test_status(line): +
    +[docs] +def parse_test_status(line): status, test = line.split()[0:2] return test, status
    -
    [docs]def make_fake_teststatus(path, testname, status, phase): + +
    +[docs] +def make_fake_teststatus(path, testname, status, phase): expect(phase in test_status.CORE_PHASES, "Bad phase '%s'" % phase) with test_status.TestStatus(test_dir=path, test_name=testname) as ts: for core_phase in test_status.CORE_PHASES: @@ -160,7 +165,10 @@

    Source code for CIME.tests.utils

                     )
    -
    [docs]class MockMachines(object): + +
    +[docs] +class MockMachines(object): """A mock version of the Machines object to simplify testing.""" def __init__(self, name, os_): @@ -168,34 +176,55 @@

    Source code for CIME.tests.utils

             self.name = name
             self.os = os_
     
    -
    [docs] def get_machine_name(self): +
    +[docs] + def get_machine_name(self): """Return the name we were given.""" return self.name
    -
    [docs] def get_value(self, var_name): + +
    +[docs] + def get_value(self, var_name): """Allow the operating system to be queried.""" assert var_name == "OS", ( "Build asked for a value not " "implemented in the testing infrastructure." ) return self.os
    -
    [docs] def is_valid_compiler(self, _): # pylint:disable=no-self-use + +
    +[docs] + def is_valid_compiler(self, _): # pylint:disable=no-self-use """Assume all compilers are valid.""" return True
    -
    [docs] def is_valid_MPIlib(self, _): + +
    +[docs] + def is_valid_MPIlib(self, _): """Assume all MPILIB settings are valid.""" return True
    + # pragma pylint: disable=unused-argument -
    [docs] def get_default_MPIlib(self, attributes=None): +
    +[docs] + def get_default_MPIlib(self, attributes=None): return "mpich2"
    -
    [docs] def get_default_compiler(self): - return "intel"
    + +
    +[docs] + def get_default_compiler(self): + return "intel"
    +
    + -
    [docs]class MakefileTester(object): +
    +[docs] +class MakefileTester(object): """Helper class for checking Makefile output. @@ -223,7 +252,9 @@

    Source code for CIME.tests.utils

             self.parent = parent
             self.make_string = make_string
     
    -
    [docs] def query_var(self, var_name, env, var): +
    +[docs] + def query_var(self, var_name, env, var): """Request the value of a variable in the Makefile, as a string. Arguments: @@ -272,7 +303,10 @@

    Source code for CIME.tests.utils

     
             return query_result
    -
    [docs] def assert_variable_equals(self, var_name, value, env=None, var=None): + +
    +[docs] + def assert_variable_equals(self, var_name, value, env=None, var=None): """Assert that a variable in the Makefile has a given value. Arguments: @@ -283,7 +317,10 @@

    Source code for CIME.tests.utils

             """
             self.parent.assertEqual(self.query_var(var_name, env, var), value)
    -
    [docs] def assert_variable_matches(self, var_name, regex, env=None, var=None): + +
    +[docs] + def assert_variable_matches(self, var_name, regex, env=None, var=None): """Assert that a variable in the Makefile matches a regex. Arguments: @@ -292,10 +329,14 @@

    Source code for CIME.tests.utils

             env - Optional. Dict of environment variables to set when calling make.
             var - Optional. Dict of make variables to set when calling make.
             """
    -        self.parent.assertRegexpMatches(self.query_var(var_name, env, var), regex)
    + self.parent.assertRegexpMatches(self.query_var(var_name, env, var), regex)
    +
    -
    [docs]class CMakeTester(object): + +
    +[docs] +class CMakeTester(object): """Helper class for checking CMake output. @@ -321,7 +362,9 @@

    Source code for CIME.tests.utils

             self.parent = parent
             self.cmake_string = cmake_string
     
    -
    [docs] def query_var(self, var_name, env, var): +
    +[docs] + def query_var(self, var_name, env, var): """Request the value of a variable in Macros.cmake, as a string. Arguments: @@ -373,7 +416,10 @@

    Source code for CIME.tests.utils

     
             return query_result
    -
    [docs] def assert_variable_equals(self, var_name, value, env=None, var=None): + +
    +[docs] + def assert_variable_equals(self, var_name, value, env=None, var=None): """Assert that a variable in the CMakeLists has a given value. Arguments: @@ -384,7 +430,10 @@

    Source code for CIME.tests.utils

             """
             self.parent.assertEqual(self.query_var(var_name, env, var), value)
    -
    [docs] def assert_variable_matches(self, var_name, regex, env=None, var=None): + +
    +[docs] + def assert_variable_matches(self, var_name, regex, env=None, var=None): """Assert that a variable in the CMkeLists matches a regex. Arguments: @@ -393,11 +442,15 @@

    Source code for CIME.tests.utils

             env - Optional. Dict of environment variables to set when calling cmake.
             var - Optional. Dict of CMake variables to set when calling cmake.
             """
    -        self.parent.assertRegexpMatches(self.query_var(var_name, env, var), regex)
    + self.parent.assertRegexpMatches(self.query_var(var_name, env, var), regex)
    +
    + # TODO after dropping python 2.7 replace with tempfile.TemporaryDirectory -
    [docs]class TemporaryDirectory(object): +
    +[docs] +class TemporaryDirectory(object): def __init__(self): self._tempdir = None @@ -410,8 +463,11 @@

    Source code for CIME.tests.utils

                 shutil.rmtree(self._tempdir)
    + # TODO replace with actual mock once 2.7 is dropped -
    [docs]class Mocker: +
    +[docs] +class Mocker: def __init__(self, ret=None, cmd=None, return_value=None, side_effect=None): self._orig = [] self._ret = ret or return_value @@ -441,10 +497,15 @@

    Source code for CIME.tests.utils

         def ret(self, value):
             self._ret = value
     
    -
    [docs] def assert_called(self): +
    +[docs] + def assert_called(self): assert len(self.calls) > 0
    -
    [docs] def assert_called_with(self, i=None, args=None, kwargs=None): + +
    +[docs] + def assert_called_with(self, i=None, args=None, kwargs=None): if i is None: i = 0 @@ -463,6 +524,7 @@

    Source code for CIME.tests.utils

                 for x, y in kwargs.items():
                     assert call_kwargs[x] == y, "Missing {}".format(x)
    + def __getattr__(self, name): if name in self._method_calls: new_method = self._method_calls[name] @@ -491,14 +553,19 @@

    Source code for CIME.tests.utils

         def __exit__(self, *args, **kwargs):
             self.revert_mocks()
     
    -
    [docs] def revert_mocks(self): +
    +[docs] + def revert_mocks(self): for m, module, method in self._orig: if isinstance(module, str): setattr(sys.modules[module], method, m) else: setattr(module, method, m)
    -
    [docs] def patch( + +
    +[docs] + def patch( self, module, method=None, ret=None, is_property=False, update_value_only=False ): rv = None @@ -520,7 +587,9 @@

    Source code for CIME.tests.utils

             else:
                 raise Exception("Could not patch")
     
    -        return rv
    + return rv
    +
    +
    diff --git a/versions/master/html/_modules/CIME/user_mod_support.html b/versions/master/html/_modules/CIME/user_mod_support.html index 4222baaa939..ec10c6c1861 100644 --- a/versions/master/html/_modules/CIME/user_mod_support.html +++ b/versions/master/html/_modules/CIME/user_mod_support.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -95,7 +95,9 @@

    Source code for CIME.user_mod_support

     logger = logging.getLogger(__name__)
     
     
    -
    [docs]def apply_user_mods(caseroot, user_mods_path, keepexe=None): +
    +[docs] +def apply_user_mods(caseroot, user_mods_path, keepexe=None): """ Recursivlely apply user_mods to caseroot - this includes updating user_nl_xxx, updating SourceMods and creating case shell_commands and xmlchange_cmds files @@ -207,7 +209,10 @@

    Source code for CIME.user_mod_support

                 run_cmd_no_fail(shell_command_file, verbose=True)
    -
    [docs]def build_include_dirs_list(user_mods_path, include_dirs=None): + +
    +[docs] +def build_include_dirs_list(user_mods_path, include_dirs=None): """ If user_mods_path has a file "include_user_mods" read that file and add directories to the include_dirs, recursively check @@ -251,6 +256,7 @@

    Source code for CIME.user_mod_support

                             )
     
         return include_dirs
    +
    diff --git a/versions/master/html/_modules/CIME/utils.html b/versions/master/html/_modules/CIME/utils.html index abb91ca042f..96fdd74d444 100644 --- a/versions/master/html/_modules/CIME/utils.html +++ b/versions/master/html/_modules/CIME/utils.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -108,7 +108,9 @@

    Source code for CIME.utils

     GLOBAL = {}
     
     
    -
    [docs]def deprecate_action(message): +
    +[docs] +def deprecate_action(message): class ActionStoreDeprecated(Action): def __call__(self, parser, namespace, values, option_string=None): raise DeprecationWarning(f"{option_string} is deprecated{message}") @@ -116,7 +118,10 @@

    Source code for CIME.utils

         return ActionStoreDeprecated
    -
    [docs]def import_from_file(name, file_path): + +
    +[docs] +def import_from_file(name, file_path): loader = importlib.machinery.SourceFileLoader(name, file_path) spec = importlib.util.spec_from_loader(loader.name, loader) @@ -130,7 +135,10 @@

    Source code for CIME.utils

         return module
    -
    [docs]@contextmanager + +
    +[docs] +@contextmanager def redirect_stdout(new_target): old_target, sys.stdout = sys.stdout, new_target # replace sys.stdout try: @@ -139,7 +147,10 @@

    Source code for CIME.utils

             sys.stdout = old_target  # restore to the previous value
    -
    [docs]@contextmanager + +
    +[docs] +@contextmanager def redirect_stderr(new_target): old_target, sys.stderr = sys.stderr, new_target # replace sys.stdout try: @@ -148,7 +159,10 @@

    Source code for CIME.utils

             sys.stderr = old_target  # restore to the previous value
    -
    [docs]@contextmanager + +
    +[docs] +@contextmanager def redirect_stdout_stderr(new_target): old_stdout, old_stderr = sys.stdout, sys.stderr sys.stdout, sys.stderr = new_target, new_target @@ -158,7 +172,10 @@

    Source code for CIME.utils

             sys.stdout, sys.stderr = old_stdout, old_stderr
    -
    [docs]@contextmanager + +
    +[docs] +@contextmanager def redirect_logger(new_target, logger_name): ch = logging.StreamHandler(stream=new_target) ch.setLevel(logging.DEBUG) @@ -176,18 +193,27 @@

    Source code for CIME.utils

             log.handlers = orig_handlers
    -
    [docs]class IndentFormatter(logging.Formatter): + +
    +[docs] +class IndentFormatter(logging.Formatter): def __init__(self, indent, fmt=None, datefmt=None): logging.Formatter.__init__(self, fmt, datefmt) self._indent = indent -
    [docs] def format(self, record): +
    +[docs] + def format(self, record): record.msg = "{}{}".format(self._indent, record.msg) out = logging.Formatter.format(self, record) - return out
    + return out
    +
    + -
    [docs]def set_logger_indent(indent): +
    +[docs] +def set_logger_indent(indent): root_log = logging.getLogger() root_log.handlers = [] formatter = IndentFormatter(indent) @@ -197,7 +223,10 @@

    Source code for CIME.utils

         root_log.addHandler(handler)
    -
    [docs]class EnvironmentContext(object): + +
    +[docs] +class EnvironmentContext(object): """ Context manager for environment variables Usage: @@ -229,16 +258,22 @@

    Source code for CIME.utils

                     del os.environ[k]
    + # This should be the go-to exception for CIME use. It's a subclass # of SystemExit in order suppress tracebacks, which users generally # hate seeing. It's a subclass of Exception because we want it to be # "catchable". If you are debugging CIME and want to see the stacktrace, # run your CIME command with the --debug flag. -
    [docs]class CIMEError(SystemExit, Exception): +
    +[docs] +class CIMEError(SystemExit, Exception): pass
    -
    [docs]def expect(condition, error_msg, exc_type=CIMEError, error_prefix="ERROR:"): + +
    +[docs] +def expect(condition, error_msg, exc_type=CIMEError, error_prefix="ERROR:"): """ Similar to assert except doesn't generate an ugly stacktrace. Useful for checking user error, not programming error. @@ -261,11 +296,17 @@

    Source code for CIME.utils

             raise exc_type(msg)
    -
    [docs]def id_generator(size=6, chars=string.ascii_lowercase + string.digits): + +
    +[docs] +def id_generator(size=6, chars=string.ascii_lowercase + string.digits): return "".join(random.choice(chars) for _ in range(size))
    -
    [docs]def check_name(fullname, additional_chars=None, fullpath=False): + +
    +[docs] +def check_name(fullname, additional_chars=None, fullpath=False): """ check for unallowed characters in name, this routine only checks the final name and does not check if path exists or is @@ -305,6 +346,7 @@

    Source code for CIME.utils

         return True
    + # Should only be called from get_cime_config() def _read_cime_config_file(): """ @@ -357,7 +399,7 @@

    Source code for CIME.utils

         cime_config_file = os.path.abspath(
             os.path.join(os.path.expanduser("~"), ".cime", "config")
         )
    -    cime_config = configparser.SafeConfigParser()
    +    cime_config = configparser.ConfigParser()
         if os.path.isfile(cime_config_file):
             cime_config.read(cime_config_file)
             for section in cime_config.sections():
    @@ -393,7 +435,9 @@ 

    Source code for CIME.utils

     _CIMECONFIG = None
     
     
    -
    [docs]def get_cime_config(): +
    +[docs] +def get_cime_config(): global _CIMECONFIG if not _CIMECONFIG: _CIMECONFIG = _read_cime_config_file() @@ -401,7 +445,10 @@

    Source code for CIME.utils

         return _CIMECONFIG
    -
    [docs]def reset_cime_config(): + +
    +[docs] +def reset_cime_config(): """ Useful to keep unit tests from interfering with each other """ @@ -409,7 +456,10 @@

    Source code for CIME.utils

         _CIMECONFIG = None
    -
    [docs]def copy_local_macros_to_dir(destination, extra_machdir=None): + +
    +[docs] +def copy_local_macros_to_dir(destination, extra_machdir=None): """ Copy any local macros files to the path given by 'destination'. @@ -435,14 +485,20 @@

    Source code for CIME.utils

             safe_copy(macro, destination)
    -
    [docs]def get_python_libs_location_within_cime(): + +
    +[docs] +def get_python_libs_location_within_cime(): """ From within CIME, return subdirectory of python libraries """ return os.path.join("scripts", "lib")
    -
    [docs]def get_cime_root(case=None): + +
    +[docs] +def get_cime_root(case=None): """ Return the absolute path to the root of CIME that contains this script """ @@ -463,31 +519,46 @@

    Source code for CIME.utils

         return cimeroot
    -
    [docs]def get_config_path(): + +
    +[docs] +def get_config_path(): cimeroot = get_cime_root() return os.path.join(cimeroot, "CIME", "data", "config")
    -
    [docs]def get_schema_path(): + +
    +[docs] +def get_schema_path(): config_path = get_config_path() return os.path.join(config_path, "xml_schemas")
    -
    [docs]def get_template_path(): + +
    +[docs] +def get_template_path(): cimeroot = get_cime_root() return os.path.join(cimeroot, "CIME", "data", "templates")
    -
    [docs]def get_tools_path(): + +
    +[docs] +def get_tools_path(): cimeroot = get_cime_root() return os.path.join(cimeroot, "CIME", "Tools")
    -
    [docs]def get_src_root(): + +
    +[docs] +def get_src_root(): """ Return the absolute path to the root of SRCROOT. @@ -521,7 +592,10 @@

    Source code for CIME.utils

         return srcroot
    -
    [docs]def get_cime_default_driver(): + +
    +[docs] +def get_cime_default_driver(): driver = os.environ.get("CIME_DRIVER") if driver: logger.debug("Setting CIME_DRIVER={} from environment".format(driver)) @@ -548,7 +622,10 @@

    Source code for CIME.utils

         return driver
    -
    [docs]def get_all_cime_models(): + +
    +[docs] +def get_all_cime_models(): config_path = get_config_path() models = [] @@ -561,7 +638,10 @@

    Source code for CIME.utils

         return models
    -
    [docs]def set_model(model): + +
    +[docs] +def set_model(model): """ Set the model to be used in this session """ @@ -578,7 +658,10 @@

    Source code for CIME.utils

         cime_config.set("main", "CIME_MODEL", model)
    -
    [docs]def get_model(): + +
    +[docs] +def get_model(): """ Get the currently configured model value The CIME_MODEL env variable may or may not be set @@ -647,6 +730,7 @@

    Source code for CIME.utils

         expect(False, msg)
    + def _get_path(filearg, from_dir): if not filearg.startswith("/") and from_dir is not None: filearg = os.path.join(from_dir, filearg) @@ -677,7 +761,9 @@

    Source code for CIME.utils

         return False
     
     
    -
    [docs]def file_contains_python_function(filepath, funcname): +
    +[docs] +def file_contains_python_function(filepath, funcname): """Checks whether the given file contains a top-level definition of the function 'funcname' Returns a boolean value (True if the file contains this function definition, False otherwise) @@ -692,7 +778,10 @@

    Source code for CIME.utils

         return has_function
    -
    [docs]def fixup_sys_path(*additional_paths): + +
    +[docs] +def fixup_sys_path(*additional_paths): cimeroot = get_cime_root() if cimeroot not in sys.path or sys.path.index(cimeroot) > 0: @@ -708,7 +797,10 @@

    Source code for CIME.utils

                 sys.path.insert(2 + i, x)
    -
    [docs]def import_and_run_sub_or_cmd( + +
    +[docs] +def import_and_run_sub_or_cmd( cmd, cmdargs, subname, @@ -747,8 +839,8 @@

    Source code for CIME.utils

                 run_sub_or_cmd(
                     cmd, cmdargs, subname, subargs, logfile, case, from_dir, timeout
                 )
    -        except Exception as e:
    -            raise e from None
    +        except Exception as e1:
    +            raise e1 from None
         except Exception:
             if logfile:
                 with open(logfile, "a") as log_fd:
    @@ -759,7 +851,10 @@ 

    Source code for CIME.utils

         sys.path = sys_path_old
    -
    [docs]def run_sub_or_cmd( + +
    +[docs] +def run_sub_or_cmd( cmd, cmdargs, subname, subargs, logfile=None, case=None, from_dir=None, timeout=None ): """ @@ -837,7 +932,10 @@

    Source code for CIME.utils

             case.read_xml()
    -
    [docs]def run_cmd( + +
    +[docs] +def run_cmd( cmd, input_str=None, from_dir=None, @@ -973,7 +1071,10 @@

    Source code for CIME.utils

         return stat, output, errput
    -
    [docs]def run_cmd_no_fail( + +
    +[docs] +def run_cmd_no_fail( cmd, input_str=None, from_dir=None, @@ -1038,7 +1139,10 @@

    Source code for CIME.utils

         return output
    -
    [docs]def normalize_case_id(case_id): + +
    +[docs] +def normalize_case_id(case_id): """ Given a case_id, return it in form TESTCASE.GRID.COMPSET.PLATFORM @@ -1064,7 +1168,10 @@

    Source code for CIME.utils

             return case_id
    -
    [docs]def parse_test_name(test_name): + +
    +[docs] +def parse_test_name(test_name): """ Given a CIME test name TESTCASE[_CASEOPTS].GRID.COMPSET[.MACHINE_COMPILER[.TESTMODS]], return each component of the testname with machine and compiler split. @@ -1100,6 +1207,12 @@

    Source code for CIME.utils

         ['ERS', None, 'fe12_123', 'JGF', 'machine', 'compiler', None]
         >>> parse_test_name('ERS.fe12_123.JGF.machine_compiler.test-mods')
         ['ERS', None, 'fe12_123', 'JGF', 'machine', 'compiler', ['test/mods']]
    +    >>> parse_test_name('ERS.fe12_123.JGF.*_compiler.test-mods')
    +    ['ERS', None, 'fe12_123', 'JGF', None, 'compiler', ['test/mods']]
    +    >>> parse_test_name('ERS.fe12_123.JGF.machine_*.test-mods')
    +    ['ERS', None, 'fe12_123', 'JGF', 'machine', None, ['test/mods']]
    +    >>> parse_test_name('ERS.fe12_123.JGF.*_*.test-mods')
    +    ['ERS', None, 'fe12_123', 'JGF', None, None, ['test/mods']]
         >>> parse_test_name('ERS.fe12_123.JGF.machine_compiler.test-mods--other-dir-path--and-one-more')
         ['ERS', None, 'fe12_123', 'JGF', 'machine', 'compiler', ['test/mods', 'other/dir/path', 'and/one/more']]
         >>> parse_test_name('SMS.f19_g16.2000_DATM%QI.A_XLND_SICE_SOCN_XROF_XGLC_SWAV.mach-ine_compiler.test-mods') # doctest: +IGNORE_EXCEPTION_DETAIL
    @@ -1133,6 +1246,10 @@ 

    Source code for CIME.utils

                 ),
             )
             rv[4:5] = rv[4].split("_")
    +        if rv[4] == "*":
    +            rv[4] = None
    +        if rv[5] == "*":
    +            rv[5] = None
             rv.pop()
     
         if rv[-1] is not None:
    @@ -1151,7 +1268,10 @@ 

    Source code for CIME.utils

         return rv
    -
    [docs]def get_full_test_name( + +
    +[docs] +def get_full_test_name( partial_test, caseopts=None, grid=None, @@ -1225,7 +1345,6 @@

    Source code for CIME.utils

         ]
     
         result = partial_test
    -
         for partial_val, arg_val, name in required_fields:
             if partial_val is None:
                 # Add to result based on args
    @@ -1235,9 +1354,14 @@ 

    Source code for CIME.utils

                         partial_test, name
                     ),
                 )
    -            result = "{}{}{}".format(
    -                result, "_" if name == "compiler" else ".", arg_val
    -            )
    +            if name == "machine" and "*_" in result:
    +                result = result.replace("*_", arg_val + "_")
    +            elif name == "compiler" and "_*" in result:
    +                result = result.replace("_*", "_" + arg_val)
    +            else:
    +                result = "{}{}{}".format(
    +                    result, "_" if name == "compiler" else ".", arg_val
    +                )
             elif arg_val is not None and partial_val != partial_compiler:
                 expect(
                     arg_val == partial_val,
    @@ -1292,7 +1416,10 @@ 

    Source code for CIME.utils

         return result
    -
    [docs]def get_current_branch(repo=None): + +
    +[docs] +def get_current_branch(repo=None): """ Return the name of the current branch for a repository @@ -1319,7 +1446,10 @@

    Source code for CIME.utils

                 return output.replace("refs/heads/", "")
    -
    [docs]def get_current_commit(short=False, repo=None, tag=False): + +
    +[docs] +def get_current_commit(short=False, repo=None, tag=False): """ Return the sha1 of the current HEAD commit @@ -1338,12 +1468,18 @@

    Source code for CIME.utils

         return output if rc == 0 else "unknown"
    -
    [docs]def get_model_config_location_within_cime(model=None): + +
    +[docs] +def get_model_config_location_within_cime(model=None): model = get_model() if model is None else model return os.path.join("config", model)
    -
    [docs]def get_scripts_root(): + +
    +[docs] +def get_scripts_root(): """ Get absolute path to scripts @@ -1353,7 +1489,10 @@

    Source code for CIME.utils

         return os.path.join(get_cime_root(), "scripts")
    -
    [docs]def get_model_config_root(model=None): + +
    +[docs] +def get_model_config_root(model=None): """ Get absolute path to model config area" @@ -1367,14 +1506,20 @@

    Source code for CIME.utils

         )
    -
    [docs]def stop_buffering_output(): + +
    +[docs] +def stop_buffering_output(): """ All stdout, stderr will not be buffered after this is called. """ os.environ["PYTHONUNBUFFERED"] = "1"
    -
    [docs]def start_buffering_output(): + +
    +[docs] +def start_buffering_output(): """ All stdout, stderr will be buffered after this is called. This is python's default behavior. @@ -1383,7 +1528,10 @@

    Source code for CIME.utils

         sys.stdout = os.fdopen(sys.stdout.fileno(), "w")
    -
    [docs]def match_any(item, re_counts): + +
    +[docs] +def match_any(item, re_counts): """ Return true if item matches any regex in re_counts' keys. Increments count if a match was found. @@ -1397,7 +1545,10 @@

    Source code for CIME.utils

         return False
    -
    [docs]def get_current_submodule_status(recursive=False, repo=None): + +
    +[docs] +def get_current_submodule_status(recursive=False, repo=None): """ Return the sha1s of the current currently checked out commit for each submodule, along with the submodule path and the output of git describe for the SHA-1. @@ -1413,7 +1564,10 @@

    Source code for CIME.utils

         return output if rc == 0 else "unknown"
    -
    [docs]def copy_globs(globs_to_copy, output_directory, lid=None): + +
    +[docs] +def copy_globs(globs_to_copy, output_directory, lid=None): """ Takes a list of globs and copies all files to `output_directory`. @@ -1437,7 +1591,10 @@

    Source code for CIME.utils

                 )
    -
    [docs]def safe_copy(src_path, tgt_path, preserve_meta=True): + +
    +[docs] +def safe_copy(src_path, tgt_path, preserve_meta=True): """ A flexbile and safe copy routine. Will try to copy file and metadata, but this can fail if the current user doesn't own the tgt file. A fallback data-only copy is @@ -1508,7 +1665,10 @@

    Source code for CIME.utils

             )
    -
    [docs]def safe_recursive_copy(src_dir, tgt_dir, file_map): + +
    +[docs] +def safe_recursive_copy(src_dir, tgt_dir, file_map): """ Copies a set of files from one dir to another. Works even if overwriting a read-only file. Files can be relative paths and the relative path will be @@ -1526,7 +1686,10 @@

    Source code for CIME.utils

             safe_copy(full_src, full_tgt)
    -