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

Add fits option to meta.to_dict, silences warnings #1433

Merged
merged 4 commits into from
Oct 2, 2020

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented Sep 29, 2020

Before the log was full of warnings related to implicitly relying on conversion of too long header keywords using HIERARCH. This adds an fits option to the to_dict method to explicitly add HIERARCH to silence these warnings.

This did not remove all warnings however, since:

  /home/maxnoe/Uni/CTA/ctapipe/ctapipe/io/tests/test_metadata.py:32: DeprecationWarning: Passing unrecoginized arguments to super(Process).__init__(_type='Simulation', _id=423442).
  object.__init__() takes exactly one argument (the instance to initialize)
  This is deprecated in traitlets 4.2.This error will be raised in a future release of traitlets.
    process=meta.Process(_type="Simulation", subtype="Prod3b", _id=423442,),

ctapipe/io/tests/test_metadata.py::test_construct_and_write_metadata
  /home/maxnoe/.local/anaconda/envs/cta-dev/lib/python3.7/site-packages/astropy/io/fits/convenience.py:589: AstropyUserWarning: Attribute `HIERARCH CTA PRODUCT CREATION TIME` of type <class 'astropy.time.core.Time'> cannot be added to FITS Header - skipping
    f"added to FITS Header - skipping", AstropyUserWarning)

ctapipe/io/tests/test_metadata.py::test_construct_and_write_metadata
  /home/maxnoe/.local/anaconda/envs/cta-dev/lib/python3.7/site-packages/astropy/io/fits/convenience.py:589: AstropyUserWarning: Attribute `HIERARCH CTA ACTIVITY START TIME` of type <class 'astropy.time.core.Time'> cannot be added to FITS Header - skipping
    f"added to FITS Header - skipping", AstropyUserWarning)

These warnings were probably lost in the large amounts of HIERARCH related warnings

@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #1433 into master will increase coverage by 0.10%.
The diff coverage is 93.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1433      +/-   ##
==========================================
+ Coverage   90.91%   91.01%   +0.10%     
==========================================
  Files         184      184              
  Lines       12677    12957     +280     
==========================================
+ Hits        11525    11793     +268     
- Misses       1152     1164      +12     
Impacted Files Coverage Δ
ctapipe/image/extractor.py 86.16% <0.00%> (-0.45%) ⬇️
ctapipe/image/tests/test_reducer.py 100.00% <ø> (ø)
ctapipe/tools/bokeh/file_viewer.py 75.63% <50.00%> (ø)
ctapipe/tools/display_integrator.py 96.40% <50.00%> (-0.03%) ⬇️
ctapipe/io/eventseeker.py 75.00% <85.71%> (-6.82%) ⬇️
ctapipe/instrument/subarray.py 94.50% <87.27%> (-3.14%) ⬇️
ctapipe/tools/tests/test_tools.py 97.46% <87.87%> (-2.54%) ⬇️
ctapipe/calib/camera/calibrator.py 100.00% <100.00%> (ø)
ctapipe/containers.py 100.00% <100.00%> (ø)
ctapipe/core/component.py 96.72% <100.00%> (+0.23%) ⬆️
... and 28 more

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 060a2f0...6630f43. Read the comment docs.

@maxnoe
Copy link
Member Author

maxnoe commented Sep 29, 2020

With this, we are down to a manageble amount of warnings in the tests so it should be easy to spot new ones.

@maxnoe maxnoe added this to the v0.9.1 milestone Oct 2, 2020
@maxnoe maxnoe merged commit e660c90 into master Oct 2, 2020
@maxnoe maxnoe deleted the silence_fits_warnings branch October 2, 2020 16:12
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.

None yet

3 participants