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

FluxPoints.write() is ignoring overwrite when file extension is not FITS #5253

Closed
HealthyPear opened this issue May 7, 2024 · 0 comments · Fixed by #5254
Closed

FluxPoints.write() is ignoring overwrite when file extension is not FITS #5253

HealthyPear opened this issue May 7, 2024 · 0 comments · Fixed by #5254
Labels
Milestone

Comments

@HealthyPear
Copy link
Contributor

Gammapy version

1.2

Bug description

When writing a FluxPoints table (.ecsv) to file it is not possible to overwrite it.

Expected behavior

The overwrite argument should be taken into account.

To Reproduce

From any analysis get a FluxPoints instance (in my case it was from obtained from LightCurveEstimator.run())
and call the write() method with overwrite=True.

You will get the following error,

OSError: File xxxxxx.ecsv already exists. If you mean to replace it then use the argument "overwrite=True".

Other information

The bug is here:

table.write(filename)

It should be sufficient to pass the overwrite argument to table.write(), because the default (inherited from astropy.table.Table.write()) is False.

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

Successfully merging a pull request may close this issue.

2 participants