You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of the software sustainability hackathon, efforts are ongoing to make CIL easier to use for users and developers.
This issue is focused on improving the python code documentation with Numpy-style docstrings, modern python typehinting, and following a standard format for class structure.
If the function has typehints, omit type hinting from the docstring:
def__init__(self, input:AcquisitionData, image_geometry:Optional[ImageGeometry]=None, backend="tigre"):
"""Abstract class for a tomographic reconstructor. Parameters ---------- input Input data for reconstruction image_geometry Image geometry of input data, by default None backend Engine backend used for reconstruction, by default "tigre" Raises ------ TypeError Raised if input data is not an AcquisitionData class """
Private functions do not need to be documented (they are for developer internal use)
Class Structure (basically an inverse of c):
__init__
Init is first due to its documentation existing in the class's docstring, and properties may be large
Properties
Static functions
Functions
Private functions
Special functions (__str__())
Use " for strings (May change later on, but uniformity is good)
There are still ongoing talks for enforcing a code style with a formatter, as
such this issue ignores code style, and focuses on class order and doc comments.
Note: this change doesn't include functional changes that have been discussed:
As part of the software sustainability hackathon, efforts are ongoing to make CIL easier to use for users and developers.
This issue is focused on improving the python code documentation with Numpy-style docstrings, modern python typehinting, and following a standard format for class structure.
'Standards' followed:
__init__
__str__()
)"
for strings (May change later on, but uniformity is good)from cil.framework.recon import Reconstructor
->from .Reconstructor import Reconstructor
to fix circular packaging issues Remove Reconstructor from __init__ to prevent circular dependency #1681There are still ongoing talks for enforcing a code style with a formatter, as
such this issue ignores code style, and focuses on class order and doc comments.
Note: this change doesn't include functional changes that have been discussed:
out
if passed in, notNone
don'treturn None
whenout
is specified #1657Progress:
cil/
plugins/astra
classes #1697recon
classes #1685The text was updated successfully, but these errors were encountered: