Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Remove spurious changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Nov 8, 2022
1 parent 94a9718 commit 3e917a4
Show file tree
Hide file tree
Showing 23 changed files with 38 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/doc/en/prep/Programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ It is very important to keep in the parentheses.
::

sage: A.det # Won't work
<bound method Matrix.det of ...>
<built-in method det of sage.matrix.matrix_integer_dense.Matrix_integer_dense object at ...>

This is so useful because we can use the 'tab' key, remember!

Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/prep/Symbolics-and-Basic-Plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ This is a good place for a few reminders of basic help.
::

sage: z.simplify
<bound method Expression.simplify of -((x + 1)*sqrt(x - 1) - (x - 1)^(3/2))/sqrt((x + 1)*(x - 1))>
<built-in method simplify of sage.symbolic.expression.Expression object at ...>

Finally, recall that you can get nicely typeset versions of the output
in several ways.
Expand Down
8 changes: 4 additions & 4 deletions src/sage/arith/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2163,9 +2163,9 @@ def get_gcd(order):
EXAMPLES::
sage: sage.arith.misc.get_gcd(4000)
<bound method arith_int.gcd_int of <sage.rings.fast_arith.arith_int object at ...>
<built-in method gcd_int of sage.rings.fast_arith.arith_int object at ...>
sage: sage.arith.misc.get_gcd(400000)
<bound method arith_llong.gcd_longlong of <sage.rings.fast_arith.arith_llong object at ...>
<built-in method gcd_longlong of sage.rings.fast_arith.arith_llong object at ...>
sage: sage.arith.misc.get_gcd(4000000000)
<function gcd at ...>
"""
Expand All @@ -2185,9 +2185,9 @@ def get_inverse_mod(order):
EXAMPLES::
sage: sage.arith.misc.get_inverse_mod(6000)
<bound method arith_int.inverse_mod_int of <sage.rings.fast_arith.arith_int object at ...>
<built-in method inverse_mod_int of sage.rings.fast_arith.arith_int object at ...>
sage: sage.arith.misc.get_inverse_mod(600000)
<bound method arith_llong.inverse_mod_longlong of <sage.rings.fast_arith.arith_llong object at ...>
<built-in method inverse_mod_longlong of sage.rings.fast_arith.arith_llong object at ...>
sage: sage.arith.misc.get_inverse_mod(6000000000)
<function inverse_mod at ...>
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/sf/classical.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def init():
sage: sage.combinat.sf.classical.conversion_functions = {}
sage: init()
sage: sage.combinat.sf.classical.conversion_functions[('Schur', 'powersum')]
<cyfunction t_SCHUR_POWSYM_symmetrica at ...>
<built-in function t_SCHUR_POWSYM_symmetrica>
The following checks if the bug described in :trac:`15312` is fixed. ::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/finance/option.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def black_scholes(double spot_price, double strike_price, double time_to_maturit
sage: finance.black_scholes
doctest:warning...
DeprecationWarning: the package sage.finance is deprecated...
<cyfunction black_scholes at ...>
<built-in function black_scholes>
sage: finance.black_scholes(42, 40, 0.5, 0.1, 0.2, 'call') # abs tol 1e-10
4.759422392871532
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/strongly_regular_db.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ def is_RSHCD(int v, int k, int l, int mu):

sage: from sage.graphs.strongly_regular_db import is_RSHCD
sage: t = is_RSHCD(64,27,10,12); t
[<cyfunction SRG_from_RSHCD at ...>, 64, 27, 10, 12]
[<built-in function SRG_from_RSHCD>, 64, 27, 10, 12]
sage: g = t[0](*t[1:]); g
Graph on 64 vertices
sage: g.is_strongly_regular(parameters=True)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/sage0.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def _repr_(self):
EXAMPLES::
sage: sage0(4).gcd
<bound method PrincipalIdealDomainElement.gcd of 4>
<built-in method gcd of sage.rings.integer.Integer object at 0x...>
"""
return str(self._obj.parent().eval('%s.%s' % (self._obj._name,
self._name)))
Expand Down
2 changes: 1 addition & 1 deletion src/sage/libs/singular/ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ cpdef poison_currRing(frame, event, arg):
sage: from sage.libs.singular.ring import poison_currRing
sage: sys.settrace(poison_currRing)
sage: sys.gettrace()
<cyfunction poison_currRing at ...>
<built-in function poison_currRing>
sage: sys.settrace(previous_trace_func) # switch it off again
"""
global currRing
Expand Down
2 changes: 1 addition & 1 deletion src/sage/misc/c3_controlled.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ class HierarchyElement(object, metaclass=ClasscallMetaclass):
sage: x._bases
[5, 2]
sage: x._key
<cyfunction identity at ...>
<built-in function identity>
sage: x._key(10)
10
Expand Down
1 change: 0 additions & 1 deletion src/sage/misc/sagedoc_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def process_docstring_aliases(app, what, name, obj, options, docstringlines):
"""
Change the docstrings for aliases to point to the original object.
"""

basename = name.rpartition('.')[2]
if hasattr(obj, '__name__') and obj.__name__ != basename:
docstringlines[:] = ['See :obj:`%s`.' % name]
Expand Down
2 changes: 1 addition & 1 deletion src/sage/misc/sageinspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def is_function_or_cython_function(obj):
sage: is_function_or_cython_function(_mul_parent)
True
sage: is_function_or_cython_function(Integer.digits) # unbound method
True
False
sage: is_function_or_cython_function(Integer(1).digits) # bound method
False
Expand Down
4 changes: 2 additions & 2 deletions src/sage/rings/finite_rings/hom_finite_field.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
sage: Frob = k.frobenius_endomorphism()
sage: embed = Frob.fixed_field()[1]
sage: embed.__reduce__() # indirect doctest
(<cyfunction unpickle_map at ...>,
(<built-in function unpickle_map>,
(<class 'sage.rings.finite_rings.hom_prime_finite_field.FiniteFieldHomomorphism_prime'>,
Set of field embeddings from Finite Field of size 5 to Finite Field in t of size 5^3,
{},
Expand Down Expand Up @@ -835,7 +835,7 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
sage: k.<t> = GF(5^3)
sage: Frob = k.frobenius_endomorphism(2)
sage: Frob.__reduce__() # indirect doctest
(<cyfunction unpickle_map at ...>,
(<built-in function unpickle_map>,
(<class 'sage.rings.finite_rings.hom_finite_field_givaro.FrobeniusEndomorphism_givaro'>,
Automorphism group of Finite Field in t of size 5^3,
{},
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/function_field/function_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
sage: TestSuite(S).run() # long time (4s)
Global function fields
======================
----------------------
A global function field in Sage is an extension field of a rational function field
over a *finite* constant field by an irreducible separable polynomial over the
Expand Down
8 changes: 4 additions & 4 deletions src/sage/sets/disjoint_set.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,14 @@ cdef class DisjointSet_of_integers(DisjointSet_class):
sage: d = DisjointSet(5)
sage: d.__reduce__()
(<cyfunction DisjointSet at ...>, (5,), [0, 1, 2, 3, 4])
(<built-in function DisjointSet>, (5,), [0, 1, 2, 3, 4])
::
sage: d.union(2,4)
sage: d.union(1,3)
sage: d.__reduce__()
(<cyfunction DisjointSet at ...>, (5,), [0, 1, 2, 1, 2])
(<built-in function DisjointSet>, (5,), [0, 1, 2, 1, 2])
"""
return DisjointSet, (self._nodes.degree,), self.__getstate__()

