Skip to content
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

fermitools don't seem to support pathlib.Path objects #147

Open
physicsranger opened this issue Jun 22, 2023 · 0 comments
Open

fermitools don't seem to support pathlib.Path objects #147

physicsranger opened this issue Jun 22, 2023 · 0 comments

Comments

@physicsranger
Copy link

When attempting to use a pathlib.Path object in python, via a GtApp call or something like creating a BinnedObs object, the fermitools throw an error (see below). This isn't a major issue as converting the Path objects to strings still works.

Simple example reproducing the error:

In [1]: from BinnedAnalysis import *

In [2]: from pathlib import Path

In [3]: sm=Path('sm_TCrB.fits')

In [4]: ltc=Path('ltc_TCrB.fits')

In [5]: bdem=Path('bdem_TCrB.fits')

In [6]: obs=BinnedObs(sm,ltc,bdem)

TypeError Traceback (most recent call last)
Cell In[6], line 1
----> 1 obs=BinnedObs(sm,ltc,bdem)

File /Software/miniconda3/envs/fermi/lib/python3.9/site-packages/fermitools/BinnedAnalysis.py:63, in BinnedObs.init(self, srcMaps, expCube, binnedExpMap, irfs, phased_expmap)
61 self.phased_expmap = phased_expmap
62 if irfs is None or irfs == 'CALDB':
---> 63 my_cuts = pyLike.Cuts(srcMaps, "", False, True, True)
64 self.irfs = my_cuts.CALDB_implied_irfs()
65 else:

File /Software/miniconda3/envs/fermi/lib/python3.9/site-packages/fermitools/pyLikelihood.py:1950, in Cuts.init(self, *args)
1943 def init(self, *args):
1944 r"""
1945 init(Cuts self) -> Cuts
1946 init(Cuts self, std::string const & eventFile, std::string const & extension, bool check_columns=True, bool skipTimeRangeCuts=False, bool skipEventClassCuts=False) -> Cuts
1947 init(Cuts self, StringVector eventFiles, std::string const & extension, bool check_columns=True, bool skipTimeRangeCuts=False, bool skipEventClassCuts=False) -> Cuts
1948 init(Cuts self, Cuts rhs) -> Cuts
1949 """
-> 1950 _pyLikelihood.Cuts_swiginit(self, _pyLikelihood.new_Cuts(*args))

TypeError: Wrong number or type of arguments for overloaded function 'new_Cuts'.
Possible C/C++ prototypes are:
dataSubselector::Cuts::Cuts()
dataSubselector::Cuts::Cuts(std::string const &,std::string const &,bool,bool,bool)
dataSubselector::Cuts::Cuts(std::string const &,std::string const &,bool,bool)
dataSubselector::Cuts::Cuts(std::string const &,std::string const &,bool)
dataSubselector::Cuts::Cuts(std::string const &,std::string const &)
dataSubselector::Cuts::Cuts(std::vector< std::string,std::allocator< std::string > > const &,std::string const &,bool,bool,bool)
dataSubselector::Cuts::Cuts(std::vector< std::string,std::allocator< std::string > > const &,std::string const &,bool,bool)
dataSubselector::Cuts::Cuts(std::vector< std::string,std::allocator< std::string > > const &,std::string const &,bool)
dataSubselector::Cuts::Cuts(std::vector< std::string,std::allocator< std::string > > const &,std::string const &)
dataSubselector::Cuts::Cuts(dataSubselector::Cuts const &)

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