DESC
DESC copied to clipboard
Surfaces can compute more than they should
We have things in the list of variables that we say we can compute on certain objects, but shouldn't be able. One could be misled that a quantity not typically associated with their surface was computed somehow by integrating on the boundary, or just by sampling the given surface.
If a quantity cannot be computed on an object, we should just not have a compute function for that object instead of setting dummy zero values.
Stetting dummy values causes bugs. For example n_rho defined as $\nabla \rho / \Vert \nabla \rho \Vert$ should not be defined on a ZernikeRZToroidalSection. But we say it is, and give it a dummy value of 0. Now, the area of that cross-section is well-defined, however we compute that area using n_rho, and since that dependency is a dummy for this surface, it shouldn't give the correct value.
Remove @pytest.mark.xfail(reason="GitHub issue 1127.") from tests/test_configuration.py::TestGetSurfaces::test_get_zeta_surface once resolved.
Fix for this is to remove the Surface level implementations of the compute quantities in question, and implement them only for the subclasses that actually make sense
Note discussed in dev meeting: if redesigning to propagate nan for quantities that can't be computed, then make sure surface_integral class doesn't mask out all nan quantities. Just mask out nan on the axis.
Would resolution of this issue make sense to happen on #1094 ? @unalmis
Either there or separate is fine
I think I will do it separate for now. That branch still has some things that have to be fixed it seems and it requires this to be done anyways
I have a PR I think addressing this now. Basically,
- For "desc.geometry.surface.FourierRZToroidalSurface" , the radial derivative is undefined (is a constant rho surface so has no notion of how things change off-surface), so any $\partial_{\rho}$ quantity is now undefined
- also has its own implementation of
n_rhowhich has no axis limit defined (avoiding errors from the data index when it tried to buildn_rhodependencies for the surface, and saw that the surface has no radial deriv defined which are needed for the axis limit ofn_rho
- also has its own implementation of
"desc.geometry.surface.ZernikeRZToroidalSection" , the toroidal derivative is undefined (is a constant zeta surface so has no notion of how things change off-surface), so any $\partial_{\zeta}$ quantity is now undefined
- I also added a differente
perimeter(z)implementation that is actually at constantzeta, not constantphi, as it makes no sense to ask for the perimeter at constantphiof aZernikeRZToroidalSectionthat maybe has nonzeroomega, as it is defined only at constantzeta
"desc.geometry.core.Surface" parametrization is only used for quantities well-defined by both of the above subclasses (basically only things that need no derivs or theta derivs only)