<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import argparse <EOL> from ecohydrolib . context import Context <EOL> from ecohydrolib . metadata import GenericMetadata <EOL> from ecohydrolib . metadata import AssetProvenance <EOL> from ecohydrolib . ssurgo import rasterize <EOL> from ecohydrolib . ssurgo import attributequery <EOL> from ecohydrolib . solim . inference import inferSoilPropertiesForSSURGOAndTerrainData <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , required = False , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , required = True , <EOL> help = '<STR_LIT>' ) <EOL> args = parser . parse_args ( ) <EOL> cmdline = GenericMetadata . getCommandLine ( ) <EOL> configFile = None <EOL> if args . configfile : <EOL> configFile = args . configfile <EOL> context = Context ( args . projectDir , configFile ) <EOL> if not context . config . has_option ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> sys . exit ( "<STR_LIT>" & ( args . configfile , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> ssurgoProvenance = [ i for i in GenericMetadata . readAssetProvenanceObjects ( context ) if i . name == '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> if ssurgoProvenance is None : <EOL> sys . exit ( "<STR_LIT>" ) <EOL> manifest = GenericMetadata . readManifestEntries ( context ) <EOL> shpFilename = manifest [ '<STR_LIT>' ] <EOL> shpFilepath = os . path . join ( context . projectDir , shpFilename ) <EOL> demFilename = manifest [ '<STR_LIT>' ] <EOL> demFilepath = os . path . join ( context . projectDir , demFilename ) <EOL> layerName = os . path . splitext ( shpFilename ) [ <NUM_LIT:0> ] <EOL> studyArea = GenericMetadata . readStudyAreaEntries ( context ) <EOL> outputrasterresolutionX = studyArea [ '<STR_LIT>' ] <EOL> outputrasterresolutionY = studyArea [ '<STR_LIT>' ] <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> sys . stdout . flush ( ) <EOL> attrList = [ elem [ : <NUM_LIT:10> ] for elem in attributequery . ATTRIBUTE_LIST_NUMERIC ] <EOL> rasterFiles = inferSoilPropertiesForSSURGOAndTerrainData ( config = context . config , outputDir = context . projectDir , shpFilepath = shpFilepath , demFilepath = demFilepath , featureAttrList = attrList ) <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> for attr in rasterFiles . keys ( ) : <EOL> asset = AssetProvenance ( GenericMetadata . MANIFEST_SECTION ) <EOL> asset . name = "<STR_LIT>" % ( attr , ) <EOL> asset . dcIdentifier = rasterFiles [ attr ] <EOL> asset . dcSource = '<STR_LIT>' <EOL> asset . dcTitle = attr <EOL> asset . dcPublisher = '<STR_LIT>' <EOL> asset . dcDescription = cmdline <EOL> asset . writeToMetadata ( context ) <EOL> GenericMetadata . appendProcessingHistoryItem ( context , cmdline ) </s>