Expand Down Expand Up @@ -674,7 +674,7 @@ cdef class DisjointSet_of_hashables(DisjointSet_class):
{{0}, {1}, {2}, {3}, {4}}
sage: d = _
sage: d.__reduce__()
(<cyfunction DisjointSet at ...>,
(<built-in function DisjointSet>,
([0, 1, 2, 3, 4],),
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)])
Expand All @@ -683,7 +683,7 @@ cdef class DisjointSet_of_hashables(DisjointSet_class):
sage: d.union(2,4)
sage: d.union(1,3)
sage: d.__reduce__()
(<cyfunction DisjointSet at ...>,
(<built-in function DisjointSet>,
([0, 1, 2, 3, 4],),
[(0, 0), (1, 1), (2, 2), (3, 1), (4, 2)])
"""
Expand Down
6 changes: 3 additions & 3 deletions src/sage/structure/category_object.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ cdef class CategoryObject(SageObject):
sage: F.base_ring()
Integer Ring
sage: F.__class__.base_ring
<cyfunction CategoryObject.base_ring at ...>
<method 'base_ring' of 'sage.structure.category_object.CategoryObject' objects>
Note that the coordinates of the elements of a module can lie
in a bigger ring, the ``coordinate_ring``::
Expand All @@ -591,15 +591,15 @@ cdef class CategoryObject(SageObject):
sage: F.base_ring()
Rational Field
sage: F.__class__.base_ring
<cyfunction CategoryObject.base_ring at ...>
<method 'base_ring' of 'sage.structure.category_object.CategoryObject' objects>
sage: E = CombinatorialFreeModule(ZZ, [1,2,3])
sage: F = CombinatorialFreeModule(ZZ, [2,3,4])
sage: H = Hom(E, F)
sage: H.base_ring()
Integer Ring
sage: H.__class__.base_ring
<cyfunction CategoryObject.base_ring at ...>
<method 'base_ring' of 'sage.structure.category_object.CategoryObject' objects>
.. TODO::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/structure/factory.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ cdef class UniqueFactory(SageObject):
sage: a = test_factory(1, 2)
Making object (1, 2)
sage: test_factory.reduce_data(a)
(<cyfunction generic_factory_unpickle at ...>,
(<built-in function generic_factory_unpickle>,
(<sage.structure.test_factory.UniqueFactoryTester object at ...>,
(...),
(1, 2),
Expand Down
4 changes: 2 additions & 2 deletions src/sage/structure/list_clone.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ cdef class ClonableArray(ClonableElement):
sage: loads(dumps(el))
[1, 2, 4]
sage: t = el.__reduce__(); t
(<cyfunction _make_array_clone at ...>,
(<built-in function _make_array_clone>,
(<class 'sage.structure.list_clone_demo.IncreasingArray'>,
<sage.structure.list_clone_demo.IncreasingArrays_with_category object at ...>,
[1, 2, 4],
Expand Down Expand Up @@ -1720,7 +1720,7 @@ cdef class ClonableIntArray(ClonableElement):
sage: loads(dumps(el))
[1, 2, 4]
sage: t = el.__reduce__(); t
(<cyfunction _make_int_array_clone at ...>,
(<built-in function _make_int_array_clone>,
(<class 'sage.structure.list_clone_demo.IncreasingIntArray'>,
<sage.structure.list_clone_demo.IncreasingIntArrays_with_category object at ...>,
[1, 2, 4],
Expand Down
1 change: 1 addition & 0 deletions src/sage/symbolic/expression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6363,6 +6363,7 @@ cdef class Expression(Expression_abc):
sage: type(u._unpack_operands()[0])
<... 'tuple'>
"""
from sage.symbolic.expression import unpack_operands
return unpack_operands(self)

def operands(self):
Expand Down
17 changes: 5 additions & 12 deletions src/sage/symbolic/function.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ is attempted, and after that ``sin()`` which succeeds::
from sage.structure.sage_object cimport SageObject
from sage.structure.element cimport Element, parent, Expression
from sage.misc.lazy_attribute import lazy_attribute
from .expression import (
call_registered_function, find_registered_function, register_or_update_function,
get_sfunction_from_hash
)
from .expression import get_sfunction_from_serial as get_sfunction_from_serial

from sage.structure.coerce cimport (coercion_model,
py_scalar_to_element, is_numpy_type, is_mpmath_type)
Expand Down Expand Up @@ -258,8 +263,6 @@ cdef class Function(SageObject):
f(x)
"""
from .expression import register_or_update_function

self._serial = register_or_update_function(self, self._name, self._latex_name,
self._nargs, self._evalf_params_first,
False)
Expand Down Expand Up @@ -541,8 +544,6 @@ cdef class Function(SageObject):
if not isinstance(a, Expression):
raise TypeError("arguments must be symbolic expressions")

from .expression import call_registered_function

return call_registered_function(self._serial, self._nargs, args, hold,
not symbolic_input, SR)

Expand Down Expand Up @@ -837,17 +838,13 @@ cdef class GinacFunction(BuiltinFunction):
preserved_arg=preserved_arg, alt_name=alt_name)

cdef _is_registered(self):
from .expression import find_registered_function, get_sfunction_from_serial

# Since this is function is defined in C++, it is already in
# ginac's function registry
fname = self._ginac_name if self._ginac_name is not None else self._name
self._serial = find_registered_function(fname, self._nargs)
return bool(get_sfunction_from_serial(self._serial))

cdef _register_function(self):
from .expression import register_or_update_function

# We don't need to add anything to GiNaC's function registry
# However, if any custom methods were provided in the python class,
# we should set the properties of the function_options object
Expand Down Expand Up @@ -1097,8 +1094,6 @@ cdef class BuiltinFunction(Function):
sage: loads(dumps(cot)) == cot # trac #15138
True
"""
from .expression import find_registered_function, get_sfunction_from_serial

# check if already defined
cdef unsigned int serial

Expand Down Expand Up @@ -1196,8 +1191,6 @@ cdef class SymbolicFunction(Function):
evalf_params_first)

