Nb-replace with boolean value

I want to use guild to run a notebook as an experiment. I also want to parameterize the notebook by using guilds search and replace option with notebooks.

One of my parameters is a boolean value. How should I define the nb-replace to work with booleans?

1 Like

I wanted to make sure Guild was working here so I created an issue resolution doc.

Here’s an example Guild file:

And the Notebook source (copied from test.ipynb):

def test():
    x = True
    if x:
        print("It is alive!")
    else:
        print("Sad :(")

test()

You can test this by running:

guild run test -y

You can run the example code in README.md this way:

guild check -nt README.md

If you’re running into problems, you can try experimenting with changes to that project to reflect your case (e.g. fork the repo, make changes that show your case and submit a PR — we can then see exactly what’s going on). The example above may be overly simplistic.