From 9fc80295115862e51aa2eef1e98d2b989ca96ee0 Mon Sep 17 00:00:00 2001 From: Kevin Dalton Date: Wed, 18 Feb 2026 10:47:19 -0500 Subject: [PATCH] document tests, make testing more transparent --- README.md | 17 +++++++++++++++++ abismal/command_line/abismal.py | 7 ++++--- abismal/command_line/parser/tf.py | 11 +++++++++++ tests/command_line/test_cli.py | 2 +- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ff10367..e0b62ec 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,20 @@ pip install abismal[cuda] You can now use abismal with GPU acceleration by running `conda activate abismal`. You can test GPU support by typing `abismal --list-devices`. + +# Running tests +Abismal CI runs tests on each pull request. Development installs are similar to a normal install, but it is important +to make sure that you install `abismal[dev]` in a fresh environment. +Running the following commands will set up an environment. +``` +git clone https://github.com/rs-station/abismal.git +cd abismal +conda create -yn abismal -c conda-forge dials python=3.12 +conda activate abismal +pip install -e .[dev] +``` + +Tests are run by calling `pytest` in the root of the abismal source code directory. + + + diff --git a/abismal/command_line/abismal.py b/abismal/command_line/abismal.py index eac0c8e..ee64110 100644 --- a/abismal/command_line/abismal.py +++ b/abismal/command_line/abismal.py @@ -309,7 +309,8 @@ def main(args=None): logger.info("Compiling model") model.compile(opt, run_eagerly=parser.run_eagerly, jit_compile=parser.jit_compile) - if parser.debug: + if parser.embed: + logger.info("Embed selected, entering interactive, IPython shell.") from IPython import embed embed(colors='linux') @@ -341,8 +342,8 @@ def main(args=None): logger.info("Finished training.") - if parser.debug: - logger.info("Debug mode selected, entering interactive, IPython shell.") + if parser.embed: + logger.info("Embed selected, entering interactive, IPython shell.") from IPython import embed embed(colors="linux") diff --git a/abismal/command_line/parser/tf.py b/abismal/command_line/parser/tf.py index e45cdbf..b67de30 100644 --- a/abismal/command_line/parser/tf.py +++ b/abismal/command_line/parser/tf.py @@ -61,6 +61,17 @@ def __call__(self, *args, **kwargs): } ), + + ( + ( + "--embed", + ),{ + "help": "Embed into an IPython shell just before and just after the model is trained. Helpful for debugging.", + "action" : "store_true", + } + ), + + ( ( "--list-devices", diff --git a/tests/command_line/test_cli.py b/tests/command_line/test_cli.py index b767f38..712322a 100644 --- a/tests/command_line/test_cli.py +++ b/tests/command_line/test_cli.py @@ -23,7 +23,7 @@ "--shuffle-buffer-size=10", "--steps-per-epoch=10", "--num-cpus=1", - #"--debug", + "--debug", ) def run_abismal(flags, files, additional_asserts=()):