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


Groups > linux.debian.bugs.dist > #1203458 > unrolled thread

Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation

Started byYogeswaran Umasankar <yogu@debian.org>
First post2024-07-07 17:50 +0200
Last post2024-07-08 02:10 +0200
Articles 11 — 6 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Yogeswaran Umasankar <yogu@debian.org> - 2024-07-07 17:50 +0200
    Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Daniele Nicolodi <daniele@grinta.net> - 2024-07-07 19:20 +0200
      Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Andrey Rakhmatullin <wrar@debian.org> - 2024-07-07 19:30 +0200
    Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Yogeswaran Umasankar <yogu@debian.org> - 2024-07-07 20:00 +0200
      Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Alexandre Detiste <alexandre.detiste@gmail.com> - 2024-07-07 20:10 +0200
      Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Andrey Rakhmatullin <wrar@debian.org> - 2024-07-07 22:00 +0200
        Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Colin Watson <cjwatson@debian.org> - 2024-07-08 16:40 +0200
    Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Yogeswaran Umasankar <yogu@debian.org> - 2024-07-08 02:20 +0200
    Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Russ Allbery <rra@debian.org> - 2024-07-08 02:10 +0200
    Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Yogeswaran Umasankar <yogu@debian.org> - 2024-07-08 02:00 +0200
      Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation Daniele Nicolodi <daniele@grinta.net> - 2024-07-08 02:10 +0200

#1203458 — Bug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation

FromYogeswaran Umasankar <yogu@debian.org>
Date2024-07-07 17:50 +0200
SubjectBug#1075905: ITP: python-fraction -- Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation
Message-ID<IXCjf-unZ-3@gated-at.bofh.it>
Package: wnpp
Severity: wishlist
Owner: Yogeswaran Umasankar <yogu@debian.org>
X-Debbugs-Cc: debian-devel@lists.debian.org, yogu@debian.org

* Package name    : python-fraction
  Version         : 2.2.0 
  Upstream Contact: Shantanu Banerjee <hi@shantanubanerjee.co>
* URL             : https://github.com/bradley101/fraction
* License         : Expat
  Programming Lang: Python
  Description     : Fraction carries out all the fraction operations including addition, subtraction, multiplication, division, reciprocation

Fraction is a Python module that is designed for fractional
 values numerator/denominator. Computes reciprocal of fraction
 as Fraction object. Supports addition, subtraction,
 multiplication, and division of Fraction objects, each
 operation returning a Fraction object. Allows comparison
 operations (<, <=, >, >=, ==, !=) and returns a boolean.
 Converts a fraction into a float string. Planned to
 maintain this package under DPT.

[toc] | [next] | [standalone]


#1203466

FromDaniele Nicolodi <daniele@grinta.net>
Date2024-07-07 19:20 +0200
Message-ID<IXDIl-vkJ-7@gated-at.bofh.it>
In reply to#1203458
On 07/07/24 17:43, Yogeswaran Umasankar wrote:
> Package: wnpp
> Severity: wishlist
> Owner: Yogeswaran Umasankar <yogu@debian.org>
> X-Debbugs-Cc: debian-devel@lists.debian.org, yogu@debian.org
> 
> * Package name    : python-fraction

How is this different from the fractions module in the Python standard 
library?  I was not able to find anything that this library does that 
the standard library equivalent does not do.

Cheers,
Dan

[toc] | [prev] | [next] | [standalone]


#1203471

FromAndrey Rakhmatullin <wrar@debian.org>
Date2024-07-07 19:30 +0200
Message-ID<IXDS1-vo8-3@gated-at.bofh.it>
In reply to#1203466

[Multipart message — attachments visible in raw view] — view raw

On Sun, Jul 07, 2024 at 07:00:57PM +0200, Daniele Nicolodi wrote:
> On 07/07/24 17:43, Yogeswaran Umasankar wrote:
> > Package: wnpp
> > Severity: wishlist
> > Owner: Yogeswaran Umasankar <yogu@debian.org>
> > X-Debbugs-Cc: debian-devel@lists.debian.org, yogu@debian.org
> > 
> > * Package name    : python-fraction
> 
> How is this different from the fractions module in the Python standard
> library?  I was not able to find anything that this library does that the
> standard library equivalent does not do.
Yeah, it looks like a school project.
Is it a revdep of something? If so, that's probably a mistake?

-- 
WBR, wRAR

[toc] | [prev] | [next] | [standalone]


#1203480

FromYogeswaran Umasankar <yogu@debian.org>
Date2024-07-07 20:00 +0200
Message-ID<IXEl3-vyv-1@gated-at.bofh.it>
In reply to#1203458
Yes, can use the standard library. This dependency chain starts with
moarchiving, which itself is a dependency for cma, and so on. I can
create a patch specifically for moarchiving.

Cheers!

[toc] | [prev] | [next] | [standalone]


#1203484

FromAlexandre Detiste <alexandre.detiste@gmail.com>
Date2024-07-07 20:10 +0200
Message-ID<IXEl3-vyv-7@gated-at.bofh.it>
In reply to#1203480
Great review !

We should avoid packaging things with very extra utility.

I'm tempted to RM python-easydev now that nothing left depends on it.

Le dim. 7 juil. 2024 à 19:55, Yogeswaran Umasankar <yogu@debian.org> a écrit :
>
> Yes, can use the standard library. This dependency chain starts with
> moarchiving, which itself is a dependency for cma, and so on. I can
> create a patch specifically for moarchiving.
>
> Cheers!

