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

Use .ecsv extension in dump instrument to enable Table.read. #1722

Merged
merged 2 commits into from
Feb 1, 2022

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented May 18, 2021

When using .ecsv, astropy table automatically chooses the ascii.ecsv format, also when reading.

By using .ecsv.txt we prevent simply usung Table.read(path)

@kosack
Copy link
Contributor

kosack commented May 18, 2021

The reason for adding .txt was just so that when clicking the file in Linux/macOS/Windows, a text editor or viewer is able to open it (rather than nothing, since ecsv is not a well known format is not registered by default). It also makes QuickLook (in macOS) or Sushi (gnome linux) work, so you can preview the file in a file manager.

But yes, it is nice if astropy can detect it. It's too bad it does that by extension, not magic number or header

@maxnoe
Copy link
Member Author

maxnoe commented May 18, 2021

MMh, on my system that's not an issue with the ecsv extension:

❯ file MonteCarloArray.optics.ecsv
MonteCarloArray.optics.ecsv: ASCII text

And xdg-open MonteCarloArray.optics.ecsv opens the file in my default text editor.

@codecov
Copy link

codecov bot commented May 18, 2021

Codecov Report

Merging #1722 (7a22201) into master (996c048) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1722   +/-   ##
=======================================
  Coverage   91.82%   91.82%           
=======================================
  Files         190      190           
  Lines       15255    15255           
=======================================
  Hits        14008    14008           
  Misses       1247     1247           
Impacted Files Coverage Δ
ctapipe/tools/dump_instrument.py 87.95% <100.00%> (ø)
ctapipe/tools/tests/test_tools.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 996c048...7a22201. Read the comment docs.

@kosack
Copy link
Contributor

kosack commented May 19, 2021

Yeah, seems to work now, so I'm ok with the change.

kosack
kosack previously approved these changes May 19, 2021
@kosack kosack merged commit 7e95515 into master Feb 1, 2022
@kosack kosack deleted the fix_ecsv_ext branch February 1, 2022 10:24
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.

3 participants