code-lab-org / tatc

Tradespace Analysis Toolkit for Constellations (version 3) Library
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

Coverage analysis fails with improper intervals #35

Closed ptgrogan closed 9 months ago

ptgrogan commented 1 year ago

Some coverage analysis function calls are occasionally failing with a Pandas error message that the "left side of interval must be <= right side". The messages can be traced to analysis/coverage.py function _get_visible_interval_series specifically for case where there is a rise event with no matching set event (i.e., last observation period ongoing at end of analysis period).

Code inspection does not reveal a condition whereby the last rise time could exceed the end of analysis period (except possible for possibly very unlucky numerical rounding between Python, Pandas, and Skyfield datetime encodings). The error messages are cleared when an interactive kernel is reset, suggesting that the problem may be some issue with memory management, especially for parallel execution.

The proximate issue could be addressed with defensive coding to ensure the left interval is always <= the right interval.

ptgrogan commented 9 months ago

This issue has been isolated to differences between datetime representations in Skyfield and Pandas that manifest under edge conditions.