Skip to content
Snippets Groups Projects
Commit 81d7c253 authored by Colm Talbot's avatar Colm Talbot
Browse files

Merge branch 'fix-scheduled-tests' into 'master'

Fixes the scheduled tests

See merge request !408
parents 47afcd7c d5fad496
No related branches found
No related tags found
1 merge request!408Fixes the scheduled tests
Pipeline #54313 passed with warnings
...@@ -79,18 +79,9 @@ scheduled-python-3.7: ...@@ -79,18 +79,9 @@ scheduled-python-3.7:
image: bilbydev/bilby-test-suite-python37 image: bilbydev/bilby-test-suite-python37
only: only:
- schedules - schedules
before_script:
# Install the dependencies specified in the Pipfile
- pipenv install --three --python=/opt/conda/bin/python --system --deploy
script: script:
- python setup.py install - python setup.py install
# Run pyflakes
- flake8 .
# Run tests
- pytest
# Run tests which are only done on schedule # Run tests which are only done on schedule
- pytest test/example_test.py - pytest test/example_test.py
- pytest test/gw_example_test.py - pytest test/gw_example_test.py
......
...@@ -378,6 +378,7 @@ class Dynesty(NestedSampler): ...@@ -378,6 +378,7 @@ class Dynesty(NestedSampler):
def _run_test(self): def _run_test(self):
import dynesty import dynesty
import pandas as pd
self.sampler = dynesty.NestedSampler( self.sampler = dynesty.NestedSampler(
loglikelihood=self.log_likelihood, loglikelihood=self.log_likelihood,
prior_transform=self.prior_transform, prior_transform=self.prior_transform,
...@@ -387,7 +388,8 @@ class Dynesty(NestedSampler): ...@@ -387,7 +388,8 @@ class Dynesty(NestedSampler):
self.sampler.run_nested(**sampler_kwargs) self.sampler.run_nested(**sampler_kwargs)
self.result.samples = np.random.uniform(0, 1, (100, self.ndim)) self.result.samples = pd.DataFrame(
self.priors.sample(100))[self.search_parameter_keys].values
self.result.log_evidence = np.nan self.result.log_evidence = np.nan
self.result.log_evidence_err = np.nan self.result.log_evidence_err = np.nan
return self.result return self.result
...@@ -48,7 +48,7 @@ priors['geocent_time'] = bilby.core.prior.Uniform( ...@@ -48,7 +48,7 @@ priors['geocent_time'] = bilby.core.prior.Uniform(
name='geocent_time', latex_label='$t_c$', unit='$s$') name='geocent_time', latex_label='$t_c$', unit='$s$')
# These parameters will not be sampled # These parameters will not be sampled
for key in ['a_1', 'a_2', 'tilt_1', 'tilt_2', 'phi_12', 'phi_jl', 'theta_jn', 'ra', for key in ['a_1', 'a_2', 'tilt_1', 'tilt_2', 'phi_12', 'phi_jl', 'theta_jn', 'ra',
'dec']: 'dec', 'mass_1', 'mass_2']:
priors[key] = injection_parameters[key] priors[key] = injection_parameters[key]
# Initialise GravitationalWaveTransient # Initialise GravitationalWaveTransient
......
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