[toc] | [prev] | [next] | [standalone]


#1203501

FromAndrey Rakhmatullin <wrar@debian.org>
Date2024-07-07 22:00 +0200
Message-ID<IXGdb-wGz-9@gated-at.bofh.it>
In reply to#1203480

[Multipart message — attachments visible in raw view] — view raw

On Sun, Jul 07, 2024 at 01:54:59PM -0400, Yogeswaran Umasankar wrote:
> Yes, can use the standard library. This dependency chain starts with
> moarchiving, which itself is a dependency for cma, and so on. I can
> create a patch specifically for moarchiving.

As reported elsewhere, moarchiving declares a dep on it but doesn't
actually import it.
This needs to be fixed upstream to.

-- 
WBR, wRAR

[toc] | [prev] | [next] | [standalone]


#1203607

FromColin Watson <cjwatson@debian.org>
Date2024-07-08 16:40 +0200
Message-ID<IXXH4-HwE-5@gated-at.bofh.it>
In reply to#1203501
On Mon, Jul 08, 2024 at 12:50:42AM +0500, Andrey Rakhmatullin wrote:
> On Sun, Jul 07, 2024 at 01:54:59PM -0400, Yogeswaran Umasankar wrote:
> > Yes, can use the standard library. This dependency chain starts with
> > moarchiving, which itself is a dependency for cma, and so on. I can
> > create a patch specifically for moarchiving.
> 
> As reported elsewhere, moarchiving declares a dep on it but doesn't
> actually import it.
> This needs to be fixed upstream to.

I proposed https://github.com/CMA-ES/moarchiving/pull/9 upstream.

-- 
Colin Watson (he/him)                              [cjwatson@debian.org]

[toc] | [prev] | [next] | [standalone]


#1203581

FromYogeswaran Umasankar <yogu@debian.org>
Date2024-07-08 02:20 +0200
Message-ID<IXKgN-zlk-1@gated-at.bofh.it>
In reply to#1203458
On Mon, Jul 08, 2024 at 02:07:20AM +0200, Daniele Nicolodi wrote:
>On 08/07/24 01:47, Yogeswaran Umasankar wrote:
>>As I look further, it appears that standard Python libs such as float or
>>decimal.Decimal do not provide exact representation of rational numbers
>>(fractions) without potential loss of precision. Seems ‘fraction’
>>package yield exact results because those functions directly work on
>>fractions (to my limited understanding).
>
>As I already pointed out, the Python standard libray has a 
>`franctions` module https://docs.python.org/3/library/fractions.html 
>which does exactly what the ITP package does.

Ah I missed that point, thank you both for clarifying.

Cheers!

[toc] | [prev] | [next] | [standalone]


#1203617

FromRuss Allbery <rra@debian.org>
Date2024-07-08 02:10 +0200
Message-ID<IXK77-zig-3@gated-at.bofh.it>
In reply to#1203458
Yogeswaran Umasankar <yogu@debian.org> writes:

> As I look further, it appears that standard Python libs such as float or
> decimal.Decimal do not provide exact representation of rational numbers
> (fractions) without potential loss of precision. Seems ‘fraction’
> package yield exact results because those functions directly work on
> fractions (to my limited understanding).

> decimal.Decimal is better than float, but it only extends to arbitrary
> precision decimal arithmetic, not exact representation of rational
> numbers. Given that these libraries could potentially serve as
> dependencies for tensor-related packages and beyond, should we consider
> bringing 'fraction' or restrict ourselves to float (which is a fallback
> in moarchiving if fraction unavailable)?

I think the suggestion is to use the Python standard library package
"fractions" specifically:

https://docs.python.org/3/library/fractions.html

-- 
Russ Allbery (rra@debian.org)              <https://www.eyrie.org/~eagle/>

[toc] | [prev] | [next] | [standalone]


#1203618

FromYogeswaran Umasankar <yogu@debian.org>
Date2024-07-08 02:00 +0200
Message-ID<IXJNL-yWw-1@gated-at.bofh.it>
In reply to#1203458
As I look further, it appears that standard Python libs such as float or
decimal.Decimal do not provide exact representation of rational numbers
(fractions) without potential loss of precision. Seems ‘fraction’
package yield exact results because those functions directly work on
fractions (to my limited understanding).

decimal.Decimal is better than float, but it only extends to arbitrary
precision decimal arithmetic, not exact representation of rational
numbers. Given that these libraries could potentially serve as
dependencies for tensor-related packages and beyond, should we consider
bringing 'fraction' or restrict ourselves to float (which is a fallback
in moarchiving if fraction unavailable)?

I’m leaning towards fractions because it ensures exact fraction
representation without the issues of rounding in numbers. What do you
all think?

Cheers!

[toc] | [prev] | [next] | [standalone]


#1203627

FromDaniele Nicolodi <daniele@grinta.net>
Date2024-07-08 02:10 +0200
Message-ID<IXK77-zig-1@gated-at.bofh.it>
In reply to#1203618
On 08/07/24 01:47, Yogeswaran Umasankar wrote:
> As I look further, it appears that standard Python libs such as float or
> decimal.Decimal do not provide exact representation of rational numbers
> (fractions) without potential loss of precision. Seems ‘fraction’
> package yield exact results because those functions directly work on
> fractions (to my limited understanding).

As I already pointed out, the Python standard libray has a `franctions` 
module https://docs.python.org/3/library/fractions.html which does 
exactly what the ITP package does.

Cheers,
Dan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web