forked from aibasel/lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
260 additions
and
147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _faq: | ||
|
||
Frequently asked questions | ||
========================== | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /usr/bin/env python | ||
|
||
"""Filter lines from run.err that stem from "expected errors".""" | ||
|
||
from pathlib import Path | ||
import shutil | ||
|
||
|
||
IGNORE_PATTERNS = [ | ||
"CPU time limit exceeded", | ||
"std::bad_alloc", | ||
"WARNING: will ignore action costs", | ||
"differs from the one in the portfolio file", | ||
"Terminated", | ||
"Killed", | ||
] | ||
|
||
|
||
def main(): | ||
print("Running filter-stderr.py") | ||
stderr = Path("run.err") | ||
if stderr.is_file(): | ||
need_to_filter = False | ||
filtered_content = [] | ||
with open(stderr, "r") as f: | ||
for line in f: | ||
if any(pattern in line for pattern in IGNORE_PATTERNS): | ||
need_to_filter = True | ||
else: | ||
filtered_content.append(line) | ||
|
||
if need_to_filter: | ||
shutil.move(stderr, "run.err.bak") | ||
# We write an empty file if everything has been filtered. Lab | ||
# will remove empty run.err files later. | ||
with open(stderr, "w") as f: | ||
f.writelines(filtered_content) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Oops, something went wrong.