Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremykubica committed Oct 3, 2024
1 parent 4f95826 commit ba774d6
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/resspect/build_plasticc_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# limitations under the License.

import numpy as np
import os
import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
Expand Down
5 changes: 2 additions & 3 deletions src/resspect/cosmo_metric_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import astropy as ap
import numpy as np
import pandas as pd

from astropy.cosmology import Planck15, Flatw0waCDM
from astropy.cosmology import w0waCDM
from astropy import constants as const


__all__ = ['assign_cosmo', 'fish_deriv_m', 'fisher_results',
'column_deriv_m', 'update_matrix', 'find_most_useful',
'compare_two_fishers']


def assign_cosmo(cosmo, model=[70, 0.3, 0.7, -0.9, 0.0]):
"""Define a new cosmology model.
Expand Down
1 change: 0 additions & 1 deletion src/resspect/exposure_time_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
__all__ = ['ExpTimeCalc']

import numpy as np
import sys, getopt
from scipy.interpolate import interp1d

class ExpTimeCalc(object):
Expand Down
1 change: 0 additions & 1 deletion src/resspect/fit_lightcurves.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from copy import copy
from itertools import repeat
from typing import IO
from typing import Union

import numpy as np
import pandas as pd
Expand Down
2 changes: 0 additions & 2 deletions src/resspect/read_dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import csv

__all__ = ["get_id_type"]

def get_id_type(file: str):
Expand Down
1 change: 0 additions & 1 deletion src/resspect/snana_fits_to_pd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import numpy as np
import pandas as pd
from pathlib import Path
from astropy.table import Table

__all__ = ['read_fits']
Expand Down
14 changes: 2 additions & 12 deletions tests/resspect/test_cosmo_metric_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,30 @@
PyTest for cosmo_metric_utils.
"""
import pytest

## TBD: simulate data to use to test the metric.

from resspect import cosmo_metric_utils
from resspect import cosmo_metric_utils as cmu

import astropy as ap
import numpy as np
import pandas as pd

from astropy.cosmology import w0waCDM
from astropy import constants as const

def make_fake_data():
return


# multiple unit tests?
def test_assign_cosmo():
"""
Test to make sure it reassigns the cosmology
"""
from resspect import cosmo_metric_utils as cmu

cosmo = w0waCDM(70, 0.3, 0.7, -0.9, 0.0, name='w0waCDM')
updated_cosmo = cmu.assign_cosmo(cosmo, model=[72, 0.29, 0.71, -1, 0.0])

assert int(updated_cosmo.H0.value) == int(72)
assert hasattr(updated_cosmo, 'distmod')
assert isinstance(updated_cosmo, w0waCDM)

def test_fish_deriv_m():
from resspect import cosmo_metric_utils as cmu

def test_fish_deriv_m():
redshift = np.arange(0.2, 1.5, 0.1)
step = np.array([0, 0.001, 0.00, 0.1, 0., 0.0, 0.0, 0.0])
m, m_deriv = cmu.fish_deriv_m(redshift, [72, 0.29, 0.71, -1, 0.0], step)
Expand Down

0 comments on commit ba774d6

Please sign in to comment.