From 45af1cc61a881c6f8d251627e57f489a520f8b78 Mon Sep 17 00:00:00 2001
From: Moritz <email@moritz-huebner.de>
Date: Wed, 1 May 2019 18:07:25 +1000
Subject: [PATCH] Reverted some minor changes

---
 examples/open_data_examples/GW150914.py       |   1 -
 .../open_data_examples/GW150914_advanced.py   |   1 -
 .../open_data_examples/GW150914_minimal.py    |   1 -
 examples/open_data_examples/GW170817.py       |   1 -
 .../open_data_examples/read_gracedb_data.py   |   2 -
 .../supernova_example/supernova_example.py    |   2 -
 test/detector_test.py                         | 112 +++++++++---------
 test/gw_likelihood_test.py                    |   4 +-
 test/make_standard_data.py                    |   1 -
 9 files changed, 55 insertions(+), 70 deletions(-)

diff --git a/examples/open_data_examples/GW150914.py b/examples/open_data_examples/GW150914.py
index 125a5a2df..6fc284ea7 100644
--- a/examples/open_data_examples/GW150914.py
+++ b/examples/open_data_examples/GW150914.py
@@ -8,7 +8,6 @@ commonly used prior distributions.  This will take a few hours to run.
 """
 from __future__ import division, print_function
 import bilby
-import bilby.gw.detector
 
 outdir = 'outdir'
 label = 'GW150914'
diff --git a/examples/open_data_examples/GW150914_advanced.py b/examples/open_data_examples/GW150914_advanced.py
index 7ef882f03..492ae93af 100755
--- a/examples/open_data_examples/GW150914_advanced.py
+++ b/examples/open_data_examples/GW150914_advanced.py
@@ -12,7 +12,6 @@ List of events in BILBY dict: run -> help(bilby.gw.utils.get_event_time(event))
 """
 from __future__ import division, print_function
 import bilby
-import bilby.gw.detector
 
 outdir = 'outdir'
 label = 'GW150914'
diff --git a/examples/open_data_examples/GW150914_minimal.py b/examples/open_data_examples/GW150914_minimal.py
index cfa8c9251..e37cb0003 100644
--- a/examples/open_data_examples/GW150914_minimal.py
+++ b/examples/open_data_examples/GW150914_minimal.py
@@ -5,7 +5,6 @@ stimation on GW150914 using open data.
 
 """
 import bilby
-import bilby.gw.detector
 
 prior = bilby.gw.prior.BBHPriorDict(filename='GW150914.prior')
 interferometers = bilby.gw.detector.get_event_data("GW150914")
diff --git a/examples/open_data_examples/GW170817.py b/examples/open_data_examples/GW170817.py
index 65d5df5e5..2130cbbb0 100644
--- a/examples/open_data_examples/GW170817.py
+++ b/examples/open_data_examples/GW170817.py
@@ -6,7 +6,6 @@ Here GW170817 is used as an example.
 """
 from __future__ import division, print_function
 import bilby
-import bilby.gw.detector
 
 outdir = 'outdir'
 label = 'GW170817'
