-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #464 from dyson-ai/feature/publish
Feature/publish
- Loading branch information
Showing
6 changed files
with
169 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""This file has an example of how to publish a report to github pages""" | ||
|
||
import math | ||
import bencher as bch | ||
|
||
|
||
class SimpleFloat(bch.ParametrizedSweep): | ||
theta = bch.FloatSweep( | ||
default=0, bounds=[0, math.pi], doc="Input angle", units="rad", samples=30 | ||
) | ||
out_sin = bch.ResultVar(units="v", doc="sin of theta") | ||
|
||
def __call__(self, **kwargs): | ||
self.update_params_from_kwargs(**kwargs) | ||
self.out_sin = math.sin(self.theta) | ||
return super().__call__(**kwargs) | ||
|
||
|
||
if __name__ == "__main__": | ||
# publish from report | ||
bench = SimpleFloat().to_bench() | ||
bench.plot_sweep() | ||
bench.report.publish_gh_pages(github_user="blooop", repo_name="reports", folder_name="r5") | ||
# TODO DON'T OVERWRITE ^ EXAMPLE WHEN RUNNING CODE BELOW | ||
|
||
# publish from benchrunner | ||
bench_r = bch.BenchRunner( | ||
"SimpleFloat", publisher=bch.GithubPagesCfg("blooop", "reports", "r6") | ||
) | ||
bench_r.add_bench(SimpleFloat()) | ||
bench_r.run(level=3, show=True, publish=True) |
Oops, something went wrong.