Skip to content

ROOT file interface #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
henrikef opened this issue Dec 17, 2020 · 1 comment
Closed

ROOT file interface #45

henrikef opened this issue Dec 17, 2020 · 1 comment

Comments

@henrikef
Copy link
Contributor

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
@henrikef
Copy link
Contributor Author

Fixed in #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant