From 66b2ff5398d7f7dcd5f1f52b1fd767176ad4b545 Mon Sep 17 00:00:00 2001 From: Bouwe Andela Date: Thu, 6 Aug 2020 17:13:07 +0200 Subject: [PATCH] Move cmor_check_data to early in preprocessing chain --- esmvalcore/preprocessor/__init__.py | 10 +++++----- esmvalcore/preprocessor/_reformat.py | 13 ------------- 2 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 esmvalcore/preprocessor/_reformat.py diff --git a/esmvalcore/preprocessor/__init__.py b/esmvalcore/preprocessor/__init__.py index 39027da125..8cd0a8dda4 100644 --- a/esmvalcore/preprocessor/__init__.py +++ b/esmvalcore/preprocessor/__init__.py @@ -8,6 +8,8 @@ from .._provenance import TrackedFile from .._task import BaseTask +from ..cmor.check import cmor_check_data, cmor_check_metadata +from ..cmor.fix import fix_data, fix_file, fix_metadata from ._area import (area_statistics, extract_named_regions, extract_region, extract_shape, meridional_statistics, zonal_statistics) from ._cycles import amplitude @@ -21,8 +23,6 @@ mask_landsea, mask_landseaice, mask_outside_range) from ._multimodel import multi_model_statistics from ._other import clip -from ._reformat import (cmor_check_data, cmor_check_metadata, fix_data, - fix_file, fix_metadata) from ._regrid import extract_levels, extract_point, regrid from ._time import (annual_statistics, anomalies, climate_statistics, daily_statistics, decadal_statistics, extract_month, @@ -54,6 +54,7 @@ 'extract_month', # Data reformatting/CMORization 'fix_data', + 'cmor_check_data', # Level extraction 'extract_levels', # Weighting @@ -106,7 +107,6 @@ 'anomalies', 'regrid_time', 'timeseries_filter', - 'cmor_check_data', 'convert_units', # Save to file 'save', @@ -130,8 +130,8 @@ DEFAULT_ORDER = tuple(__all__) # The order of initial and final steps cannot be configured -INITIAL_STEPS = DEFAULT_ORDER[:DEFAULT_ORDER.index('fix_data') + 1] -FINAL_STEPS = DEFAULT_ORDER[DEFAULT_ORDER.index('cmor_check_data'):] +INITIAL_STEPS = DEFAULT_ORDER[:DEFAULT_ORDER.index('cmor_check_data') + 1] +FINAL_STEPS = DEFAULT_ORDER[DEFAULT_ORDER.index('save'):] MULTI_MODEL_FUNCTIONS = { 'multi_model_statistics', diff --git a/esmvalcore/preprocessor/_reformat.py b/esmvalcore/preprocessor/_reformat.py deleted file mode 100644 index c6ab17337b..0000000000 --- a/esmvalcore/preprocessor/_reformat.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Simple interface to reformat and CMORize functions.""" -from ..cmor.check import cmor_check, cmor_check_data, cmor_check_metadata -from ..cmor.fix import fix_data, fix_file, fix_metadata - - -__all__ = [ - 'cmor_check', - 'cmor_check_metadata', - 'cmor_check_data', - 'fix_file', - 'fix_metadata', - 'fix_data', -]