juxt

2019-11-06T15:00:48.015300Z

What are the semantics of tick intervals? Are they closed-closed , closed-open or something else in regards to the beginning and end instants?

(tick/relation
  (tick/new-interval #inst “2000” #inst “2010”)
  (tick/new-interval #inst “2010” #inst “2020”))
;; => :meets
Indicates that they are disjoint (closed-open or open-closed), but
(tick.core/coincident?
  (tick/new-interval #inst “2000” #inst “2010”)
  #inst “2000”))
;; => true
(tick.core/coincident?
  (tick/new-interval #inst “2000” #inst “2010”)
  #inst “2010”))
;; => true
Indicates that both the beginning and end instants are considered to belong to an interval.

2019-11-06T19:06:09.017600Z

@andreas179 I could be wrong but I believe the concept of the interval alegbra (which the relation function uses) has no concept of closed/open, just of its 13 relations (https://en.wikipedia.org/wiki/Allen%27s_interval_algebra). I believe this allows you to decide whether your intervals will be open on either end in your code (it could depend on context)

2019-11-06T19:08:46.019400Z

It's possible all of the tick code might not be consistent with this. I believe the preferred entry point for tick is tick.alpha.api and generally for working with intervals i think you'll mostly want to work with the stuff in tick.interval that is exposed there

2019-11-06T19:11:47.022400Z

I do see now that this kind of breaks down when you're comparing a point to an event, as you are in your example

2019-11-06T19:22:28.032800Z

Allright, it’s mostly the functions that tick provides in its interval ns that i’m interested about :) disjoint may be a more appropriate example, whether two intervals are considered disjoint or not? What I’m ultimately trying to accomplish is to merge an interval on top of a collection of other intervals, and I was looking to see whether tick provides some suitable fns or not. There seems to be some interesting ones in the interval namespace, and whether intervals are treated as closed-closed or closed-open etc. (I believe) impacts the expected behaviour of the functions. I’m not entirely sure my thought are up to standards on this matter, so maybe this can serve as a hint that a note on the semantics would be great for documentation purposes, and possibly a check that the interval fns are consistent in this regard :) Many thanks for the work on the library, though!

2019-11-06T19:25:12.033100Z

I didn't make the library, just a fan 🙂

2019-11-06T19:25:40.033800Z

It was useful to me to look at the tick.interval namespace a bunch when working with intervals

2019-11-06T19:28:22.034600Z

for instance you can see here https://github.com/juxt/tick/blob/master/src/tick/interval.cljc#L272 the relations satisfy disjoint

2019-11-06T19:29:20.035700Z

Also if you haven't seen it yet, I've used this little javascript demo of the relations a lot: https://juxt.pro/tick/docs/index.html#_comparison_4

2019-11-06T19:30:17.038Z

thinking about it more, i think you're right that the tick intervals would be open at both ends when you put it into that context, but I believe you can get more leverage out of using the algebra terms instead in a lot of situations

2019-11-06T19:45:44.040700Z

Ye, looking at the src is a requirement when working with this, since the docs are a bit sparse on much of the fns. Just knowing the intended semantics would not only make it possible to verify that the behaviour is the intended, but also help with the initial on boarding. Anyhow, I guess I will make things work :)