I have checked again if this code is still required (with my changes in PR 1969) and it turns out it is never executed. Therefore, I removed this code from the SymPyDocTestFinder.
Regards Thomas On Sun, Apr 7, 2013 at 2:03 AM, Aaron Meurer <[email protected]> wrote: > According to the comment, the issue is from decorated functions. If > all the decorators use @wraps, does this problem not happen? > > Aaron Meurer > > On Thu, Apr 4, 2013 at 5:08 AM, Thomas Hisch <[email protected]> wrote: >> For the following functions/modules the regex in >> >> if not in_module: >> # double check in case this function is decorated >> # and just appears to come from a different module. >> pat = r'\s*(def|class)\s+%s\s*\(' % rawname >> PAT = pre.compile(pat) >> in_module = any( >> PAT.match(line) for line in source_lines) >> >> matches. (If I remove this code all doctests still pass) Is this code >> still required ? >> >> regards >> thomas >> >> <function integrate at 0x17e4140> <module 'sympy.stats.crv' from >> 'sympy/stats/crv.pyc'> >> conjugate <module 'sympy.matrices.expressions.matexpr' from >> 'sympy/matrices/expressions/matexpr.pyc'> >> Dagger <module 'sympy.matrices.expressions.matexpr' from >> 'sympy/matrices/expressions/matexpr.pyc'> >> transpose <module 'sympy.matrices.expressions.matexpr' from >> 'sympy/matrices/expressions/matexpr.pyc'> >> transpose <module 'sympy.matrices.expressions.blockmatrix' from >> 'sympy/matrices/expressions/blockmatrix.pyc'> >> <function runs at 0xb1ba28> <module 'sympy.combinatorics.permutations' >> from 'sympy/combinatorics/permutations.pyc'> >> gamma <module 'sympy.simplify.hyperexpand' from >> 'sympy/simplify/hyperexpand.pyc'> >> <function diff at 0xe5b668> <module >> 'sympy.physics.mechanics.essential' from >> 'sympy/physics/mechanics/essential.pyc'> >> <type 'numpy.ndarray'> <module 'sympy.physics.quantum.matrixutils' >> from 'sympy/physics/quantum/matrixutils.pyc'> >> <class 'scipy.sparse.base.spmatrix'> <module >> 'sympy.physics.quantum.matrixutils' from >> 'sympy/physics/quantum/matrixutils.pyc'> >> <class 'sympy.matrices.expressions.matmul.MatMul'> <module >> 'sympy.assumptions.handlers.matrices' from >> 'sympy/assumptions/handlers/matrices.pyc'> >> <type 'itertools.combinations'> <module 'sympy.core.compatibility' >> from 'sympy/core/compatibility.pyc'> >> <type 'itertools.product'> <module 'sympy.core.compatibility' from >> 'sympy/core/compatibility.pyc'> >> <type 'itertools.permutations'> <module 'sympy.core.compatibility' >> from 'sympy/core/compatibility.pyc'> >> <type 'itertools.combinations_with_replacement'> <module >> 'sympy.core.compatibility' from 'sympy/core/compatibility.pyc'> >> <function copy at 0x73e5f0> <module 'sympy.core.basic' from >> 'sympy/core/basic.pyc'> >> <function dup_inner_isolate_positive_roots at 0x10cded8> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_sturm at 0x10cd9b0> <module 'sympy.polys.compatibility' >> from 'sympy/polys/compatibility.pyc'> >> <function dup_root_lower_bound at 0x10cdaa0> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_isolate_real_roots at 0x10ec140> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_root_upper_bound at 0x10cda28> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_inner_refine_real_root at 0x10cdc80> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_count_complex_roots at 0x10ec5f0> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_isolate_complex_roots_sqf at 0x10ec848> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_step_refine_real_root at 0x10cdc08> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_inner_isolate_negative_roots at 0x10cdf50> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_refine_real_root at 0x10cdd70> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_isolate_real_roots_list at 0x10ec1b8> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_isolate_real_roots_sqf at 0x10ec0c8> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_outer_refine_real_root at 0x10cdcf8> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_isolate_all_roots at 0x10ec938> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_count_real_roots at 0x10ec320> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_inner_isolate_real_roots at 0x10cdde8> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> <function dup_isolate_all_roots_sqf at 0x10ec8c0> <module >> 'sympy.polys.compatibility' from 'sympy/polys/compatibility.pyc'> >> >> On Thu, Apr 4, 2013 at 2:37 AM, Aaron Meurer <[email protected]> wrote: >>> Hmm, probably not. I'm finding more and more excuses to drop Python >>> 2.5 support, though. Maybe we should push out just one more release >>> that supports it. >>> >>> Aaron Meurer >>> >>> On Wed, Apr 3, 2013 at 5:34 PM, Thomas Hisch <[email protected]> wrote: >>>> >>>> On Apr 4, 2013 1:08 AM, "Aaron Meurer" <[email protected]> wrote: >>>>> >>>>> Yeah, this is a bug, apparently due to poor parsing of the files. The >>>>> perfect way would be to parse using ast or something similar. >>>> >>>> Do you think that the functionality of the ast module required for our >>>> doc/unittester is also available on py2.5? >>>> >>>>> >>>>> Aaron Meurer >>>>> >>>>> On Wed, Apr 3, 2013 at 4:40 PM, Thomas Hisch <[email protected]> wrote: >>>>> > Commenting out the following lines in runtests.py solves my problem >>>>> > (BTW all doctests still pass) >>>>> > >>>>> > >>>>> > pat = r'\s*(def|class)\s+%s\s*\(' % rawname >>>>> > PAT = pre.compile(pat) >>>>> > in_module = any(PAT.match(line) for line in source_lines) >>>>> > >>>>> > regards >>>>> > thomas >>>>> > >>>>> > On Wed, Apr 3, 2013 at 11:34 PM, thomas hisch <[email protected]> wrote: >>>>> >> On Wednesday, April 3, 2013 11:28:11 PM UTC+2, thomas hisch wrote: >>>>> >>> >>>>> >>> >>>>> >>> >>>>> >>> On Wednesday, April 3, 2013 11:07:59 PM UTC+2, Stefan Krastanov wrote: >>>>> >>>> >>>>> >>>> I may be wrong, but I think the main reason to test docstrings and >>>>> >>>> especially the examples folder is to ensure that the documentation is >>>>> >>>> correct and up to date. >>>>> >>> >>>>> >>> >>>>> >>> This makes sense, but in the case of fem.py, which does not contain >>>>> >>> any >>>>> >>> docstrings, no doctests should be executed. Is this correct? >>>>> >>> >>>>> >>> >>>>> >> >>>>> >> Consider this examples which is a stripped down version of fem.py and >>>>> >> demonstates the problem >>>>> >> >>>>> >> >>>>> >> from sympy import integrate >>>>> >> >>>>> >> class ReferenceSimplex(object): >>>>> >> def integrate(self): >>>>> >> pass >>>>> >> >>>>> >> Doctesting this file triggers the doctest of the integrate method in >>>>> >> sympy/integrals. However, If I replace the name of the 'integrate' >>>>> >> method in >>>>> >> ReferenceSimplex by, e.g., 'integrate2' then no doctests are run. This >>>>> >> is >>>>> >> clearly a bug in sympydoctestfinder >>>>> >> >>>>> >>>> >>>>> >>>> >>>>> >>>> The unit tests as in "TDD" are in the test folders. >>>>> >> >>>>> >> -- >>>>> >> You received this message because you are subscribed to a topic in the >>>>> >> Google Groups "sympy" group. >>>>> >> To unsubscribe from this topic, visit >>>>> >> >>>>> >> https://groups.google.com/d/topic/sympy/8dC1XJAIvQg/unsubscribe?hl=en-US. >>>>> >> To unsubscribe from this group and all its topics, send an email to >>>>> >> [email protected]. >>>>> >> To post to this group, send email to [email protected]. >>>>> >> Visit this group at http://groups.google.com/group/sympy?hl=en-US. >>>>> >> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >> >>>>> >> >>>>> > >>>>> > -- >>>>> > You received this message because you are subscribed to the Google >>>>> > Groups "sympy" group. >>>>> > To unsubscribe from this group and stop receiving emails from it, send >>>>> > an email to [email protected]. >>>>> > To post to this group, send email to [email protected]. >>>>> > Visit this group at http://groups.google.com/group/sympy?hl=en-US. >>>>> > For more options, visit https://groups.google.com/groups/opt_out. >>>>> > >>>>> > >>>>> >>>>> -- >>>>> You received this message because you are subscribed to a topic in the >>>>> Google Groups "sympy" group. >>>>> To unsubscribe from this topic, visit >>>>> https://groups.google.com/d/topic/sympy/8dC1XJAIvQg/unsubscribe?hl=en-US. >>>>> To unsubscribe from this group and all its topics, send an email to >>>>> [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at http://groups.google.com/group/sympy?hl=en-US. >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "sympy" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/sympy?hl=en-US. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "sympy" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/sympy/8dC1XJAIvQg/unsubscribe?hl=en-US. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/sympy?hl=en-US. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/sympy?hl=en-US. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > You received this message because you are subscribed to a topic in the Google > Groups "sympy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sympy/8dC1XJAIvQg/unsubscribe?hl=en-US. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy?hl=en-US. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
