Breakend / experiment-impact-tracker

MIT License
266 stars 31 forks source link

fix create-compute-appendix #52

Closed jieru-hu closed 3 years ago

jieru-hu commented 3 years ago

Address https://github.com/Breakend/experiment-impact-tracker/issues/39

I was able to reproduce the issue, but basically the tl;dr is we can not check if a dataframe is empty by if dataframe but instead do something like if not dataframe.empty

Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/test-j/bin/create-compute-appendix", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/Users/jieruhu/workspace/experiment-impact-tracker/scripts/create-compute-appendix", line 429, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/Users/jieruhu/workspace/experiment-impact-tracker/scripts/create-compute-appendix", line 425, in main
    _recursive_create(all_log_dirs, args.output_dir, site_spec)
  File "/Users/jieruhu/workspace/experiment-impact-tracker/scripts/create-compute-appendix", line 362, in _recursive_create
    _recursive_create(filtered_dirs, new_output_dir,
  File "/Users/jieruhu/workspace/experiment-impact-tracker/scripts/create-compute-appendix", line 362, in _recursive_create
    _recursive_create(filtered_dirs, new_output_dir,
  File "/Users/jieruhu/workspace/experiment-impact-tracker/scripts/create-compute-appendix", line 381, in _recursive_create
    _create_leaf_page(output_directory, all_infos, experiment_set, values["description"],
  File "/Users/jieruhu/workspace/experiment-impact-tracker/scripts/create-compute-appendix", line 284, in _create_leaf_page
    if gpu_infos_all and gpu_infos_all[exp_set_name] and gpu_infos_all[exp_set_name][i]:
  File "/usr/local/anaconda3/envs/test-j/lib/python3.8/site-packages/pandas/core/generic.py", line 1439, in __nonzero__
    raise ValueError(
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

testing:

run the script on experiment results from ClimateChangeFromMachineLearningResearch and verify the doc is created correctly

$ create-compute-appendix $RESULTS/experiment_results --site_spec $RESULTS/appendix_website_definitions/website_defs.json --output_dir ./docs/