Skip to content

Commit

Permalink
Pep8 changes to model_defaults.py module
Browse files Browse the repository at this point in the history
  • Loading branch information
aphearin committed Feb 19, 2021
1 parent e07cd01 commit f60a8aa
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions halotools/empirical_models/model_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import numpy as np

__all__ = ['get_halo_boundary_key', 'get_halo_mass_key']
__all__ = ["get_halo_boundary_key", "get_halo_mass_key"]


# Default thresholds for mocks
Expand All @@ -15,30 +15,38 @@
# Used when executing a Monte Carlo realization of a Poission distribution
# whose mean is formally zero, which causes the built-in
# scipy method to raise an exception.
default_tiny_poisson_fluctuation = 1.e-20
default_tiny_poisson_fluctuation = 1.0e-20

default_smhm_scatter = 0.2
default_smhm_haloprop = 'halo_mpeak'
default_smhm_haloprop = "halo_mpeak"
default_binary_galprop_haloprop = default_smhm_haloprop

# At minimum, the following halo and galaxy properties
# will be bound to each mock galaxy
host_haloprop_prefix = 'halo_'
host_haloprop_prefix = "halo_"

default_haloprop_list_inherited_by_mock = (
['halo_id', 'halo_hostid', 'halo_x', 'halo_y', 'halo_z',
'halo_vx', 'halo_vy', 'halo_vz',
'halo_mvir', 'halo_rvir', 'halo_upid']
)
default_haloprop_list_inherited_by_mock = [
"halo_id",
"halo_hostid",
"halo_x",
"halo_y",
"halo_z",
"halo_vx",
"halo_vy",
"halo_vz",
"halo_mvir",
"halo_rvir",
"halo_upid",
]

prim_haloprop_key = 'halo_mvir'
sec_haloprop_key = 'halo_nfw_conc'
prim_haloprop_key = "halo_mvir"
sec_haloprop_key = "halo_nfw_conc"

halo_mass_definition = 'vir'
halo_mass_definition = "vir"


def get_halo_boundary_key(mdef):
""" For the input mass definition,
"""For the input mass definition,
return the string used to access halo table column
storing the halo radius.
Expand All @@ -56,11 +64,11 @@ def get_halo_boundary_key(mdef):
--------
radius_key : str
"""
return 'halo_r'+mdef
return "halo_r" + mdef


def get_halo_mass_key(mdef):
""" For the input mass definition,
"""For the input mass definition,
return the string used to access halo table column
storing the halo mass.
Expand All @@ -78,7 +86,7 @@ def get_halo_mass_key(mdef):
--------
mass_key : str
"""
return 'halo_m'+mdef
return "halo_m" + mdef


# Number of bins to use in the lookup table attached to the NFWProfile.
Expand All @@ -88,14 +96,15 @@ def get_halo_mass_key(mdef):
max_permitted_conc = 20.0

default_conc_gal_bias_bins = np.linspace(0.1, 10, 10)
default_conc_gal_bias_bins = np.insert(default_conc_gal_bias_bins,
np.searchsorted(default_conc_gal_bias_bins, 1), 1)
default_conc_gal_bias_bins = np.insert(
default_conc_gal_bias_bins, np.searchsorted(default_conc_gal_bias_bins, 1), 1
)

Npts_radius_table = 101
default_lograd_min = -3
default_lograd_max = 0
conc_mass_model = 'direct_from_halo_catalog'
concentration_key = 'halo_nfw_conc'
conc_mass_model = "direct_from_halo_catalog"
concentration_key = "halo_nfw_conc"


default_rbins = np.logspace(-1, 1.25, 15)
Expand Down

0 comments on commit f60a8aa

Please sign in to comment.