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

Move normalize_names() out of CategoryObject #19675

Closed
jdemeyer opened this issue Dec 7, 2015 · 12 comments
Closed

Move normalize_names() out of CategoryObject #19675

jdemeyer opened this issue Dec 7, 2015 · 12 comments

Comments

@jdemeyer
Copy link

jdemeyer commented Dec 7, 2015

It makes no sense that normalize_names appears in the TAB-completion of all CategoryObjects. It also makes little sense that it's a method of CategoryObject.

  1. Move normalize_names and _certify_names out of CategoryObject and make them non-method functions.

  2. Remove the redundant parent_gens.normalize_names, parent_gens._certify_names, parent.normalize_names and sage.schemes.toric.variety.certify_names.

  3. Always interpret ngens=-1 as "unknown number of generators" and ngens=0 as "no generators". The previous implementation did this inconsistently.

  4. Add doctests.

Note that many more classes should probably use normalize_names. I didn't fix this here. Example from src/sage/algebras/jordan_algebra.py:

        if names is not None:
            if isinstance(names, str):
                names = names.split(',')
            names = tuple(names)

Component: categories

Author: Jeroen Demeyer

Branch/Commit: 280312f

Reviewer: Travis Scrimshaw

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

@jdemeyer jdemeyer added this to the sage-6.10 milestone Dec 7, 2015
@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title make CategoryObject.normalize_names private move normalize_names() out of CategoryObject Dec 7, 2015
@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title move normalize_names() out of CategoryObject Move normalize_names() out of CategoryObject Dec 7, 2015
@jdemeyer

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Dec 7, 2015

comment:4

Big +1.

@jdemeyer
Copy link
Author

jdemeyer commented Dec 7, 2015

@jdemeyer
Copy link
Author

jdemeyer commented Dec 7, 2015

Commit: 280312f

@jdemeyer
Copy link
Author

jdemeyer commented Dec 7, 2015

New commits:

280312fMove normalize_names to function in category_object.pyx

@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Dec 7, 2015

comment:9

LGTM.

@tscrim
Copy link
Collaborator

tscrim commented Dec 7, 2015

Reviewer: Travis Scrimshaw

@vbraun
Copy link
Member

vbraun commented Dec 9, 2015

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

3 participants