Skip to content

Instantly share code, notes, and snippets.

@raytroop
Last active May 3, 2020 09:26
Show Gist options
  • Save raytroop/bc26747bc1d235739ca937658e08b440 to your computer and use it in GitHub Desktop.
Save raytroop/bc26747bc1d235739ca937658e08b440 to your computer and use it in GitHub Desktop.
import click
@click.command(help='Get evaluation result.')
@click.argument('exp_dir')
@click.option('--force', '-f', is_flag=True, default=False, help='Overwrite previous evaluation result.')
@click.option('--iteration', '-i', type=str, required=True, multiple=True,
help='specified multiple iterations in one run by E.g, -i 10 -i 400')
@click.option('--fa', type=float, default=None, help='Set threshold by fa.')
@click.option('--threshold', type=float, default=None, help='Set threshold.')
@click.option('--recall', type=float, default=None, help='Set threshold by recall.')
def evaluate(*args, **kwargs):
"""
:param args: always empty
:param kwargs: all argument and option of click
:return:
"""
print(args)
print('-----------------------')
print(kwargs)
if __name__ == '__main__':
evaluate()
#$ python myclk.py here -i 180k
# ()
# -----------------------
# {'exp_dir': 'here', 'fa': None, 'iteration': ('180k',), 'recall': None, 'threshold': None, 'force': True}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment