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:
Dominik Jain 2024-02-23 23:17:14 +01:00 committed by GitHub
parent 0b61bf8caf
commit 49781e715e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 14 additions and 40 deletions

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from examples.atari.atari_network import ( from examples.atari.atari_network import (
@ -103,5 +102,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
@ -95,5 +94,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
@ -114,5 +113,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from examples.atari.atari_network import ( from examples.atari.atari_network import (
@ -101,5 +100,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
from typing import Literal from typing import Literal
@ -83,5 +82,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
@ -74,5 +73,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
from typing import Literal from typing import Literal
@ -85,5 +84,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
from typing import Literal from typing import Literal
@ -95,5 +94,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
from typing import Literal from typing import Literal
@ -83,5 +82,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
from typing import Literal from typing import Literal
@ -72,5 +71,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
@ -80,5 +79,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
@ -85,5 +84,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import functools
import os import os
from collections.abc import Sequence from collections.abc import Sequence
from typing import Literal from typing import Literal
@ -89,5 +88,4 @@ def main(
if __name__ == "__main__": if __name__ == "__main__":
run_with_default_config = functools.partial(main, experiment_config=ExperimentConfig()) logging.run_cli(main)
logging.run_cli(run_with_default_config)

View File

@ -100,7 +100,7 @@ def run_main(
def run_cli( 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: ) -> T | None:
""" """
Configures logging with the given parameters and runs the given main function as a Configures logging with the given parameters and runs the given main function as a