We currently have operators (not just differential operators, but also functions that set valid data and boundary conditions) that often expect an out argument, which is modified by the operator. This made a lot of sense when we only targeted numba, but this paradigm is not supported by torch or jax, so we need to change our approach. To avoid having different call-signatures depending on backend, it might be best to convert all operators such that they return their result. Examples include:
field_lap = laplace(field)
field_w_bc = set_bcs(field)
field_full = set_valid(field_valid)
field_valid = get_valid(field_full)
We can still (optionally) accept an out argument, which might be helpful for numba, but this should not be required.
Unfortunately, this change will likely break backward compatibility, but this might be necessary. The upside is that this approach is likely much easier to use for people new to the package.
We currently have operators (not just differential operators, but also functions that set valid data and boundary conditions) that often expect an
outargument, which is modified by the operator. This made a lot of sense when we only targetednumba, but this paradigm is not supported bytorchorjax, so we need to change our approach. To avoid having different call-signatures depending on backend, it might be best to convert all operators such that they return their result. Examples include:We can still (optionally) accept an
outargument, which might be helpful fornumba, but this should not be required.Unfortunately, this change will likely break backward compatibility, but this might be necessary. The upside is that this approach is likely much easier to use for people new to the package.