Opened 4 years ago

Last modified 10 months ago

#17723 new enhancement

primary decomposition: provide a descriptive error message for illegal algorithm choice

Reported by: jakobkroeker Owned by:
Priority: trivial Milestone: sage-6.5
Component: commutative algebra Keywords: primary decomposition error message
Cc: ncohen, gh-tom111 Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage: R.<x,y>=QQ[]
sage: I = R.ideal(x)
sage: I.primary_decomposition("elephants")
---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-3-640b8340fda6> in <module>()
----> 1 I.primary_decomposition("elephants")

/home/kroeker/Projects/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in __call__(self, *args, **kwds)
    603         if not R.base_ring().is_field():
    604             raise ValueError("Coefficient ring must be a field for function '%s'."%(self.f.__name__))
--> 605         return self.f(self._instance, *args, **kwds)
    606 
    607 require_field = RequireField

/home/kroeker/Projects/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in primary_decomposition(self, algorithm)
   1159           York 1993.
   1160         """
-> 1161         return [I for I, _ in self.complete_primary_decomposition(algorithm)]
   1162 
   1163     @require_field

/home/kroeker/Projects/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in __call__(self, *args, **kwds)
    603         if not R.base_ring().is_field():
    604             raise ValueError("Coefficient ring must be a field for function '%s'."%(self.f.__name__))
--> 605         return self.f(self._instance, *args, **kwds)
    606 
    607 require_field = RequireField

/home/kroeker/Projects/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in wrapper(*args, **kwds)
    503         """
    504         with LibSingularDefaultContext():
--> 505             return func(*args, **kwds)
    506     return wrapper
    507 

/home/kroeker/Projects/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.pyc in complete_primary_decomposition(self, algorithm)
   1086 
   1087         R = self.ring()
-> 1088         V = [(R.ideal(X[0]), R.ideal(X[1])) for X in P]
   1089         V = Sequence(V)
   1090         self.__complete_primary_decomposition[algorithm] = V

UnboundLocalError: local variable 'P' referenced before assignment

Change History (2)

comment:1 Changed 4 years ago by ncohen

  • Cc ncohen added

comment:2 Changed 10 months ago by mkoeppe

  • Cc gh-tom111 added
Note: See TracTickets for help on using tickets.