-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor surface
and curve
compute methods
#583
Conversation
surface
and curve
compute methods
@@ -22,6 +22,34 @@ def _V(params, transforms, profiles, data, **kwargs): | |||
return data | |||
|
|||
|
|||
@register_compute_fun( | |||
name="V", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now there are two difference compute functions both with the name "V"
. I'm confused about when one is called over the other. Does this new one only get called for FourierRZToroidalSurface
, and the original one gets called for all other classes? But this new one is actually more general, where as the original one will only work for an Equilibrium
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the new compute function is valid in all use cases, can we replace the old one instead of having two different functions that compute the same quantity?
If we need to keep both implementations, we should add a test to check them against each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new one is more general and could replace the old one, I'll make that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually its a bit tricky. The new compute function is only correct if the grid has nodes along the LCFS, while the original one assumes quadrature nodes in the volume, which genreally are a bit short of the LCFS. in eq.compute
we use a quadrature grid to compute everything with dim==0
, but that will give an incorrect result with the new compute method (Surface.compute
uses a linear grid so its correct using the new method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. It still seems messy to have redundant compute methods. Should we add a parameterization
to the old method to specify it works for Equilibrium
? We need something to document when to use one over the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default parameterization is Equilibrium unless otherwise specified. I don't think its much of an issue since users will never really interact with these functions directly.
I noticed a couple things
|
I dont think there are any broadcasting issues, since everything for curves and surfaces is either a scalar or a function over the whole curve/surface, so everything should work fine. |
Right, but if length is computed with a N=0 grid, it will be completely incorrect right? |
Ah OK i see what you mean. Like how we always compute volume on a quadrature grid and profiles on a linear grid, then seed the data dictionary with those values. I can do something similar for curves/surfaces |
- Switch test marked regression to unit for same reason as git commit 44f2877 - Remove unneded test for limits with fix iota
compute_coordinates
,compute_normal
etc ofCurve
andSurface
objects with a genericcompute
method similar to the one used in theEquilibrium
class.desc.compute
infrastructure with new classes and reduces duplicated code.grid
andtransform
attributes fromCurve
andSurface
classes, these are now built on the fly in thecompute
method.FourierXYZCurve
now has seperate basis for X, Y, Z for consistency with other classes.Resolves #559