Fix high-level examples (#1060)
The high-level examples were all broken by changes made to make mypy pass. This PR fixes them, making a type change in logging.run_cli instead to make mypy happy.
This commit is contained in:
parent
0b61bf8caf
commit
49781e715e
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
|
||||
from examples.atari.atari_network import (
|
||||
@ -103,5 +102,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
|
||||
@ -95,5 +94,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
|
||||
@ -114,5 +113,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
|
||||
from examples.atari.atari_network import (
|
||||
@ -101,5 +100,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
from typing import Literal
|
||||
@ -83,5 +82,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
|
||||
@ -74,5 +73,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
from typing import Literal
|
||||
@ -85,5 +84,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
from typing import Literal
|
||||
@ -95,5 +94,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
from typing import Literal
|
||||
@ -83,5 +82,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
from typing import Literal
|
||||
@ -72,5 +71,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
|
||||
@ -80,5 +79,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
|
||||
@ -85,5 +84,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import functools
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
from typing import Literal
|
||||
@ -89,5 +88,4 @@ def main(
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig())
|
||||
logging.run_cli(run_with_default_config)
|
||||
logging.run_cli(main)
|
||||
|
@ -100,7 +100,7 @@ def run_main(
|
||||
|
||||
|
||||
def run_cli(
|
||||
main_fn: Callable[[], T], format: str = LOG_DEFAULT_FORMAT, level: int = lg.DEBUG
|
||||
main_fn: Callable[..., T], format: str = LOG_DEFAULT_FORMAT, level: int = lg.DEBUG
|
||||
) -> T | None:
|
||||
"""
|
||||
Configures logging with the given parameters and runs the given main function as a
|
||||
|
Loading…
x
Reference in New Issue
Block a user