Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions frb/dm/igm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from astropy import units
from astropy.table import Table
from astropy.utils import isiterable
from astropy import constants

from frb.halos import hmf as frb_hmf
Expand Down Expand Up @@ -483,7 +482,7 @@ def z_to_array(z):

"""
# float or ndarray?
if not isiterable(z):
if not np.iterable(z):
z = np.array([z])
flg_z = 0
else:
Expand Down
6 changes: 5 additions & 1 deletion frb/frb.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,11 @@ def by_name(cls, frb_name, **kwargs):
Returns:

"""
json_file = importlib_resources.files('frb.data')/ f'FRBs/{frb_name}.json'
# searches for defined input directory. Otherwise uses default
if "ZDM_PATH_FRBDIR" in os.environ:
json_file = os.environ["ZDM_PATH_FRBDIR"]+f"/{frb_name}.json"
else:
json_file = importlib_resources.files('frb.data')/ f'FRBs/{frb_name}.json'
slf = cls.from_json(str(json_file), **kwargs)
return slf

Expand Down
Loading