diff --git a/examples/open_data_examples/read_gracedb_data.py b/examples/open_data_examples/read_gracedb_data.py
index 4e59874a2..ee1f53521 100644
--- a/examples/open_data_examples/read_gracedb_data.py
+++ b/examples/open_data_examples/read_gracedb_data.py
@@ -7,8 +7,6 @@ This tutorial must be run on a LIGO cluster.
 """
 
 import bilby
-import bilby.gw.detector
-import bilby.gw.detector
 
 label = 'GW170608'
 outdir = label + '_out'
diff --git a/examples/supernova_example/supernova_example.py b/examples/supernova_example/supernova_example.py
index d0cca28b0..507c4e4ed 100644
--- a/examples/supernova_example/supernova_example.py
+++ b/examples/supernova_example/supernova_example.py
@@ -13,8 +13,6 @@ import bilby
 
 # Set the duration and sampling frequency of the data segment that we're going
 # to inject the signal into
-import bilby.gw.detector
-
 duration = 3.
 sampling_frequency = 4096.
 
diff --git a/test/detector_test.py b/test/detector_test.py
index ab15548ea..abcf5a17a 100644
--- a/test/detector_test.py
+++ b/test/detector_test.py
@@ -13,10 +13,6 @@ from shutil import rmtree
 import logging
 import deepdish as dd
 
-import bilby.gw.detector
-import bilby.gw.detector
-import bilby.gw.detector
-
 
 class TestInterferometer(unittest.TestCase):
 
@@ -35,12 +31,12 @@ class TestInterferometer(unittest.TestCase):
         self.yarm_tilt = 0.
         # noinspection PyTypeChecker
         self.ifo = bilby.gw.detector.Interferometer(name=self.name, power_spectral_density=self.power_spectral_density,
-                                                                   minimum_frequency=self.minimum_frequency,
-                                                                   maximum_frequency=self.maximum_frequency, length=self.length,
-                                                                   latitude=self.latitude, longitude=self.longitude,
-                                                                   elevation=self.elevation,
-                                                                   xarm_azimuth=self.xarm_azimuth, yarm_azimuth=self.yarm_azimuth,
-                                                                   xarm_tilt=self.xarm_tilt, yarm_tilt=self.yarm_tilt)
+                                                    minimum_frequency=self.minimum_frequency,
+                                                    maximum_frequency=self.maximum_frequency, length=self.length,
+                                                    latitude=self.latitude, longitude=self.longitude,
+                                                    elevation=self.elevation,
+                                                    xarm_azimuth=self.xarm_azimuth, yarm_azimuth=self.yarm_azimuth,
+                                                    xarm_tilt=self.xarm_tilt, yarm_tilt=self.yarm_tilt)
         self.ifo.strain_data.set_from_frequency_domain_strain(
             np.linspace(0, 4096, 4097), sampling_frequency=4096, duration=2)
         self.outdir = 'outdir'
@@ -397,21 +393,21 @@ class TestInterferometerEquals(unittest.TestCase):
                                                                    duration=self.duration)
         self.strain = self.frequency_array
         self.ifo_1 = bilby.gw.detector.Interferometer(name=self.name,
-                                                                     power_spectral_density=self.power_spectral_density_1,
-                                                                     minimum_frequency=self.minimum_frequency,
-                                                                     maximum_frequency=self.maximum_frequency, length=self.length,
-                                                                     latitude=self.latitude, longitude=self.longitude,
-                                                                     elevation=self.elevation,
-                                                                     xarm_azimuth=self.xarm_azimuth, yarm_azimuth=self.yarm_azimuth,
-                                                                     xarm_tilt=self.xarm_tilt, yarm_tilt=self.yarm_tilt)
+                                                      power_spectral_density=self.power_spectral_density_1,
+                                                      minimum_frequency=self.minimum_frequency,
+                                                      maximum_frequency=self.maximum_frequency, length=self.length,
+                                                      latitude=self.latitude, longitude=self.longitude,
+                                                      elevation=self.elevation,
+                                                      xarm_azimuth=self.xarm_azimuth, yarm_azimuth=self.yarm_azimuth,
+                                                      xarm_tilt=self.xarm_tilt, yarm_tilt=self.yarm_tilt)
         self.ifo_2 = bilby.gw.detector.Interferometer(name=self.name,
-                                                                     power_spectral_density=self.power_spectral_density_2,
-                                                                     minimum_frequency=self.minimum_frequency,
-                                                                     maximum_frequency=self.maximum_frequency, length=self.length,
-                                                                     latitude=self.latitude, longitude=self.longitude,
-                                                                     elevation=self.elevation,
-                                                                     xarm_azimuth=self.xarm_azimuth, yarm_azimuth=self.yarm_azimuth,
-                                                                     xarm_tilt=self.xarm_tilt, yarm_tilt=self.yarm_tilt)
+                                                      power_spectral_density=self.power_spectral_density_2,
+                                                      minimum_frequency=self.minimum_frequency,
+                                                      maximum_frequency=self.maximum_frequency, length=self.length,
+                                                      latitude=self.latitude, longitude=self.longitude,
+                                                      elevation=self.elevation,
+                                                      xarm_azimuth=self.xarm_azimuth, yarm_azimuth=self.yarm_azimuth,
+                                                      xarm_tilt=self.xarm_tilt, yarm_tilt=self.yarm_tilt)
         self.ifo_1.set_strain_data_from_frequency_domain_strain(frequency_array=self.frequency_array,
                                                                 frequency_domain_strain=self.strain)
         self.ifo_2.set_strain_data_from_frequency_domain_strain(frequency_array=self.frequency_array,
@@ -682,11 +678,11 @@ class TestInterferometerStrainDataEquals(unittest.TestCase):
                                                                    duration=self.duration)
         self.strain = self.frequency_array
         self.ifosd_1 = bilby.gw.detector.InterferometerStrainData(minimum_frequency=self.minimum_frequency,
-                                                                              maximum_frequency=self.maximum_frequency,
-                                                                              roll_off=self.roll_off)
+                                                                  maximum_frequency=self.maximum_frequency,
+                                                                  roll_off=self.roll_off)
         self.ifosd_2 = bilby.gw.detector.InterferometerStrainData(minimum_frequency=self.minimum_frequency,
-                                                                              maximum_frequency=self.maximum_frequency,
-                                                                              roll_off=self.roll_off)
+                                                                  maximum_frequency=self.maximum_frequency,
+                                                                  roll_off=self.roll_off)
         self.ifosd_1.set_from_frequency_domain_strain(frequency_domain_strain=self.strain,
                                                       frequency_array=self.frequency_array)
         self.ifosd_2.set_from_frequency_domain_strain(frequency_domain_strain=self.strain,
@@ -789,21 +785,21 @@ class TestInterferometerList(unittest.TestCase):
         self.yarm_tilt2 = 0.
         # noinspection PyTypeChecker
         self.ifo1 = bilby.gw.detector.Interferometer(name=self.name1,
-                                                                    power_spectral_density=self.power_spectral_density1,
-                                                                    minimum_frequency=self.minimum_frequency1,
-                                                                    maximum_frequency=self.maximum_frequency1, length=self.length1,
-                                                                    latitude=self.latitude1, longitude=self.longitude1,
-                                                                    elevation=self.elevation1,
-                                                                    xarm_azimuth=self.xarm_azimuth1, yarm_azimuth=self.yarm_azimuth1,
-                                                                    xarm_tilt=self.xarm_tilt1, yarm_tilt=self.yarm_tilt1)
+                                                     power_spectral_density=self.power_spectral_density1,
+                                                     minimum_frequency=self.minimum_frequency1,
+                                                     maximum_frequency=self.maximum_frequency1, length=self.length1,
+                                                     latitude=self.latitude1, longitude=self.longitude1,
+                                                     elevation=self.elevation1,
+                                                     xarm_azimuth=self.xarm_azimuth1, yarm_azimuth=self.yarm_azimuth1,
+                                                     xarm_tilt=self.xarm_tilt1, yarm_tilt=self.yarm_tilt1)
         self.ifo2 = bilby.gw.detector.Interferometer(name=self.name2,
-                                                                    power_spectral_density=self.power_spectral_density2,
-                                                                    minimum_frequency=self.minimum_frequency2,
-                                                                    maximum_frequency=self.maximum_frequency2, length=self.length2,
-                                                                    latitude=self.latitude2, longitude=self.longitude2,
-                                                                    elevation=self.elevation2,
-                                                                    xarm_azimuth=self.xarm_azimuth2, yarm_azimuth=self.yarm_azimuth2,
-                                                                    xarm_tilt=self.xarm_tilt2, yarm_tilt=self.yarm_tilt2)
+                                                     power_spectral_density=self.power_spectral_density2,
+                                                     minimum_frequency=self.minimum_frequency2,
+                                                     maximum_frequency=self.maximum_frequency2, length=self.length2,
+                                                     latitude=self.latitude2, longitude=self.longitude2,
+                                                     elevation=self.elevation2,
+                                                     xarm_azimuth=self.xarm_azimuth2, yarm_azimuth=self.yarm_azimuth2,
+                                                     xarm_tilt=self.xarm_tilt2, yarm_tilt=self.yarm_tilt2)
         self.ifo1.strain_data.set_from_frequency_domain_strain(
             self.frequency_arrays, sampling_frequency=4096, duration=2)
         self.ifo2.strain_data.set_from_frequency_domain_strain(
@@ -866,13 +862,13 @@ class TestInterferometerList(unittest.TestCase):
     def test_init_inconsistent_duration(self):
         self.frequency_arrays = np.linspace(0, 2048, 2049)
         self.ifo2 = bilby.gw.detector.Interferometer(name=self.name2,
-                                                                    power_spectral_density=self.power_spectral_density2,
-                                                                    minimum_frequency=self.minimum_frequency2,
-                                                                    maximum_frequency=self.maximum_frequency2, length=self.length2,
-                                                                    latitude=self.latitude2, longitude=self.longitude2,
-                                                                    elevation=self.elevation2,
-                                                                    xarm_azimuth=self.xarm_azimuth2, yarm_azimuth=self.yarm_azimuth2,
-                                                                    xarm_tilt=self.xarm_tilt2, yarm_tilt=self.yarm_tilt2)
+                                                     power_spectral_density=self.power_spectral_density2,
+                                                     minimum_frequency=self.minimum_frequency2,
+                                                     maximum_frequency=self.maximum_frequency2, length=self.length2,
+                                                     latitude=self.latitude2, longitude=self.longitude2,
+                                                     elevation=self.elevation2,
+                                                     xarm_azimuth=self.xarm_azimuth2, yarm_azimuth=self.yarm_azimuth2,
+                                                     xarm_tilt=self.xarm_tilt2, yarm_tilt=self.yarm_tilt2)
         self.ifo2.strain_data.set_from_frequency_domain_strain(
             self.frequency_arrays, sampling_frequency=4096, duration=1)
         with self.assertRaises(ValueError):
@@ -881,13 +877,13 @@ class TestInterferometerList(unittest.TestCase):
     def test_init_inconsistent_sampling_frequency(self):
         self.frequency_arrays = np.linspace(0, 2048, 2049)
         self.ifo2 = bilby.gw.detector.Interferometer(name=self.name2,
-                                                                    power_spectral_density=self.power_spectral_density2,
-                                                                    minimum_frequency=self.minimum_frequency2,
-                                                                    maximum_frequency=self.maximum_frequency2, length=self.length2,
-                                                                    latitude=self.latitude2, longitude=self.longitude2,
-                                                                    elevation=self.elevation2,
-                                                                    xarm_azimuth=self.xarm_azimuth2, yarm_azimuth=self.yarm_azimuth2,
-                                                                    xarm_tilt=self.xarm_tilt2, yarm_tilt=self.yarm_tilt2)
+                                                     power_spectral_density=self.power_spectral_density2,
+                                                     minimum_frequency=self.minimum_frequency2,
+                                                     maximum_frequency=self.maximum_frequency2, length=self.length2,
+                                                     latitude=self.latitude2, longitude=self.longitude2,
+                                                     elevation=self.elevation2,
+                                                     xarm_azimuth=self.xarm_azimuth2, yarm_azimuth=self.yarm_azimuth2,
+                                                     xarm_tilt=self.xarm_tilt2, yarm_tilt=self.yarm_tilt2)
         self.ifo2.strain_data.set_from_frequency_domain_strain(
             self.frequency_arrays, sampling_frequency=2048, duration=2)
         with self.assertRaises(ValueError):
@@ -1200,8 +1196,8 @@ class TestPowerSpectralDensityWithFiles(unittest.TestCase):
             with mock.patch('bilby.gw.detector.InterferometerStrainData.create_power_spectral_density') as n:
                 n.return_value = expected_frequency_array, expected_psd_array
                 psd = bilby.gw.detector.PowerSpectralDensity.from_frame_file(frame_file=self.asd_file,
-                                                                                      psd_start_time=0,
-                                                                                      psd_duration=4)
+                                                                             psd_start_time=0,
+                                                                             psd_duration=4)
                 self.assertTrue(np.array_equal(expected_frequency_array, psd.frequency_array))
                 self.assertTrue(np.array_equal(expected_psd_array, psd.psd_array))
 
diff --git a/test/gw_likelihood_test.py b/test/gw_likelihood_test.py
index 4ac135bf0..a1584bdc7 100644
--- a/test/gw_likelihood_test.py
+++ b/test/gw_likelihood_test.py
@@ -3,8 +3,6 @@ import unittest
 import bilby
 import numpy as np
 
-import bilby.gw.detector
-
 
 class TestBasicGWTransient(unittest.TestCase):
 
@@ -144,7 +142,7 @@ class TestGWTransient(unittest.TestCase):
 
     def test_interferometers_setting_interferometer_list(self):
         ifos = bilby.gw.detector.InterferometerList([bilby.gw.detector.get_empty_interferometer(name=name)
-                                                              for name in ['H1', 'L1']])
+                                                     for name in ['H1', 'L1']])
         self.likelihood.interferometers = ifos
         self.assertListEqual(bilby.gw.detector.InterferometerList(ifos), self.likelihood.interferometers)
         self.assertTrue(type(self.likelihood.interferometers) == bilby.gw.detector.InterferometerList)
diff --git a/test/make_standard_data.py b/test/make_standard_data.py
index 9624a170b..458ce69b4 100644
--- a/test/make_standard_data.py
+++ b/test/make_standard_data.py
@@ -5,7 +5,6 @@ import os
 import numpy as np
 
 import bilby
-import bilby.gw.detector
 from bilby.gw.waveform_generator import WaveformGenerator
 
 np.random.seed(10)
-- 
GitLab