diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 8832232..cac12eb 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -23,6 +23,7 @@ jobs: "Basic/sensitivity_analysis.py", "Basic/dps_example.py", "Eijgenraam/eijgenraam.py", + "Eijgenraam/eijgenraam_mordm.py", "Languages/Python/lakeModelInPython.py", "Languages/R/lakeModelInR.py", #"Languages/Excel/lakeModelInExcel.py" # requires Windows @@ -70,7 +71,8 @@ jobs: make fi - LD_LIBRARY_PATH="$(pwd):${LD_LIBRARY_PATH}" + export RHODIUM_NO_PROMPT=true + export LD_LIBRARY_PATH="$(pwd):${LD_LIBRARY_PATH}" python "${EXAMPLE_FILE}" - name: Upload figures diff --git a/rhodium/utils.py b/rhodium/utils.py index 37af301..75c0cf7 100644 --- a/rhodium/utils.py +++ b/rhodium/utils.py @@ -15,20 +15,24 @@ # # You should have received a copy of the GNU General Public License # along with Rhodium. If not, see . +import os import sys def promptToRun(message, default="yes"): - if default == "yes": - prompt = "[Y/n]" - elif default == "no": - prompt = "[y/N]" + if os.getenv("RHODIUM_NO_PROMPT"): + response = "" else: - raise ValueError("invalid default answer") + if default == "yes": + prompt = "[Y/n]" + elif default == "no": + prompt = "[y/N]" + else: + raise ValueError("invalid default answer") - print(message + " " + prompt + " ", end='') - sys.stdout.flush() + print(message + " " + prompt + " ", end='') + sys.stdout.flush() - response = sys.stdin.readline().strip() + response = sys.stdin.readline().strip() if response == "": response = default[0]