Commit 01fce5db authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Merge branch 'add-noconversion' into 'master'

Add option to use noconversion

See merge request lscsoft/bilby_pipe!420
parents a8c56aa3 9f51c215
......@@ -1157,11 +1157,16 @@ class Input(object):
@property
def parameter_conversion(self):
if self.conversion_function is not None:
logger.info(
f"Using user-specified conversion_function {self.conversion_function}"
)
return get_function_from_string_path(self.conversion_function)
cf = self.conversion_function
_lookups = dict(noconvert=None)
if isinstance(cf, str) and cf.lower() in _lookups:
logger.info(f"Using conversion function {cf} from lookups")
return _lookups[cf.lower()]
elif cf is not None:
logger.info(f"Using user-specified conversion_function {cf}")
return get_function_from_string_path(cf)
elif "binary_neutron_star" in self._frequency_domain_source_model:
logger.info(
"Using conversion_function convert_to_lal_binary_neutron_star_parameters"
......@@ -1236,8 +1241,16 @@ class Input(object):
@property
def parameter_generation(self):
if self.generation_function is not None:
logger.info(f"Using user-specified generation {self.generation_function}")
gf = self.generation_function
_lookups = dict(noconvert=None)
if isinstance(gf, str) and gf.lower() in _lookups:
logger.info(f"Using generation function {gf} from lookups")
return _lookups[gf.lower()]
elif gf is not None:
logger.info(f"Using user-specified generation {gf}")
return get_function_from_string_path(self.generation_function)
elif "binary_neutron_star" in self._frequency_domain_source_model:
logger.info("Using generation_function generate_all_bns_parameters")
......
......@@ -975,7 +975,8 @@ def create_parser(top_level=True):
"the conversion function is bilby.gw.conversion.convert_to_lal_binary_black_hole_parameters. "
"If the source-model contains binary_neutron_star, "
"the generation function is bilby.gw.conversion.convert_to_lal_binary_black_hole_parameters. "
"If you specify your own function, you may wish to use the I/O of those functions as templates"
"If you specify your own function, you may wish to use the I/O of those functions as templates."
"If given as 'noconvert' (case insensitive), no conversion is used'"
),
)
waveform_parser.add(
......@@ -990,6 +991,7 @@ def create_parser(top_level=True):
"If the source-model contains binary_neutron_star, "
"the generation function is bilby.gw.conversion.generate_all_bns_parameters. "
"If you specify your own function, you may wish to use the I/O of those functions as templates"
"If given as 'noconvert' (case insensitive), no generation is used'"
),
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment