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

monotonically increasing check should be ">=" #266

Open
greglucas opened this issue Jun 7, 2024 · 3 comments
Open

monotonically increasing check should be ">=" #266

greglucas opened this issue Jun 7, 2024 · 3 comments

Comments

@greglucas
Copy link

A monotonic function can have values that are equal to each other
https://en.wikipedia.org/wiki/Monotonic_function

so I believe this should be >=

return np.all(epoch_data[1:] > epoch_data[:-1])

It does seem like there is some ambiguity about whether monotonically increasing includes the equal sign or not. I couldn't figure out which definition ISTP compliance would want. "strictly increasing" would be how I would interpret the code currently.

@ericthewizard
Copy link
Contributor

A time series should be increasing in time (with no duplicate times); "strictly increasing" is probably better wording.

There's definitely some code out there (e.g., in IDL SPEDAS) that uses this assumption for performance reasons (I vaguely remember coming across it in the past).

@bryan-harter
Copy link
Member

So if we are being fully ISTP compliant, we want to keep the check as ">" rather than ">="?

@bryan-harter bryan-harter moved this from To triage to Backlog in cdflib development Dec 23, 2024
@ericthewizard
Copy link
Contributor

ericthewizard commented Dec 23, 2024

So if we are being fully ISTP compliant, we want to keep the check as ">" rather than ">="?

I don't know if it's an ISTP thing (ISTP compliance is mostly for the metadata, rather than the data/time values themselves), but I know a lot of systems will break if there are duplicate timestamps. Even if a system is built to support duplicate timestamps, it brings up the questions: which data value is correct for the timestamp? and if they're the same, why include the duplicates?

No idea if the SPDF metadata editor checks this at all when running an ISTP compliance check, but I think it's a good thing to check somewhere (though places where this shows up tends to be at file boundaries, so compliance checks would miss it without checking multiple files at once).

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

No branches or pull requests

3 participants