gedih3.cli.gh3_build#

Functions#

explicit_vars_missing_in_sample(product_vars, ...)

Return {product: [bad_names]} for explicit-list products whose

manifest_check_scope(h3_logger, product_vars)

Return the subset of product_vars that should be validated

preflight_var_specs(h3_logger, product_vars)

Split requested variables between gh3_build's two pre-flight checks.

get_cmd_args()

main()

Module Contents#

gedih3.cli.gh3_build.explicit_vars_missing_in_sample(product_vars, default_products, sample_dict)[source]#

Return {product: [bad_names]} for explicit-list products whose requested variables are absent from the sample HDF5.

Pure function over its inputs — extracted from the gh3_build CLI so the pre-flight typo check can be unit-tested without invoking main().

Parameters:
product_varsdict

Mapping {product: list-or-None}. None means “everything” (*/all) and is skipped. Preset-sourced lists (default, minimal, all/*) are identified by default_products and skipped — their names come from an internal manifest/table, not the user, so a mismatch here is not a typo to catch.

default_productsset

Products to exempt from this check. Despite the name, callers pass the full preset set (e.g. H3BuildLogger.preset_products), not just literal default requests — see that attribute’s docstring.

sample_dictdict

One {product: hdf5_path} mapping from gedidriver.soc_file_tree(). Pass an empty dict to short-circuit.

Returns:
dict

Empty when every explicit-list variable was found (or no explicit lists exist). Otherwise {product: [missing_names]}. Wildcards that match nothing in the sample HDF5 are surfaced as a single GediValidationError string entry under their product.

gedih3.cli.gh3_build.manifest_check_scope(h3_logger, product_vars)[source]#

Return the subset of product_vars that should be validated against the shipped static manifest, per the regime rule:

  • Regime A (fresh build): every product the user passed that was requested via default/def.

  • Regime C (resume + explicit default re-request): only products in h3_logger.default_products that also appear in h3_logger.new_product_vars (i.e. produced a delta).

  • Regimes B & D (resume with granules-only or explicit-list expansion): empty — the build log is authoritative.

An empty return signals the caller to skip validation entirely.

Pure function over logger state so the regime gate can be unit-tested without the full CLI pipeline.

gedih3.cli.gh3_build.preflight_var_specs(h3_logger, product_vars)[source]#

Split requested variables between gh3_build’s two pre-flight checks.

Returns (manifest_specs, sample_specs):

  • manifest_specs: the default preset of each manifest_check_scope() product, to validate against the shipped static manifest: exactly what the manifest vouches for. The requested list can hold other names too, given next to the preset (H3BuildLogger.preset_extra_vars) or, on an update, recorded by the database earlier. Those are not the manifest’s and would always read as missing.

  • sample_specs: what explicit_vars_missing_in_sample() checks against one sample HDF5 per product: every explicit list, plus the names given next to a preset. Pass it with an empty exemption set.

Pure over logger state, like manifest_check_scope().

gedih3.cli.gh3_build.get_cmd_args()[source]#
gedih3.cli.gh3_build.main()[source]#