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

some details in sloane_functions #32397

Closed
fchapoton opened this issue Aug 18, 2021 · 13 comments
Closed

some details in sloane_functions #32397

fchapoton opened this issue Aug 18, 2021 · 13 comments

Comments

@fchapoton
Copy link
Contributor

CC: @tscrim @slel

Component: combinatorics

Author: Frédéric Chapoton

Branch/Commit: 8ffa650

Reviewer: Travis Scrimshaw

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

@fchapoton fchapoton added this to the sage-9.5 milestone Aug 18, 2021
@fchapoton
Copy link
Contributor Author

Commit: 51d7411

@fchapoton
Copy link
Contributor Author

New commits:

51d7411a few details in sloane_functions

@fchapoton
Copy link
Contributor Author

Branch: u/chapoton/32397

@tscrim
Copy link
Collaborator

tscrim commented Aug 19, 2021

comment:3

I did some more cleanup of the documentation and some PEP8 stuff. There are a lot of changes, but it is mostly from doing find-and-replace. If my changes are good, positive review.


New commits:

8ffa650More cleanup and changes of sloane_functions.

@tscrim
Copy link
Collaborator

tscrim commented Aug 19, 2021

Changed branch from u/chapoton/32397 to u/tscrim/32397

@tscrim
Copy link
Collaborator

tscrim commented Aug 19, 2021

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Aug 19, 2021

Changed commit from 51d7411 to 8ffa650

@fchapoton
Copy link
Contributor Author

comment:4

ok, thanks. Let it be.

@slel
Copy link
Member

slel commented Aug 20, 2021

comment:5

Can you comment on this and similar changes:

-        return Integer(n)
+        return ZZ(n)

I was under the vague impression Integer(n)
should be preferred to ZZ(n).

Maybe because it's more direct? or slightly faster?
Doesn't ZZ(n) call Integer(n) in the end?

@fchapoton
Copy link
Contributor Author

comment:6

Travis removed an alias in this file that said Integer = ZZ !
So the behaviour is the exact same behaviour as it was before.

@tscrim
Copy link
Collaborator

tscrim commented Aug 20, 2021

comment:7

Replying to @slel:

I was under the vague impression Integer(n)
should be preferred to ZZ(n).

Maybe because it's more direct? or slightly faster?
Doesn't ZZ(n) call Integer(n) in the end?

I am never really sure which one to use. From a quick look, by calling Integer, you avoid a trip through Sage's coercion check as ZZ._element_constructor_ is Integer. So Integer(n) is faster, but maybe less robust? Anyways, as Frédéric mentioned, this was just getting rid of an alias. Maybe I should have gotten rid of the ZZ(n) calls and imported Integer. Well, either way, I doubt this will be a bottleneck in any code and have an impact.

@slel
Copy link
Member

slel commented Aug 20, 2021

comment:8

Importing ZZ is needed here in any case
for ZZ.zero() and ZZ.one().

I also doubt a few tens of nanoseconds
will impact OEIS-related code.

All in all I am fine with either solution,
I was just curious.

@vbraun
Copy link
Member

vbraun commented Sep 13, 2021

Changed branch from u/tscrim/32397 to 8ffa650

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