Skip to content
Snippets Groups Projects
Commit fa8912ef authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Merge branch 'py27-keyword-attribute' into 'master'

Updated CI to expose a bug in bilby_result for python2.7, then fixed it

See merge request !601
parents 6e1fec17 262c0607
No related branches found
No related tags found
1 merge request!601Updated CI to expose a bug in bilby_result for python2.7, then fixed it
Pipeline #81234 passed
......@@ -24,9 +24,15 @@ stages:
- python -m pip install .
- python -c "import bilby"
- python -c "import bilby.core"
- python -c "import bilby.core.sampler"
- python -c "import bilby.gw"
- python -c "import bilby.gw.detector"
- python -c "import bilby.gw.sampler"
- python -c "import bilby.hyper"
- python -c "import cli_bilby"
- for script in $(pip show -f bilby | grep "bin\/" | xargs -I {} basename {}); do
${script} --help;
done
# test basic setup on python2
basic-2.7:
......@@ -43,7 +49,7 @@ python-2.7:
stage: test
image: bilbydev/bilby-test-suite-python27
script:
- python setup.py install
- python -m pip install .
# Run tests without finding coverage
- pytest --ignore=test/utils_py3_test.py
......@@ -52,7 +58,7 @@ python-3.7:
stage: test
image: bilbydev/bilby-test-suite-python37
script:
- python setup.py install
- python -m pip install .
# Run pyflakes
- flake8 .
......@@ -80,7 +86,7 @@ scheduled-python-3.7:
only:
- schedules
script:
- python setup.py install
- python -m pip install .
# Run tests which are only done on schedule
- pytest test/example_test.py
......
......@@ -47,7 +47,7 @@ def setup_command_line_args():
help="New label for output result object")
parser.add_argument("-b", "--bayes", action='store_true',
help="Print all Bayes factors.")
parser.add_argument("-p", "--print", nargs='+', default=None,
parser.add_argument("-p", "--print", nargs='+', default=None, dest="keys",
help="Result dictionary keys to print.")
parser.add_argument("--call", nargs='+', default=None,
help="Result dictionary methods to call (no argument passing available).")
......@@ -98,7 +98,7 @@ def drop_to_ipython(results_list):
def print_matches(results_list, args):
for r in results_list:
print("\nResult file: {}/{}".format(r.outdir, r.label))
for key in args.print:
for key in args.keys:
for attr in r.__dict__:
if key in attr:
print_line = [
......@@ -113,7 +113,7 @@ def main():
if args.convert:
for r in results_list:
r.save_to_file(extension=args.convert, outdir=args.outdir)
if args.print is not None:
if args.keys is not None:
print_matches(results_list, args)
if args.call is not None:
for r in results_list:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment