Skip to content

Commit

Permalink
Dont import cosmology as standard when using pycbc.conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Aug 9, 2024
1 parent 8512940 commit 81b1615
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pycbc/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
import copy
import numpy
import logging
import sys

import lal

from pycbc.detector import Detector
import pycbc.cosmology
from pycbc import neutron_stars as ns

from .coordinates import (
Expand Down Expand Up @@ -441,6 +441,8 @@ def lambda_from_mass_tov_file(mass, tov_file, distance=0.):
interpolating from the mass-Lambda data for a particular EOS read in from
an ASCII file.
"""
if not 'pycbc.cosmology' in sys.modules.keys()
import pycbc.cosmology
data = numpy.loadtxt(tov_file)
mass_from_file = data[:, 0]
lambda_from_file = data[:, 1]
Expand Down

0 comments on commit 81b1615

Please sign in to comment.