Skip to content

Conversation

@matteobachetti
Copy link
Member

Resolve #744

Would something like this work for us? After all, I think it might make sense to have empty light curves, exactly like it makes sense, sometimes, to have empty event lists.

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #745 (5f7f551) into main (38ca23b) will decrease coverage by 7.42%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #745      +/-   ##
==========================================
- Coverage   97.13%   89.72%   -7.42%     
==========================================
  Files          42       42              
  Lines        7919     7929      +10     
==========================================
- Hits         7692     7114     -578     
- Misses        227      815     +588     
Files Changed Coverage Δ
stingray/lightcurve.py 96.38% <100.00%> (-1.48%) ⬇️

... and 14 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@matteobachetti matteobachetti force-pushed the allow_empty_lightcurves branch 2 times, most recently from 7a84c8e to 3577e72 Compare August 18, 2023 08:39
Copy link
Member

@dhuppenkothen dhuppenkothen left a comment

Choose a reason for hiding this comment

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

This seems fine to me in principle, but should be reflected in the documentation/tutorial for Lightcurve before merging.


if time.size <= 1:
raise StingrayError("A single or no data points can not create " "a lightcurve!")
raise StingrayError("time and counts array are not of the same length!")
Copy link
Member

Choose a reason for hiding this comment

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

I think this might need an additional message for the failure mode where the user puts in a time array but not a counts array. I could imagine this happening if someone thinks they can generate a light curve from time-tagged arrivals by invoking Lightcurve(time=toas) rather than using the Lightcurve.make_lightcurve() class method. I would extend the error message here to include that for constructing a Lightcurve() object, but time and counts are required, and that for generating a Light curve from TOAs, use the class method

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I changed a little bit the machinery, so that the existing error on the invalid counts array is more informative, and also includes the case where counts is None.

@matteobachetti
Copy link
Member Author

Docs: StingraySoftware/notebooks#67

@matteobachetti matteobachetti force-pushed the allow_empty_lightcurves branch from 6469225 to 9b55bc3 Compare August 21, 2023 08:36
@matteobachetti matteobachetti force-pushed the allow_empty_lightcurves branch from 9b55bc3 to f81e0d0 Compare August 21, 2023 08:57
Copy link
Member

@dhuppenkothen dhuppenkothen left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@matteobachetti matteobachetti added this pull request to the merge queue Aug 24, 2023
Merged via the queue into main with commit 5bdef91 Aug 24, 2023
@matteobachetti matteobachetti deleted the allow_empty_lightcurves branch August 24, 2023 09:10
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.

Keeping single-time bin lightcurves in split_by_gti

3 participants