Opened 4 years ago

Closed 4 years ago

#24048 closed enhancement (fixed)

Unify selfdual and self_dual

Reported by: jmantysalo Owned by:
Priority: minor Milestone: sage-8.1
Component: misc Keywords:
Cc: tscrim Merged in:
Authors: Jori Mäntysalo Reviewers: Travis Scrimshaw, David Roe
Report Upstream: N/A Work issues:
Branch: b3faa90 (Commits, GitHub, GitLab) Commit: b3faa90d2e2b7bd6f8a90c86034eb0cc8c1a2a32
Dependencies: Stopgaps:

Status badges

Description (last modified by jmantysalo)

This patch will change is_selfdual to is_self_dual in finite posets, so that the naming will be same as in linear codes.

Change History (19)

comment:1 Changed 4 years ago by roed

  • Component changed from PLEASE CHANGE to coding theory
  • Description modified (diff)

I don't know that much about the math involved here, but how are these examples comparable?

comment:2 follow-up: Changed 4 years ago by tscrim

Jori, is this a matter of code output or method name? If it is the latter, then I would say is_self_dual because otherwise it looks like there is a word "selfdual," which there is not.

comment:3 in reply to: ↑ 2 Changed 4 years ago by jmantysalo

Replying to tscrim:

Jori, is this a matter of code output or method name? If it is the latter, then I would say is_self_dual because otherwise it looks like there is a word "selfdual," which there is not.

Sorry for being unclear. It was the method name I wondered.

I'll make a patch to change the name of function of finite posets.

comment:4 Changed 4 years ago by jmantysalo

  • Branch set to u/jmantysalo/self_dual

comment:5 Changed 4 years ago by roed

  • Commit set to 0d6e5a9d4dab2d4397b29725a83098588a3050fa

Oh, I see. I agree that it should be self_dual rather than selfdual.


New commits:

0d6e5a9selfdual -> self_dual

comment:6 Changed 4 years ago by roed

I think is_self_dual = deprecated_function_alias(is_selfdual, 24048) should be is_selfdual = deprecated_function_alias(24048, is_self_dual).

comment:7 Changed 4 years ago by tscrim

I would also put the alias declaration below the method declaration (it makes me less worried as a programmer). Once done, and if in a (undeclared) needs review state and doctests pass, positive review.

comment:8 Changed 4 years ago by git

  • Commit changed from 0d6e5a9d4dab2d4397b29725a83098588a3050fa to af411591f3745fc19eeab7f736f5e20396aa2e9a

Branch pushed to git repo; I updated commit sha1. New commits:

af41159Corrections.

comment:9 Changed 4 years ago by jmantysalo

  • Authors set to Jori Mäntysalo
  • Component changed from coding theory to misc
  • Description modified (diff)
  • Status changed from new to needs_review

You are both right: I did the deprecation line wrong, and also put it in wrong place.

There was also two places more to change, but now everything should work.

comment:10 Changed 4 years ago by tscrim

  • Reviewers set to Travis Scrimshaw, David Roe
  • Status changed from needs_review to positive_review

Tests pass for me. Positive review.

comment:11 Changed 4 years ago by fbissey

Well I believe this test failure originates here

sage -t --long --warn-long 73.3 /usr/lib64/python2.7/site-packages/sage/tests/finite_poset.py
**********************************************************************
File "/usr/lib64/python2.7/site-packages/sage/tests/finite_poset.py", line 144, in sage.tests.finite_poset.test_finite_lattice
Failed example:
    test_finite_lattice(L) is None  # Long time
Expected:
    True
Got:
    doctest:warning
      File "/usr/lib/python-exec/python2.7/sage-runtests", line 103, in <module>
        err = DC.run()
      File "/usr/lib64/python2.7/site-packages/sage/doctest/control.py", line 1093, in run
        self.run_doctests()
      File "/usr/lib64/python2.7/site-packages/sage/doctest/control.py", line 822, in run_doctests
        self.dispatcher.dispatch()
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1777, in dispatch
        self.parallel_dispatch()
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1667, in parallel_dispatch
        w.start()  # This might take some time
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1943, in start
        super(DocTestWorker, self).start()
      File "/usr/lib64/python2.7/multiprocessing/process.py", line 130, in start
        self._popen = Popen(self)
      File "/usr/lib64/python2.7/multiprocessing/forking.py", line 126, in __init__
        code = process_obj._bootstrap()
      File "/usr/lib64/python2.7/multiprocessing/process.py", line 267, in _bootstrap
        self.run()
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1916, in run
        task(self.options, self.outtmpfile, msgpipe, self.result_queue)
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 2218, in __call__
        result = runner.run(test)
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 663, in run
        return self._run(test, compileflags, out)
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 518, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 888, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.tests.finite_poset.test_finite_lattice[2]>", line 1, in <module>
        test_finite_lattice(L) is None  # Long time
      File "/usr/lib64/python2.7/site-packages/sage/tests/finite_poset.py", line 161, in test_finite_lattice
        P = {x: test_attrcall('is_'+x, L) for x in all_props}
      File "/usr/lib64/python2.7/site-packages/sage/tests/finite_poset.py", line 161, in <dictcomp>
        P = {x: test_attrcall('is_'+x, L) for x in all_props}
      File "/usr/lib64/python2.7/site-packages/sage/tests/finite_poset.py", line 117, in test_attrcall
        return attrcall(name)(L)
      File "/usr/lib64/python2.7/site-packages/sage/misc/misc.py", line 1640, in __call__
        return getattr(x, self.name)(*(self.args+args), **self.kwds)
      File "/usr/lib64/python2.7/site-packages/sage/misc/superseded.py", line 417, in __call__
        "%s is deprecated. Please use %s instead."%(self.__name__, other))
      File "/usr/lib64/python2.7/site-packages/sage/misc/superseded.py", line 101, in deprecation
        warning(trac_number, message, DeprecationWarning, stacklevel)
      File "/usr/lib64/python2.7/site-packages/sage/misc/superseded.py", line 142, in warning
        warn(message, warning_class, stacklevel)
    :
    DeprecationWarning: is_selfdual is deprecated. Please use is_self_dual instead.
    See http://trac.sagemath.org/24048 for details.
    True
**********************************************************************

the warning gets in the way.

comment:12 Changed 4 years ago by tscrim

  • Status changed from positive_review to needs_work

Indeed it does (also confirmed by the patchbots).

comment:13 Changed 4 years ago by git

  • Commit changed from af411591f3745fc19eeab7f736f5e20396aa2e9a to b3faa90d2e2b7bd6f8a90c86034eb0cc8c1a2a32

Branch pushed to git repo; I updated commit sha1. New commits:

b3faa90Correct a test.

comment:14 follow-up: Changed 4 years ago by jmantysalo

  • Status changed from needs_work to needs_review

Good catch, my grep did not found that. Corrected.

comment:15 in reply to: ↑ 14 Changed 4 years ago by fbissey

  • Status changed from needs_review to positive_review

Replying to jmantysalo:

Good catch, my grep did not found that. Corrected.

Yes it passes now.

comment:16 Changed 4 years ago by jmantysalo

Thanks!

(English language needs some unification too... ;=) For example "Railway station" -- why not "rail way station" or "railwaystation"? In Finnish it is "rautatieasema".)

comment:17 follow-up: Changed 4 years ago by vbraun

  • Status changed from positive_review to needs_work
sage -t --long --warn-long 67.5 src/sage/tests/finite_poset.py
**********************************************************************
File "src/sage/tests/finite_poset.py", line 144, in sage.tests.finite_poset.test_finite_lattice
Failed example:
    test_finite_lattice(L) is None  # Long time
Expected:
    True
