Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove feature_configs for drop features #431

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions easy_rec/python/tools/add_feature_info_to_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def main(argv):
except common_io.exception.OutOfRangeException:
reader.close()
break

for feature_config in config_util.get_compatible_feature_configs(
pipeline_config):
feature_configs = config_util.get_compatible_feature_configs(pipeline_config, drop_feature_names)
for feature_config in feature_configs:
wwxxzz marked this conversation as resolved.
Show resolved Hide resolved
feature_name = feature_config.input_names[0]
if feature_name in feature_info_map:
logging.info('edited %s' % feature_name)
Expand Down
9 changes: 7 additions & 2 deletions easy_rec/python/utils/config_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,19 @@ def add_boundaries_to_config(pipeline_config, tables):
logging.info('edited %s' % feature_name)


def get_compatible_feature_configs(pipeline_config):
def get_compatible_feature_configs(pipeline_config,drop_feature_names=None):
if pipeline_config.feature_configs:
feature_configs = pipeline_config.feature_configs
else:
feature_configs = pipeline_config.feature_config.features
if drop_feature_names:
tmp_feature_configs = feature_configs[:]
for fea_cfg in tmp_feature_configs:
fea_name = fea_cfg.input_names[0]
if fea_name in drop_feature_names:
feature_configs.remove(fea_cfg)
return feature_configs


def parse_time(time_data):
"""Parse time string to timestamp.

Expand Down