This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
Benchmark runner test #488
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
@@ -1,6 +1,13 @@ | ||
{ | ||
"include": ["mentat"], | ||
"ignore": ["testbed", "tests", "scripts", "benchmark_repos", "build"], | ||
"ignore": [ | ||
"testbed", | ||
"tests", | ||
"scripts", | ||
"benchmark_repos", | ||
"build", | ||
"benchmarks/benchmark_repos", | ||
], | ||
"typeCheckingMode": "strict", | ||
"reportMissingTypeStubs": false, | ||
} |
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,19 @@ | ||
from mentat.config import Config | ||
|
||
title = "Clojure Exercism Runner" | ||
|
||
description = """ | ||
This benchmark tests the ability to write an exercism test runner for the clojure language. | ||
""" | ||
|
||
prompts = [ | ||
"Write a test runner for the clojure language.", | ||
] | ||
|
||
|
||
repo = "https://github.com/AbanteAI/mentat" | ||
commit = "d611e2ff742856c7328d54f6e71c2418f9c5508b" | ||
minimum_context = ["tests/benchmarks/exercise_runners"] | ||
paths = ["tests/benchmarks/exercise_runners"] | ||
|
||
config = Config() |
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 |
---|---|---|
|
@@ -9,31 +9,33 @@ def test_empty_sequence(self): | |
|
||
def test_pow(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't let the actual accumulate get formatted because it could make the saved gpt output invalid but I'm inclined to let our linter change the test. |
||
self.assertEqual( | ||
accumulate([1, 2, 3, 4, 5], lambda x: x * x), [1, 4, 9, 16, 25]) | ||
accumulate([1, 2, 3, 4, 5], lambda x: x * x), [1, 4, 9, 16, 25] | ||
) | ||
|
||
def test_divmod(self): | ||
self.assertEqual( | ||
accumulate([10, 17, 23], lambda x: divmod(x, 7)), | ||
[(1, 3), (2, 3), (3, 2)]) | ||
accumulate([10, 17, 23], lambda x: divmod(x, 7)), [(1, 3), (2, 3), (3, 2)] | ||
) | ||
|
||
def test_composition(self): | ||
inp = [10, 17, 23] | ||
self.assertEqual( | ||
accumulate( | ||
accumulate(inp, lambda x: divmod(x, 7)), | ||
lambda x: 7 * x[0] + x[1]), inp) | ||
accumulate(inp, lambda x: divmod(x, 7)), lambda x: 7 * x[0] + x[1] | ||
), | ||
inp, | ||
) | ||
|
||
def test_capitalize(self): | ||
self.assertEqual( | ||
accumulate(['hello', 'world'], str.upper), ['HELLO', 'WORLD']) | ||
self.assertEqual(accumulate(["hello", "world"], str.upper), ["HELLO", "WORLD"]) | ||
|
||
def test_recursive(self): | ||
inp = ['a', 'b', 'c'] | ||
out = [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], ['c1', 'c2', 'c3']] | ||
inp = ["a", "b", "c"] | ||
out = [["a1", "a2", "a3"], ["b1", "b2", "b3"], ["c1", "c2", "c3"]] | ||
self.assertEqual( | ||
accumulate( | ||
inp, lambda x: accumulate(list('123'), lambda y: x + y)), out) | ||
accumulate(inp, lambda x: accumulate(list("123"), lambda y: x + y)), out | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
unittest.main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also update pyrightconfig.json, change
benchmark_repos
tobenchmarks
.