Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Resyntax fixes #1153

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/api/demo.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
(list (header #"X-Job-Count" (string->bytes/utf-8 (~a (job-count))))
(header #"X-Herbie-Job-ID" (string->bytes/utf-8 job-id))
(header #"Access-Control-Allow-Origin" (string->bytes/utf-8 "*")))
(λ (out) `()))]
(λ (out) (append)))]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look ideal @jackfirth

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(λ (out) (append)))]
void)]

[job-result
(response 201
#"Job complete"
Expand Down Expand Up @@ -396,7 +396,7 @@
(list (header #"X-Job-Count" (string->bytes/utf-8 (~a (job-count))))
(header #"X-Herbie-Job-ID" (string->bytes/utf-8 job-id))
(header #"Access-Control-Allow-Origin" (string->bytes/utf-8 "*")))
(λ (out) `()))]
(λ (out) (append)))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(λ (out) (append)))]
void)]

[job-result
(response 201
#"Job complete"
Expand Down
29 changes: 15 additions & 14 deletions src/api/sandbox.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -374,20 +374,21 @@
(define end-est-score (car end-train-scores))
(define end-score (car end-test-scores))
(define status
(if (not (null? best-score))
(begin
(cond
[(< end-score (- best-score fuzz)) "gt-target"]
[(< end-score (+ best-score fuzz)) "eq-target"]
[(> end-score (+ start-test-score fuzz)) "lt-start"]
[(> end-score (- start-test-score fuzz)) "eq-start"]
[(> end-score (+ best-score fuzz)) "lt-target"]))

(cond
[(and (< start-test-score 1) (< end-score (+ start-test-score 1))) "ex-start"]
[(< end-score (- start-test-score 1)) "imp-start"]
[(< end-score (+ start-test-score fuzz)) "apx-start"]
[else "uni-start"])))
(cond
[(not (null? best-score))
(cond
[(< end-score (- best-score fuzz)) "gt-target"]
[(< end-score (+ best-score fuzz)) "eq-target"]
[(> end-score (+ start-test-score fuzz)) "lt-start"]
[(> end-score (- start-test-score fuzz)) "eq-start"]
[(> end-score (+ best-score fuzz)) "lt-target"])]

[else
(cond
[(and (< start-test-score 1) (< end-score (+ start-test-score 1))) "ex-start"]
[(< end-score (- start-test-score 1)) "imp-start"]
[(< end-score (+ start-test-score fuzz)) "apx-start"]
[else "uni-start"])]))

(struct-copy table-row
(dummy-table-row-from-hash result-hash status link)
Expand Down
12 changes: 6 additions & 6 deletions src/api/shell.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
([,(*num-points*) ,(table-row-start-est row)] [,(*reeval-pts*) ,(table-row-start row)])
:herbie-error-output
([,(*num-points*) ,(table-row-result-est row)] [,(*reeval-pts*) ,(table-row-result row)])
,@(append (for/list ([rec (in-list (table-row-target row))])
(match-define (list cost score) rec)
`(:herbie-error-target ([,(*reeval-pts*) ,(table-row-target row)]))))
,@(for/list ([rec (in-list (table-row-target row))])
(match-define (list cost score) rec)
`(:herbie-error-target ([,(*reeval-pts*) ,(table-row-target row)])))
,@(if (empty? (table-row-warnings row))
'()
`(:herbie-warnings ,(table-row-warnings row)))
Expand All @@ -41,9 +41,9 @@
,@(if (equal? (table-row-preprocess row) empty)
'()
`(:herbie-preprocess ,(table-row-preprocess row)))
,@(append (for/list ([(target enabled?) (in-dict (table-row-target-prog row))]
#:when enabled?)
`(:alt ,target)))
,@(for/list ([(target enabled?) (in-dict (table-row-target-prog row))]
#:when enabled?)
`(:alt ,target))
,(prog->fpcore expr ctx)))

(define (get-shell-input)
Expand Down