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

remove deprecated code in functions/ and symbolic/ #16023

Closed
rwst opened this issue Mar 27, 2014 · 47 comments
Closed

remove deprecated code in functions/ and symbolic/ #16023

rwst opened this issue Mar 27, 2014 · 47 comments

Comments

@rwst
Copy link

rwst commented Mar 27, 2014

Component: symbolics

Keywords: deprecation

Author: Ralf Stephan

Branch/Commit: 633a411

Reviewer: Burcin Erocal, Karl-Dieter Crisman

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

@rwst rwst added this to the sage-6.2 milestone Mar 27, 2014
@rwst
Copy link
Author

rwst commented Mar 27, 2014

New commits:

0b379e8Trac #16023: remove deprecated

@rwst
Copy link
Author

rwst commented Mar 27, 2014

Commit: 0b379e8

@rwst
Copy link
Author

rwst commented Mar 27, 2014

Branch: u/rws/ticket/16023

@burcin
Copy link

burcin commented Mar 27, 2014

Reviewer: Burcin Erocal

@burcin
Copy link

burcin commented Mar 27, 2014

comment:2

Many thanks for cleaning up!

It looks like some function bodies are reduced to BuiltinFunction.__call__() or GinacFunction.__call__(). Moving the doctest somewhere else and removing these functions would be better.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2014

Changed commit from 0b379e8 to eb0fcad

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

eb0fcadremove superfluous `__call__` funcs

@rwst
Copy link
Author

rwst commented Mar 27, 2014

comment:4

Thanks. I believe you mean Ei and exp.

@burcin
Copy link

burcin commented Mar 27, 2014

comment:5

Looks good to me. You can switch to positive review once the patchbot gives it a greenlight. (Does patchbot work with the git workflow now?)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2014

Changed commit from eb0fcad to 4a9b2e1

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

4a9b2e1fix typo

@rwst
Copy link
Author

rwst commented Mar 29, 2014

comment:7

Replying to @burcin:

Looks good to me. You can switch to positive review once the patchbot gives it a greenlight. (Does patchbot work with the git workflow now?)

Not here. This is still unresolved:
sagemath/sage-patchbot#10

Thanks.

@kcrisman
Copy link
Member

kcrisman commented Apr 1, 2014

comment:8

The Bessel functions weren't removed that long ago, and note that there is a LOT more to be removed - namely, the whole underscore versions of them, see https://github.com/sagemath/sagetrac-mirror/blob/develop/src/sage/functions/bessel.py?id=9db8c5c598ec9de953a33b14e531bee3c092c199#n1102 - basically to the end of the document.

Still, hopefully it wouldn't be a problem. I am pretty sure that all the doctests in the stuff to be removed is replicated elsewhere, but it might be worth checking out just to be sure. Also note that here there is a small bit to be removed. I wouldn't cry if the whole Bessel removal were another ticket.

@rwst
Copy link
Author

rwst commented Apr 15, 2014

Changed commit from 4a9b2e1 to e964cf5

@rwst
Copy link
Author

rwst commented Apr 15, 2014

Last 10 new commits:

ba8a5a6ref doc completed; coefficients(), slicing added
be9bb7fhandle ogf > 1
b39485bmove to rings/, allow 1/x, subclass from FractionFieldElement
cc2b400add, sub functions
998ed74mul, div
ca22f6dbe specific about base ring, more doctests
8b74445specify applicability, handle constants, more doctests, better documentation
a9a19a9use pari script default for guessing; safeguards in ctor
662a41blast doctests, fix documentation
e964cf5Merge branch 'u/rws/ticket/16023' of trac.sagemath.org:sage into tmp

@rwst
Copy link
Author

rwst commented Apr 15, 2014

Changed branch from u/rws/ticket/16023 to u/rws/ticket/16023-1

@rwst
Copy link
Author

rwst commented Apr 15, 2014

Changed commit from e964cf5 to 4a9b2e1

@rwst
Copy link
Author

rwst commented Apr 15, 2014

comment:10

Oops wrong branch.

@rwst
Copy link
Author

rwst commented Apr 15, 2014

Changed branch from u/rws/ticket/16023-1 to u/rws/ticket/16023

@kcrisman
Copy link
Member

comment:11

Now the branch doesn't seem to be coming up...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 16, 2014

Changed commit from 4a9b2e1 to 2b23263

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 16, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

01dc349Merge branch 'u/rws/ticket/16023' of trac.sagemath.org:sage into tmp
2b2326316023: remove deprecated keyword code

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 28, 2014

Changed commit from b856623 to 1a00c65

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@kcrisman
Copy link
Member

comment:20

Somewhat surprisingly, given the attention to detail you've clearly given, there is still work to be done here - but easy work, I believe.

  • In other.py, in the __call__ method for gamma, there is still an import of deprecation which is now not needed.
  • This comment suggests that perhaps
sage: Q.<i> = NumberField(x^2+1) 
sage: gamma(i) 

