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

ParamRegistry/Interface: added facilities to remove entries #100

Merged
merged 2 commits into from
Nov 17, 2018

Conversation

aasseman
Copy link
Contributor

fixes #99
I have not tested though. I am counting on you guys :)

@aasseman aasseman added the enhancement New feature or request label Nov 16, 2018
@aasseman
Copy link
Contributor Author

I did not implement __delitem__ though. But since it is a very optional thing, I'll leave it for anyone who wants to do it.

@vmarois
Copy link
Contributor

vmarois commented Nov 16, 2018

Hey @aasseman Thanks for that!

I have tried to run it but it seems that it is not working with the minimal reproducible example below. Or I am missing something?

import os
import yaml
from miprometheus.utils import ParamInterface

params = ParamInterface()

yaml_config = os.path.expanduser('~/mi-prometheus/configs/vision/simplecnn_mnist.yaml')

params.add_config_params_from_yaml(yaml_path=yaml_config)

conf_str = yaml.safe_dump(params['testing'].to_dict(), default_flow_style=False)
conf_str += '=' * 80 + '\n'
print(conf_str)

params['testing']['problem'].del_config_params('resize')

conf_str = yaml.safe_dump(params['testing'].to_dict(), default_flow_style=False)
conf_str += '=' * 80 + '\n'
print(conf_str)  # the 'resize' key is still present

@vmarois
Copy link
Contributor

vmarois commented Nov 17, 2018

Have updated the doc in other branch, will merge it just after merging that one 👍

@vmarois vmarois merged commit 7d10b7c into IBM:develop Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to remove keys from registry
2 participants