cdef _is_registered(SymbolicFunction self):
from .expression import get_sfunction_from_hash

# see if there is already a SymbolicFunction with the same state
cdef long myhash = self._hash_()
cdef SymbolicFunction sfunc = get_sfunction_from_hash(myhash)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/symbolic/getitem_impl.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ cdef class OperandsWrapper(SageObject):
TESTS::
sage: (x^2).op.__reduce__()
(<cyfunction restore_op_wrapper at ...>, (x^2,))
(<built-in function restore_op_wrapper>, (x^2,))
sage: loads(dumps((x^2).op))
Operands of x^2
"""
Expand Down
7 changes: 2 additions & 5 deletions src/sage/symbolic/ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ from sage.structure.coerce cimport is_numpy_type
import sage.rings.abc
from sage.rings.integer_ring import ZZ

# is_SymbolicVariable used to be defined here; re-export it here lazily
cpdef bint is_SymbolicVariable(x):
from sage.symbolic.expression import _is_SymbolicVariable

return _is_SymbolicVariable(x)
# is_SymbolicVariable used to be defined here; re-export it
from sage.symbolic.expression import _is_SymbolicVariable as is_SymbolicVariable

import keyword
import operator
Expand Down
6 changes: 3 additions & 3 deletions src/sage_docbuild/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sage_docbuild.ext.inventory_builder',
'sage_docbuild.ext.multidocs',
'sage_docbuild.ext.sage_autodoc',
'sphinx.ext.todo',
'sphinx.ext.extlinks',
'sphinx.ext.mathjax',
'sage_docbuild.ext.sage_autodoc',
'sage_docbuild.ext.inventory_builder',
'sage_docbuild.ext.multidocs',
'IPython.sphinxext.ipython_directive',
'matplotlib.sphinxext.plot_directive',
'jupyter_sphinx',
Expand Down
5 changes: 0 additions & 5 deletions src/sage_setup/cython_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ def compiler_directives(profile: bool):
auto_pickle=False,
# Do not create __test__ dictionary automatically from docstrings
autotestdict=False,
# When enabled, functions will bind to an instance when looked up as a
# class attribute (hence the name) and will emulate the attributes of
# Python functions, including introspections like argument names and
# annotations
binding=True,
# Do not check for division by 0 (this is about 35% quicker than with check)
cdivision=True,
# Embed a textual copy of the call signature in the docstring (to support tools like IPython)
Expand Down

0 comments on commit 3e917a4

Please sign in to comment.