Skip to content

Make sure GTAnalysis can be initialized with a config file pathlib.Path object#659

Open
HealthyPear wants to merge 1 commit intofermiPy:masterfrom
HealthyPear:patch-1
Open

Make sure GTAnalysis can be initialized with a config file pathlib.Path object#659
HealthyPear wants to merge 1 commit intofermiPy:masterfrom
HealthyPear:patch-1

Conversation

@HealthyPear
Copy link

Fixes #654

@ndilalla ndilalla self-requested a review February 19, 2026 18:38
validate = kwargs.pop('validate', True)
self._loglevel = kwargs.pop('loglevel', logging.INFO)

config = str(Path(config).resolve())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HealthyPear for implementing this fix! Since config can also be a dictionary, the test test_gtanalysis.py::test_gtanalysis_lightcurve is now failing. I would change this line to apply only for Path objects, replacing it with:

        if isinstance(config, Path):
            config = str(config.resolve())

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

Successfully merging this pull request may close these issues.

fermipy should accept pathlib.Path objects

2 participants

Comments