Skip to content

ROOT file interface #45

@henrikef

Description

@henrikef

See #43 and #44 : Lots of errors like

tests/test_root_to_hdf.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_root_to_hdf.py:50: in do_one_test_maptree
    m = map_tree_factory(geminga_maptree, roi_)
hawc_hal/maptree/map_tree.py:27: in map_tree_factory
    return MapTree.from_root_file(map_tree_file, roi, n_transits)
hawc_hal/maptree/map_tree.py:58: in from_root_file
    data_analysis_bins = from_root_file(map_tree_file, roi, n_transits)
hawc_hal/maptree/from_root_file.py:73: in from_root_file
    with open_ROOT_file(map_tree_file) as f:
../../../miniconda/envs/test-environment/lib/python3.7/contextlib.py:112: in __enter__
    return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
filename = PosixPath('/home/travis/build/threeML/hawc_hal/tests/data/geminga_maptree.root')
    @contextlib.contextmanager
    def open_ROOT_file(filename):
        """
        Open a ROOT file in a context. Will close it no matter what, even if there are exceptions
    
        :param filename:
        :return:
        """
    
>       f = ROOT.TFile(filename)
E       TypeError: none of the 2 overloaded methods succeeded. Full details:
E         TFile::TFile() =>
E           TypeError: takes at most 0 arguments (1 given)
E         TFile::TFile(const char* fname, const char* option = "", const char* ftitle = "", int compress = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault) =>
E           TypeError: could not convert argument 1 (bad argument type for built-in operation)

../../../miniconda/envs/test-environment/lib/python3.7/site-packages/threeML/io/cern_root_utils/io_utils.py:28: TypeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions