Skip to content

Commit

Permalink
updated gui cmd line inputs to use argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
htjb committed Feb 1, 2021
1 parent 84b48f3 commit 49374c0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions scripts/globalemu
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import matplotlib.pyplot as plt
from PIL import ImageTk, Image
from globalemu.eval import evaluate
import numpy as np
import sys


base_dir = sys.argv[1]
if len(sys.argv) > 2:
xHI=bool(sys.argv[2])
else:
xHI=False
import argparse

parser = argparse.ArgumentParser(
description='Interactive exploration of the Global 21-cm Signal')
parser.add_argument('base_dir', type=str, nargs=1,
help='a base directory containing a trained model.')
parser.add_argument('--xHI', type=bool, const=True, default=False, nargs='?',
help='a boolean indication if the network is for neutral fraction history.')
args = parser.parse_args()
base_dir = args.base_dir[0]
xHI = args.xHI

window = Tk()
window.geometry("800x600")
Expand Down
Binary file modified tests/__pycache__/test_eval.cpython-38-pytest-6.2.2.pyc
Binary file not shown.
Binary file modified tests/__pycache__/test_preprocess.cpython-38-pytest-6.2.2.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
def test_existing_dir():
#download(False).model()
#download(True).model()
res = evaluate(params, z=z, base_dir='best_T/')
#res = evaluate(params, z=z, base_dir='best_xHI/', xHI=True)
res = evaluate(params, z=10, base_dir='best_T/')
res = evaluate(params, z=z, base_dir='T_release/')
#res = evaluate(params, z=z, base_dir='xHI_release/', xHI=True)
res = evaluate(params, z=10, base_dir='T_release/')

0 comments on commit 49374c0

Please sign in to comment.