should not work at all. So either we should confirm it raises an error, check what "should" happen, or make it break...

@kcrisman
Copy link
Member

comment:21

Burcin, in case you're reading this - what was your intent with that doctest? Should this not work because an embedding needs to be specified, or should it "just work"?

@kcrisman
Copy link
Member

Changed reviewer from Burcin Erocal to Burcin Erocal, Karl-Dieter Crisman

@kcrisman
Copy link
Member

comment:22

Also, after #16173 and #16737 this one will probably be a little smaller.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 20, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

489c5a1Merge branch 'develop' into t/16023/ticket/16023

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 20, 2014

Changed commit from 1a00c65 to 489c5a1

@kcrisman
Copy link
Member

comment:24
  • In other.py, in the __call__ method for gamma, there is still an import of deprecation which is now not needed.

Still needed, I believe.

sage: Q.<i> = NumberField(x^2+1) 
sage: gamma(i) 

should not work at all. So either we should confirm it raises an error, check what "should" happen, or make it break...

Given that e^i, ln(i), and sqrt(i) all fail in this case for various reasons related to embedding, maybe this should really be broken now. Since

            if not str(err).startswith("cannot coerce"):
                raise

suggests that this is the only kind of error we treat, and then we just plop it in RR or CC as we can, I suppose we could remove that entire thing and do

return GinacFunction.__call__(self, x, coerce=coerce, hold=hold)

as the entire body of call or even remove it. What do you think?

@burcin
Copy link

burcin commented Aug 28, 2014

comment:25

Replying to @kcrisman:

Burcin, in case you're reading this - what was your intent with that doctest? Should this not work because an embedding needs to be specified, or should it "just work"?

Right. It shouldn't work without specifying an explicit embedding in the NumberField constructor.

I don't have time to try the patch now. It would be nice to give the user a helpful error message in this case, but I have no idea how much trouble that is.

@kcrisman
Copy link
Member

comment:26

Thanks, Burcin!

Okay, I will look at this today, then. Here are a few notes to myself so I don't forget (they are probably taken care of elsewhere or not needed):

  • make sure 13608 is still doctested
  • check whether 2607, 6094, 10859 were doctested and remove those if needed
  • see if just raising a slightly different error message in the number field case will be enough

@kcrisman
Copy link
Member

comment:27
  • make sure 13608 is still doctested

Yeah, although something similar is tested in symbolic/function.pyx this is testing something very specific to exp, so that test should be kept, probably just in the same place as the other example, or in some generic tests place in the file.

  • check whether 2607, 6094, 10859 were doctested and remove those if needed

The 2607 stuff actually just removes the deprecated method for local max/min, but there is also the deprecated function it depended on which we might as well remove at the same time, seems weird not to

numerical/optimize.py:233:find_maximum_on_interval = deprecated_function_alias(2607, find_local_maximum)
numerical/optimize.py:234:find_minimum_on_interval = deprecated_function_alias(2607, find_local_minimum)

These don't seem to have been tested, though, which is good for this ticket. The stuff for 6094 I found is unrelated to this ticket and not high priority, and 10859 was already all set.

  • see if just raising a slightly different error message in the number field case will be enough

Here is current status if I just remove the call method entirely like you did the others.

sage: gamma(i).n()
-0.154949828301811 - 0.498015668118356*I
sage: Q.<i> = NumberField(x^2+1)
sage: gamma(i)
---------------------------------------------------------------------------
TypeError: cannot coerce arguments: no canonical coercion from Number Field in i with defining polynomial x^2 + 1 to Symbolic Ring

I guess we could keep the method and raise an error about embedding, or keep this one. This is the only doctest failure in either directory, and we would want to rescue the tests from that module.


What do you think? I hope it's okay with the multi back and forth on this.

@rwst
Copy link
Author

rwst commented Sep 3, 2014

comment:28

Well then, is this still really needs_work?

@kcrisman
Copy link
Member

kcrisman commented Sep 3, 2014

comment:29

Well then, is this still really needs_work?

Yes, because currently

sage: Q.<i> = NumberField(x^2+1) 
sage: gamma(i) 

doesn't just work, it is doctested! But the discussion above confirms it should not be allowed to work.

So, as I said above, we can either remove the call method entirely and then doctest that error, or keep it and make sure it raises an error about embedding as appropriate. We should also rescue the correct doctests from that method and put them somewhere as tests.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 3, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

186e330Merge branch 'develop' into t/16023/ticket/16023
633a41116023: remove gamma1.__call__()

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 3, 2014

Changed commit from 489c5a1 to 633a411

@rwst
Copy link
Author

rwst commented Sep 3, 2014

comment:31

Ah ok. I should have looked into it better. I think after the buildbot thumbs up this can be set to positive?

@kcrisman
Copy link
Member

kcrisman commented Sep 3, 2014

comment:32

Yup, thanks!

@vbraun
Copy link
Member

vbraun commented Sep 6, 2014

Changed branch from u/rws/ticket/16023 to 633a411

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

4 participants