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

Change string representation of RealField #24523

Open
videlec opened this issue Jan 11, 2018 · 73 comments
Open

Change string representation of RealField #24523

videlec opened this issue Jan 11, 2018 · 73 comments

Comments

@videlec
Copy link
Contributor

videlec commented Jan 11, 2018

We change the string representation of RealField(XXX) from

Real Field with XX bits of precision

to

Real Floating-Point Field with XX bits of precision

The reason for this change is that "Real Field" is not precise enough. Beyond floating-point, "Real Field" could equivalently be used for fixed-point, intervals and balls. The standard terms in the literature are "floating-point arithmetic", "fixed-point arithmetic", "ball arithmetic" and "interval arithmetic", see eg

This ticket is part of a the refactorization #24457 that intends to clean computations involving the different kinds of real numbers.

The git branch was obtained by running the following command in $SAGE_ROOT/src

for file in $(grep -l "Real Field with" $(find . -name "*pyx" -o -name "*py" -o -name "*pxd" -o -name "*rst" -type f))
  do sed -i "s/Real Field with/Real Floating-Point Field with/g" $file
done

Tests work fine except for doctests that involves an output with a linebreak such as

sage: x = polygen(RR); r = (1 + x)/(1 - x^2); r.parent()
Fraction Field of Univariate Polynomial Ring in x over Real
Field with 53 bits of precision

(from src/sage/tests/french_book/polynomes.py line 218). These can also be handled using multiline sed replacement

for file in $(find . -name "*pyx" -o -name "*py" -o -name "*pxd" -o -name "*rst" -type f)
do
  sed -Ei '{N; s/Real(\s+)Field(\s+)with/Real\1Floating-Point Field\2with/; ty; P; D; :y}' $file
done

As part of this ticket, the printf percentage syntax has been changed to the newer Python 3 standard format syntax (see comment:22) in all real field representations.


Related discussion on sage-devel.

Component: basic arithmetic

Author: Vincent Delecroix, Ralf Stephan, Michael Jung

Branch/Commit: u/gh-mjungmath/24523 @ 7f7d902

Reviewer: Vincent Klein, Vincent Delecroix

Issue created by migration from https://trac.sagemath.org/ticket/24523

@videlec videlec added this to the sage-8.2 milestone Jan 11, 2018
@videlec

This comment has been minimized.

@videlec
Copy link
Contributor Author

videlec commented Jan 11, 2018

Dependencies: #24511

@rwst
Copy link
Contributor

rwst commented Jan 12, 2018

comment:3

I first changed find . to find src because I was in the sage top directory. Then I added g after / to replace multiple occurences of the pattern in one line. When applying the script there were several things that needed manual adaptation: in tests/french_book/nonlinear_doctest.py the print command of a doctest had to be changed to ensure aesthetic results. Also the script picks up conf.py files under src/doc and for some reasons git thinks it has to delete them and create them new, so I git checked out the originals of all src/doc/en/reference/*/conf.py files. The remaining doctest fails appear to be instances of split lines and, according to recent comments by Jeroen which I agree with, that if the output is one line the doctest output should be too, I joined those lines and replaced the pattern.

@rwst
Copy link
Contributor

rwst commented Jan 12, 2018

Branch: u/rws/24523

@rwst
Copy link
Contributor

rwst commented Jan 12, 2018

Commit: 137c4b8

@rwst
Copy link
Contributor

rwst commented Jan 12, 2018

comment:5

Also there was one doctest change in a pxd file. 127 files were changed.


New commits:

a78229624511: Move create_RealField to real_field.py
977f62d24511 deprecation
137c4b824523: Change string representation of RealField

@rwst
Copy link
Contributor

rwst commented Jan 12, 2018

Changed author from Vincent Delecroix to Vincent Delecroix, Ralf Stephan

@jdemeyer
Copy link
Contributor

comment:6

Sorry to spoil the party, but what is wrong with "Real Field with XX bits of precision"? Doesn't the "XX bits of precision" imply already that it's floating point? I think that the shorter name Real Field is sufficient.

Note that also balls and intervals are floating-point, so do you plan to use Real Floating-point Interval Field and Real Floating-point Ball Field too?

@videlec
Copy link
Contributor Author

videlec commented Jan 12, 2018

comment:7

And anyway, this kind of things has to be agreed on on sage-devel.

@videlec
Copy link
Contributor Author

videlec commented Jan 12, 2018

comment:8

Replying to @jdemeyer:

Sorry to spoil the party, but what is wrong with "Real Field with XX bits of precision"?
Doesn't the "XX bits of precision" imply already that it's floating point? I think that the shorter name Real Field is sufficient.

Note that also balls and intervals are floating-point, so do you plan to use Real Floating-point Interval Field and Real Floating-point Ball Field too?

The rationale is: not precise enough. The "Real Field with XX bits of precision" could equivalently be used for intervals and balls. The standard terms in the literature are "floating-point arithmetic", "ball arithmetic" and "interval arithmetic".

@rwst
Copy link
Contributor

rwst commented Mar 4, 2018

comment:9

This already accumulates merge conflicts en masse.

@videlec

This comment has been minimized.

@videlec
Copy link
Contributor Author

videlec commented Jun 3, 2018

comment:11

NOT to be merged: just testing what patchbots have to say...


New commits:

4ab32e224523: "Real Field" -> "Real Floating-point Field"

@videlec
Copy link
Contributor Author

videlec commented Jun 3, 2018

Changed commit from 137c4b8 to 4ab32e2

@videlec
Copy link
Contributor Author

videlec commented Jun 3, 2018

Changed branch from u/rws/24523 to u/vdelecroix/24523

@videlec videlec modified the milestones: sage-8.2, sage-8.3 Jun 3, 2018
@videlec

This comment has been minimized.

@videlec
Copy link
Contributor Author

videlec commented Jun 3, 2018

Changed dependencies from #24511 to none

@videlec

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 3, 2018

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

e3a54e624523: "Real Field" -> "Real Floating-point Field"

@dimpase
Copy link
Member

dimpase commented Oct 21, 2020

comment:48

Do we have a followup for Complex Field? Because it has the same problem.

@dimpase
Copy link
Member

dimpase commented Nov 6, 2020

comment:49

rebase please

@seblabbe
Copy link
Contributor

seblabbe commented Jan 9, 2021

It was asked on the sage-devel discussion whether people have an opinion.

Replying to [ticket:24523 ticket description]:

We change the string representation of RealField(XXX) from

Real Field with XX bits of precision

to

Real Floating-Point Field with XX bits of precision

+1 from me

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2021

Changed commit from e4a1d75 to 93cb1a2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

1fa235cTrac 24523: py3 format style + "Real Field" -> "Real Floating-Point Field"
93cb1a2Trac #24523: change string repr "Real Field" -> "Real Floating-Point Field"

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

e654661Trac 24523: "Real Field" -> "Real Floating-Point Field" + new formatting style
050aa3dTrac #24523: change string repr "Real Field" -> "Real Floating-Point Field"

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2021

Changed commit from 93cb1a2 to 050aa3d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2021

Changed commit from 050aa3d to 7f7d902

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8c89c3fTrac #24523: "Real Field" -> "Real Floating-Point Field" + new formatting style
7f7d902Trac #24523: change string repr "Real Field" -> "Real Floating-Point Field"

@mjungmath
Copy link
Contributor

comment:54

Replying to @dimpase:

Do we have a followup for Complex Field? Because it has the same problem.

Yes. See #24489.

Replying to @dimpase:

rebase please

Done.

@mjungmath
Copy link
Contributor

comment:55

I wonder a bit about the changes in src/sage/tests/books/. Is that how it should be?

@seblabbe
Copy link
Contributor

comment:56

Replying to @mjungmath:

I wonder a bit about the changes in src/sage/tests/books/. Is that how it should be?

Yes

@mkoeppe
Copy link
Contributor

mkoeppe commented Jan 31, 2021

comment:57

rebase

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 15, 2021

comment:58

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 15, 2021
@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 19, 2021

comment:59

Setting a new milestone for this ticket based on a cursory review.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 14, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 2, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants