Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-9182

Cleanup pybind11 code in afw

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      DRP S17-3, DRP S17-4
    • Team:
      Data Release Production

      Description

      Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have not looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

      First, a list of generic issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:

      • Move trivial Python extensions to C++.
      • Use continueClass decorator in remaining Python files.
      • Reorganize/rename files as per RFC.
      • Address any TODOs
      • Remove commented-out headers.
      • Make sure pybind11 header is included first (because Python.h needs to be included first).
      • Remove (or otherwise address) commented-out code
      • Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
      • Make sure all functions that should have kwargs do.
      • Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
      • Make sure shared_ptr holder type is used for all but trivial classes
      • Look for comment headings that are unused or disrupt readability
      • Make sure py::is_operator is used on binary, non-in-place operators, and is not used anywhere else.
      • Look for lambdas with non-const reference arguments; could they be const references?
      • Look for getters that should be using reference_internal
      • Remove spurious (empty) wrapper files.
      • Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
      • Check for anonymous namespace and `static` usage.
      • Check for worthless module docstrings.
      • Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
      • Don't use ::Ptr (here, or anywhere).
      • Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
      • Delete trailing whitespace.

        Attachments

          Issue Links

            Activity

            No builds found.
            jbosch Jim Bosch created issue -
            jbosch Jim Bosch made changes -
            Field Original Value New Value
            Epic Link DM-7717 [ 26925 ]
            jbosch Jim Bosch made changes -
            Link This issue is triggered by DM-9063 [ DM-9063 ]
            jbosch Jim Bosch made changes -
            Link This issue is blocked by DM-9099 [ DM-9099 ]
            jbosch Jim Bosch made changes -
            Link This issue blocks DM-9100 [ DM-9100 ]
            jbosch Jim Bosch made changes -
            Description Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Look for comment headings that are unused or disrupt readability
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Look for returning 'this', especially in in-place operators - make sure call policy is correct.
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Make sure shared_ptr holder type is used for all but trivial classes
            - Look for comment headings that are unused or disrupt readability
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Look for returning 'this', especially in in-place operators - make sure call policy is correct.
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            Hide
            jbosch Jim Bosch added a comment -

            Starting this mostly to provide some clean examples for RFC-281; will move to the back burner again when I've made enough progress for that.

            Show
            jbosch Jim Bosch added a comment - Starting this mostly to provide some clean examples for RFC-281 ; will move to the back burner again when I've made enough progress for that.
            jbosch Jim Bosch made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            jbosch Jim Bosch made changes -
            Description Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Make sure shared_ptr holder type is used for all but trivial classes
            - Look for comment headings that are unused or disrupt readability
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Look for returning 'this', especially in in-place operators - make sure call policy is correct.
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Make sure shared_ptr holder type is used for all but trivial classes
            - Look for comment headings that are unused or disrupt readability
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            jbosch Jim Bosch made changes -
            Description Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Make sure shared_ptr holder type is used for all but trivial classes
            - Look for comment headings that are unused or disrupt readability
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Make sure shared_ptr holder type is used for all but trivial classes
            - Look for comment headings that are unused or disrupt readability
            - Make sure {{py::is_operator}} is used on binary, non-in-place operators, and is not used anywhere else.
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            jbosch Jim Bosch made changes -
            Description Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Make sure shared_ptr holder type is used for all but trivial classes
            - Look for comment headings that are unused or disrupt readability
            - Make sure {{py::is_operator}} is used on binary, non-in-place operators, and is not used anywhere else.
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            Following the review of DM-9063, I've put together a list of fixes to make for most of afw and its dependencies, which I have attached to the ticket. I have *not* looked at afw::table, as that will be reviewed and fixed independently on DM-8716.

            First, a list of *generic* issues that weren't worth capturing on a file-by-file basis (though I did start by doing that). This is essentially a checklist that should be used by all pybind11 cleanup issues:
            - Move trivial Python extensions to C++.
            - Use continueClass decorator in remaining Python files.
            - Reorganize/rename files as per RFC.
            - Address any TODOs
            - Remove commented-out headers.
            - Make sure pybind11 header is included first (because Python.h needs to be included first).
            - Remove (or otherwise address) commented-out code
            - Remove any use of ndarray/converters.h (redundant with ndarray/pybind11.h)
            - Make sure all functions that should have kwargs do.
            - Replace py::arg("foo") with "foo"_a (with using pybind11::literals)
            - Make sure shared_ptr holder type is used for all but trivial classes
            - Look for comment headings that are unused or disrupt readability
            - Make sure {{py::is_operator}} is used on binary, non-in-place operators, and is not used anywhere else.
            - Look for lambdas with non-const reference arguments; could they be const references?
            - Look for getters that should be using reference_internal
            - Remove spurious (empty) wrapper files.
            - Determine whether enums are used as enums or integer constants, and adjust wrappers accordingly.
            - Check for anonymous namespace and `static` usage.
            - Check for worthless module docstrings.
            - Define typedefs for py::class_ instantiations, or otherwise ensure they're not repeated.
            - Don't use ::Ptr (here, or anywhere).
            - Run clang-format? Some of indentation is really terrible at definitely not conformant, and clang-format improves it.
            - Delete trailing whitespace.

            swinbank John Swinbank made changes -
            Sprint DRP S17-3 [ 360 ] DRP S17-3, DRP S17-4 [ 360, 363 ]
            swinbank John Swinbank made changes -
            Rank Ranked higher
            pschella Pim Schellart [X] (Inactive) made changes -
            Component/s daf_persistence [ 10713 ]
            Component/s utils [ 10723 ]
            Component/s pex_exceptions [ 10728 ]
            Component/s daf_base [ 10756 ]
            pschella Pim Schellart [X] (Inactive) made changes -
            Summary Cleanup pybind11 code in afw and its dependencies Cleanup pybind11 code in afw
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            Moved dependencies to DM-9701.

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - Moved dependencies to DM-9701 .
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            Merged, so calling this done. Remaining cleanup will be done on separate ticket.

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - Merged, so calling this done. Remaining cleanup will be done on separate ticket.
            pschella Pim Schellart [X] (Inactive) made changes -
            Resolution Done [ 10000 ]
            Status In Progress [ 3 ] Done [ 10002 ]

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              jbosch Jim Bosch
              Watchers:
              Jim Bosch, Pim Schellart [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.