Open flrs opened 5 years ago
do you have any suggestions for which portion of the code would be most helpful if we were to add type hinting?
Hi @amirothman,
I think type hinting could be useful for all blending functions. For example:
Could be transformed to something like
def normal(
img_in: np.ndarray,
img_layer: np.ndarray,
opacity: float,
disable_type_checks: bool = False):
It may be beneficial to be clearer about what kind of numpy arrays we expect, since there are some restrictions:
It could be worth exploring solutions like https://github.com/ramonhagenaars/nptyping, since I don't think numpy type hints are supported by Python natively at this point.
We should add type hints to improve clarity regarding inputs and outputs.