Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106449

Re: ANN: intervalset Was: Set type for datetime intervals

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Random832 <random832@fastmail.com>
Newsgroups comp.lang.python
Subject Re: ANN: intervalset Was: Set type for datetime intervals
Date Mon, 04 Apr 2016 11:44:23 -0400
Lines 28
Message-ID <mailman.24.1459784665.32530.python-list@python.org> (permalink)
References <56FE0625.5030901@shopzeus.com> <1459523394.2611014.565840994.593DD99A@webmail.messagingengine.com> <570213CB.8040101@shopzeus.com> <1459782597.3444051.568344234.048046C6@webmail.messagingengine.com> <CAHVvXxRRmJKHq-H8xotY9yF+pzG+7NOSMhOwTbL4qF-N4XjTfQ@mail.gmail.com> <1459784663.3451967.568464658.50905009@webmail.messagingengine.com>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de bQh8yDE4/jDkF9J4p69xlQVvZ2vQRSKyB9cNcKwVzlcw==
Return-Path <random832@fastmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'that?': 0.05; 'subject:ANN': 0.07; 'type,': 0.07; 'cc:addr:python-list': 0.09; '[1,': 0.09; 'benjamin': 0.09; 'iterate': 0.09; 'received:internal': 0.09; '2016': 0.16; 'cc:name:python list': 0.16; 'distinct': 0.16; 'eliminating': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'set,': 0.16; 'set-like': 0.16; 'subject:Was': 0.16; 'subject:type': 0.16; "sympy's": 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'purposes': 0.20; 'do.': 0.22; '(by': 0.22; 'seems': 0.23; 'sets': 0.23; 'header:In-Reply-To:1': 0.24; 'discussion': 0.24; 'mon,': 0.24; "doesn't": 0.26; 'appear': 0.26; 'separate': 0.27; 'question': 0.27; '(such': 0.27; 'consisting': 0.29; 'guess': 0.31; 'operations': 0.31; 'useful': 0.33; '(for': 0.34; 'supports': 0.35; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'depends': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'two': 0.37; 'doing': 0.38; 'received:66': 0.38; 'stuff': 0.38; 'represent': 0.38; 'why': 0.39; 'application': 0.39; 'rather': 0.39; 'skip:e 20': 0.39; 'some': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.61; 'skip:n 10': 0.62; 'making': 0.62; 'between': 0.65; 'union': 0.67; 'examples.': 0.84; 'oscar': 0.84; 'subject:Set': 0.91; 'url:latest': 0.91
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=OnYoCkcCWZUswdQDHOtnXMFl0Lg=; b=3Gr9C6 53aXO5/qv4YL3P3onjDobl1l7zzSOO73sRgKl50S47fxL3yJg27oLwB22OMb7SjO d2pU7W3XlbvS8k4etNSNc9ipRXyLcIVmbe2AtLZGbtyEoBkddKtNpFMMXZdVtuNT 7IzRyQb7bliytWxQJyATqrOV+zMEgKCZU6Fnc=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=OnYoCkcCWZUswdQ DHOtnXMFl0Lg=; b=YLstIEV4iYR2x+suXAVKGLL6ZL2FFzyzJmM6t2nUwoqWzKi aiMCTeFWGpKr8ihtLllJixftS0+7BNuMKgBO45ZxubBQylOcCzQhUD4g2kxBljwJ uHkAFzzw7xgnlqnbgwNfknzZzNrjWstDQ1PdaQr2SGK6GJJ2Ky9TA33XSWy4=
X-Sasl-Enc pGdpIRt2/k6JZXK9oCqzD0z6rm26xQLGMnJC1hCUP9/d 1459784663
X-Mailer MessagingEngine.com Webmail Interface - ajax-2373d6a1
In-Reply-To <CAHVvXxRRmJKHq-H8xotY9yF+pzG+7NOSMhOwTbL4qF-N4XjTfQ@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <1459784663.3451967.568464658.50905009@webmail.messagingengine.com>
X-Mailman-Original-References <56FE0625.5030901@shopzeus.com> <1459523394.2611014.565840994.593DD99A@webmail.messagingengine.com> <570213CB.8040101@shopzeus.com> <1459782597.3444051.568344234.048046C6@webmail.messagingengine.com> <CAHVvXxRRmJKHq-H8xotY9yF+pzG+7NOSMhOwTbL4qF-N4XjTfQ@mail.gmail.com>
Xref csiph.com comp.lang.python:106449

Show key headers only | View raw


On Mon, Apr 4, 2016, at 11:32, Oscar Benjamin wrote:
> On 4 April 2016 at 16:09, Random832 <random832@fastmail.com> wrote:
> > Like I said before, I don't think the set-like operations on Intervals
> > are useful - what can you accomplish with them rather than by making a
> > set consisting of only one interval and doing operations on that?
> 
> I guess it depends what your application is but sympy has interval
> sets and can do computation on them to represent the solutions of
> equations/inequalities (many other types of set are also included).

Yes, my question is why it's useful to have a single Interval as a
*distinct* type, separate from the interval set type, which supports a
sharply limited number of set-like operations (such as the union of two
overlapping intervals but NOT two non-overlapping ones). This doesn't
appear to be the case in sympy based on your examples.

Having an interval as a distinct type may be useful (to iterate over the
intervals of a set, for example), but his design blurs the line between
intervals and sets (by supporting some set operations) without
eliminating it as sympy seems to do.

> In [6]: Interval(1, 2) | Interval(3, 4)
> Out[6]: [1, 2] ∪ [3, 4]
> 
> There is some discussion about why it's good to do this stuff with
> sets (for sympy's purposes here):
> http://docs.sympy.org/latest/modules/solvers/solveset.html#why-do-we-use-sets-as-an-output-type

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: ANN: intervalset Was: Set type for datetime intervals Random832 <random832@fastmail.com> - 2016-04-04 11:44 -0400

csiph-web