def plot(benchmark, filename=None, kinds=('suboptimality_curve', ), display=True, html=True, plotly=False, all_files=False): if all_files: assert filename is None, ( "Cannot use `--all` and `--filename` simultaneously.") assert html, '`--all` can only be used for HTML plot generation.' filename = 'all' if html and len(kinds) > 0: warnings.warn("Cannot specify '--kind' for HTML plot, this options " "will be ignored.") # Get the result file benchmark = Benchmark(benchmark) result_filename = benchmark.get_result_file(filename) # Plot the results. from benchopt.plotting import plot_benchmark plot_benchmark(result_filename, benchmark, kinds=kinds, display=display, plotly=plotly, html=html)
def plot(benchmark, filename=None, kinds=('suboptimality_curve', ), display=True, plotly=False): # Get the result file benchmark = Benchmark(benchmark) result_filename = benchmark.get_result_file(filename) # Plot the results. df = pd.read_csv(result_filename) plot_benchmark(df, benchmark, kinds=kinds, display=display, plotly=plotly)
def plot(benchmark, filename=None, kinds=('suboptimality_curve', ), display=True, plotly=False): # Get the result file benchmark = Benchmark(benchmark) result_filename = benchmark.get_result_file(filename) # Load the results. import pandas as pd df = pd.read_csv(result_filename) # Plot the results. from benchopt.plotting import plot_benchmark plot_benchmark(df, benchmark, kinds=kinds, display=display, plotly=plotly)
def publish(benchmark, token=None, filename=None): if token is None: token = get_global_setting('github_token') if token is None: raise RuntimeError( "Could not find the token value to connect to GitHub.\n\n" "Please go to https://github.com/settings/tokens to generate a " "personal token $TOKEN.\nThen, either provide it with option `-t` " "or put it in a config file ./benchopt.ini\nunder section " "[benchopt] as `github_token = $TOKEN`.") # Get the result file benchmark = Benchmark(benchmark) result_filename = benchmark.get_result_file(filename) # Publish the result. publish_result_file(benchmark.name, result_filename, token)