forked from golang/geo
-
Notifications
You must be signed in to change notification settings - Fork 1
Merging latest from golang/geo into blevesearch/geo #24
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sync in the last couple years of fixes and updates to the extenal repo.
* go.mod: Bump version to 1.21 and add go-cmp dep * Insert key names into composite literals, where the type is imported from another package * Fix typos
Export latest google3 version
Add some comments that were being stripped.
Add and reformat comments
Add github action to build and test for all pull requests and commits.
Create go.yml
latlng_test: Add benchmark functions
TestShapeutilRangeIteratorNext: Test sentinel id
s2cell_test: Increase TestCellDistanceToEdge tolerance
CellIDFromString: Remove no-op byte < 0 check
TestPolylineInterpolate: Fix unused `want` var
Some tests are flaky due to the random seed. It's not clear whether the problem is the code or the test. These all need further investigation. Just fix the seed for now so that the tests pass. golang#120
Deflake tests
… amounts used in C++ exact_float (from billions down to millions)
Update comments in Cell. Migrate IJ and ST methods from Cell to stuv.go to more closely resemble C++ file splits. Add missing tests to stuv.go Add new maxXYZToUVError constant Add more tests for InterpolateDistance. Update comments. Add special case in interpolateFloat64. Add SignDotProd and submethods along with associated tests. Add gappa proof comments to predicates for some of the methods. Fix TestCellDistanceToEdge with updated tolerances to reduce test flakiness. (It is now better but still not zero random edges that fail. Still need more digging to resolve.) Initial internal components of polyline_alignment. Implement VertexAlignment and associated tests for PolylineAlignment Add EdgeRaw, VertexRaw to Cell for the unnormalized variations which are needed for some methods in s2 Predicates. Add SignDotProt and CircleEdgeIntersectionOrdering and associated sub methods and tests. Update textformat to support higher precision printout of values for higher fidelity save/load of values. Update related callers and add test to show the change. Update edge_distance with PointOnRay, PointOnLeft, PointOnRight, PointOnLine and related tests. Added commented parts of several existing tests that needed those. Move epsilon to tests since it's not used in the regular s2 code. Add roundingEpsilon and epsilonForDigits and related tests. Use a constant for sqrt(3) instead of recomputing it many many times.
…values. Fix two lint errors.
…lic type. (Step 1 was lax_loop_test.go -> lax_loop.go with type laxLoop converting to public type LaxLoop.) (Step 2 remove lax_loop_test.go to make way for step 3) (Step 3 lax_loop_test_test.go -> lax_loop_test.go to fit traditional conventions.)
…ial public type. (Step 1 was lax_loop_test.go -> lax_loop.go with type laxLoop converting to public type LaxLoop.) (Step 2 was remove lax_loop_test.go to make way for step 3) (Step 3 lax_loop_test_test.go -> lax_loop_test.go to fit traditional conventions.)
Lint fixes.
godoc.org will be discontinued and currently redirects to pkg.go.dev.
Signed-off-by: cui fliter <[email protected]>
Add flag (--s2_random_seed) to specify the seed used for random generation in tests. Add new testing flag to specify the s2 random seed to allow repeatability between test runs. Refactor random test methods to allow optional seeded generators. Fix up all the functions in s2_test.go to take an optional random generator. Change the places that actually generate the random values to test for the optional parameter and use it if set. Minor fixes to a couple tests to match the current logic and values in their corresponding C++ tests. (paddedcell_test to use uniform float vs random float, fractal test cases relative error size) Update comments on random seeds to reference current rand form. With the addition of the random seed flag in testing now, update the comments on the cases that were triggering flaky tests. If they still show flakes, the specific cases can now be pushed through to the underlying random calls. Fixes golang#120
The fixture for TestEdgeDistancesUpdateMinInteriorDistanceRejectionTestIsConservative is confusing; it seems to 'want' `false` but actually it is being ignored and the test is expecting `true`. Use `want` and change the value to `true`. This agrees with C++: https://github.com/google/s2geometry/blob/58de4ea1e2f8a294e0c072c602c22232fd1433ad/src/s2/s2edge_distances_test.cc#L204
Add IsNormalizable and EnsureNormalizable and some basic tests for both.
Performance of maybeAddResult is not great since it invokes idForShape twice. idForShape iterates through all the shapes in shapeIndex to find id for the shape. If the ShapeIndex contains a big number of shapes it can be quite a big task to find the id for the shape. Since shapeID is available for maybeAddResult use it instead of idForShape.
This was created via New Workflow in Actions using the default OSSF scorecard configuration for now. --------- Co-authored-by: Alan Strohm <[email protected]>
Remove TODO from tests that are no longer flaky. (Tested 1k times, see golang#120 (comment))
Return nil if level is too low (cells are too large and might not be neighbors) or higher than MaxLevel (no such cells exist). Weakens precondition of function. golang#104 complained that AllNeighbors was returning the wrong results, but the level precondition was being violated. Make this more obvious and less confusing.
…#149) Co-authored-by: Alan Strohm <[email protected]>
This adds a basic configuration that has gofmt and some basic lints enabled. staticcheck is currently turned off because there are a number of outstanding code elements it flagged in the existing code that need to be fixed up before it should be turned on. --------- Co-authored-by: Alan Strohm <[email protected]>
This was referenced Apr 16, 2025
CascadingRadium
approved these changes
Apr 16, 2025
Likith101
approved these changes
Apr 17, 2025
Good to see updates making it back to this fork! I was wondering if you're also interested in bringing some of your improvements upstream. Please comment at golang#134 if you find some time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.