Got:
    doctest:warning
      File "/mnt/disk/home/release/Sage/src/bin/sage-runtests", line 125, in <module>
        err = DC.run()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 1144, in run
        self.run_doctests()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 872, in run_doctests
        self.dispatcher.dispatch()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1774, in dispatch
        self.parallel_dispatch()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1664, in parallel_dispatch
        w.start()  # This might take some time
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1940, in start
        super(DocTestWorker, self).start()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/multiprocessing/process.py", line 130, in start
        self._popen = Popen(self)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__
        code = process_obj._bootstrap()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
        self.run()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1913, in run
        task(self.options, self.outtmpfile, msgpipe, self.result_queue)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 2215, in __call__
        result = runner.run(test)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 660, in run
        return self._run(test, compileflags, out)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 515, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 885, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.tests.finite_poset.test_finite_lattice[2]>", line 1, in <module>
        test_finite_lattice(L) is None  # Long time
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/tests/finite_poset.py", line 161, in test_finite_lattice
        P = {x: test_attrcall('is_'+x, L) for x in all_props}
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/tests/finite_poset.py", line 161, in <dictcomp>
        P = {x: test_attrcall('is_'+x, L) for x in all_props}
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/tests/finite_poset.py", line 117, in test_attrcall
        return attrcall(name)(L)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/misc.py", line 1640, in __call__
        return getattr(x, self.name)(*(self.args+args), **self.kwds)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/superseded.py", line 417, in __call__
        "%s is deprecated. Please use %s instead."%(self.__name__, other))
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/superseded.py", line 101, in deprecation
        warning(trac_number, message, DeprecationWarning, stacklevel)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/superseded.py", line 142, in warning
        warn(message, warning_class, stacklevel)
    :
    DeprecationWarning: is_selfdual is deprecated. Please use is_self_dual instead.
    See http://trac.sagemath.org/24048 for details.
    True
**********************************************************************
1 item had failures:
   1 of   4 in sage.tests.finite_poset.test_finite_lattice
    [7 tests, 1 failure, 0.83 s]

comment:18 in reply to: ↑ 17 Changed 4 years ago by fbissey

  • Status changed from needs_work to positive_review

Replying to vbraun:

sage -t --long --warn-long 67.5 src/sage/tests/finite_poset.py
**********************************************************************
File "src/sage/tests/finite_poset.py", line 144, in sage.tests.finite_poset.test_finite_lattice
Failed example:
    test_finite_lattice(L) is None  # Long time
Expected:
    True
Got:
    doctest:warning
      File "/mnt/disk/home/release/Sage/src/bin/sage-runtests", line 125, in <module>
        err = DC.run()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 1144, in run
        self.run_doctests()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/control.py", line 872, in run_doctests
        self.dispatcher.dispatch()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1774, in dispatch
        self.parallel_dispatch()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1664, in parallel_dispatch
        w.start()  # This might take some time
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1940, in start
        super(DocTestWorker, self).start()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/multiprocessing/process.py", line 130, in start
        self._popen = Popen(self)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__
        code = process_obj._bootstrap()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
        self.run()
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1913, in run
        task(self.options, self.outtmpfile, msgpipe, self.result_queue)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 2215, in __call__
        result = runner.run(test)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 660, in run
        return self._run(test, compileflags, out)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 515, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 885, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.tests.finite_poset.test_finite_lattice[2]>", line 1, in <module>
        test_finite_lattice(L) is None  # Long time
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/tests/finite_poset.py", line 161, in test_finite_lattice
        P = {x: test_attrcall('is_'+x, L) for x in all_props}
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/tests/finite_poset.py", line 161, in <dictcomp>
        P = {x: test_attrcall('is_'+x, L) for x in all_props}
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/tests/finite_poset.py", line 117, in test_attrcall
        return attrcall(name)(L)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/misc.py", line 1640, in __call__
        return getattr(x, self.name)(*(self.args+args), **self.kwds)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/superseded.py", line 417, in __call__
        "%s is deprecated. Please use %s instead."%(self.__name__, other))
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/superseded.py", line 101, in deprecation
        warning(trac_number, message, DeprecationWarning, stacklevel)
      File "/mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/superseded.py", line 142, in warning
        warn(message, warning_class, stacklevel)
    :
    DeprecationWarning: is_selfdual is deprecated. Please use is_self_dual instead.
    See http://trac.sagemath.org/24048 for details.
    True
**********************************************************************
1 item had failures:
   1 of   4 in sage.tests.finite_poset.test_finite_lattice
    [7 tests, 1 failure, 0.83 s]

Already reported and fixed. May be I should have left it in "needs_work" for a bit longer for you to see.

comment:19 Changed 4 years ago by vbraun

  • Branch changed from u/jmantysalo/self_dual to b3faa90d2e2b7bd6f8a90c86034eb0cc8c1a2a32
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.