features = [path[len(patch_location):path.rfind(".")].split("/") for path in paths]
features = [(feature[0], feature[1]) if len(feature) > 1 else (feature[0], None) for feature in features]
features = [(FeatureType(ftype), fname) for ftype, fname in features]
streams = (s3client.get_object(Bucket=bucket_name, Key=path)["Body"].read() for path in paths)
for stream, feature in zip(streams, features):
eopatch[feature] = pickle.loads(stream)
After Change
ftrs = [(feature[0], feature[1]) if len(feature) > 1 else (feature[0], None) for feature in ftrs]
ftrs = [(FeatureType(ftype), fname) for ftype, fname in ftrs]
requested_features = [(ftype, fname) for ftype, fname in FeatureParser(features)]
load_content = []
for (ftype, fname), path in zip(ftrs, paths):
if ftype in [ftype for ftype, _ in requested_features]:
if (ftype, fname) in requested_features or (ftype, Ellipsis) in requested_features:
load_content.append([(ftype, fname), path])