`lalinference_nest2pos` cannot combine samples from HDF5 files produced using different LALSuite hashes
The lalinference_nes2pos
script can combine nested samples from multiple HDF5 files. When it is reading in HDF5 files the read_nested_from_hdf5()
function includes a check that the top level current_level = '/lalinference'
metadata between each file matches. This includes the 'version'
key, which contains a list of LALSuite components and their related git hashes. If you have two, or more nested sample files that were created using different versions this will raise an error and you won't be able to merge them. While this check is good in that it enforces consistency, it's currently a pain for me as I've run loads of jobs where there have been minor changes to unrelated code between some of the nested sampling runs for a particular analysis. And now, I can't combine them. I could just do a local hack for myself, but rather than enforcing the strict requirement that versions are the same could there be a new command line argument that allows you to not have this strict enforcement?
E.g., a command lines argument called --non-strict-versions
that defaults to False
, and then changing read_nested_from_hdf5()
to have
def read_nested_from_hdf5(nested_path_list, strict_versions=True):
...
def update_metadata(level, attrs, collision='raise'):
...
if collision == 'raise':
if attrs[key]!=metadata[level][key]:
if not strict_versions and key == 'version':
continue
else:
raise ValueError(
'Metadata mismtach on level %r for key %r:\n\t%r != %r'
% (level, key, attrs[key], metadata[level][key]))
@john-veitch - if you think this is a reasonable request I can make a MR?