-
Notifications
You must be signed in to change notification settings - Fork 32
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
Compute Grid Centerpoint using Welzl's algorithm #811
Conversation
…centerpoint. Need to use great circle distance and add/fix tests and data types in the algo
…x test case asserts
I'm not a big fan of the Maybe we should consider the following design?
This would make the workflow look something like the following: # get the value of face_lon without needing to specify an algorithm, will use either the stored value or cart avg
uxgrid.face_lon
# I want to explicitly set the algorithm to be Welzl
uxgrid.populate_face_coordinates(method='welzl')
# value will now be populated using your approach
uxgrid.face_lon
# I want to re-populate again using cartesiain averaging
uxgrid.populate_face_coordinates(method='cartesian average')
# value will now be populated using artesian average
uxgrid.face_lon This allows us to not need to define any new properties and to better stick to the UGRID conventions. What do you think? |
…dependency (use with arcs and arcs use coordinates). o Remove new routine in favor of using the existing angle b/w vectors to calculate distance.
During my testing and sometimes in testing the face geometry both centerpoint and centroid might be needed. When working with a mesh I wanted to check how much did one deviate from the other and if one or the other made more sense. We might be able to get both with the way you propose also, but with two calls to We can get another name for |
My main concern with breaking up the different types of coordinates in separate attributes is that it'll add extra overhead for us to ensure that the coordinates we read match the ones that we want to store, not to mention needing to redefine / extent the UGRID conventions further past what we've already done. Even with this (and say some other method down the line), this could end up looking like:
Consider the case where two UGRID (or any other format) grid files are loaded into UXarray. If we move forward with a split attribute approach, we'd need to ensure that the coordinates we are reading either go into I'm still in favor of keeping @paullric @rljacob Is there ever a sceneiro where we would want to have more than one definition of a "center" coordinate attached to a grid at a time? |
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 code looks good to me. The only thing remaining was the reduced code coverage, but apparently codecov can't track test cases written for the njit
-decorated functions. After we figure a path forward with that, I am happy to approve this.
Once, we resolve this circular dependency issue. I will disable NUMBA to check codecov - it might increase the percentage coverage issue |
How about doing this in such a way: In the beginning of each indidvual case that tests a njit-decorated function, disable numba, in the end, enable it back? This helps us notice right away that whenever we see this kind of disable-enable pairs, that is a case for testing a njit-decorated function. |
I removed all the numba stuff on my local and the coverage (85% total and 95% for coordinates.py - see pic below) is considerably higher for sha: |
Co-authored-by: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com>
Co-authored-by: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com>
…to rajeeja/welzl
ASV BenchmarkingBenchmark Comparison ResultsBenchmarks that have improved:
Benchmarks that have stayed the same:
|
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.
Great work!
No description provided.