uber / h3

Hexagonal hierarchical geospatial indexing system
https://h3geo.org
Apache License 2.0
4.8k stars 457 forks source link

H3 CLI Hierarchical Subcommands #846

Open dfellis opened 2 months ago

dfellis commented 2 months ago

This adds all of the hierarchical subcommands. Everything was easy until I reached compactCells and uncompactCells.

I am not happy with the way the flexible parser ended up in a soup of looping constructs, but I couldn't figure out any way that wasn't worse in some ways (eg, using goto and labels). I also couldn't figure out how handle a completely undelimited input file without copying the characters to a temporary string since you can have more than 15 hex characters in a 64-bit integer, so it would want to slurp up follow-on characters. We can simplify a bit if you think an undelimited deluge of hex characters is not a reasonable input format we should handle.

I also didn't DRY the huge similarities between the two functions. I am willing to do that, but only after we agree on how the string parsing logic should look like.

coveralls commented 2 months ago

Coverage Status

coverage: 98.826%. remained the same when pulling 1cbcb25010ece10aaf5fe02d966e88d7d54047bc on h3-cli-hierarchical-subcommands into efdd514b2d80c49973e5dd55a842f68be73ed0e5 on master.

dfellis commented 2 months ago

I think this may be why the tests are failing. It's setting up a build directory that is not the CWD, while the files are using relative paths. I need to see how to get the directory they're actually being put in vs where make test is getting invoked.

coveralls commented 2 months ago

Coverage Status

coverage: 98.826%. remained the same when pulling e58e5df37de4e7b9d8c9b788b3c18ee833e11d2e on h3-cli-hierarchical-subcommands into efdd514b2d80c49973e5dd55a842f68be73ed0e5 on master.

dfellis commented 2 months ago

Still something funky with Windows. I'll need to dust off my VM.

coveralls commented 2 months ago

Coverage Status

coverage: 98.826%. remained the same when pulling 4f817709e4f527994df5d58bc26961df92443520 on h3-cli-hierarchical-subcommands into efdd514b2d80c49973e5dd55a842f68be73ed0e5 on master.

dfellis commented 2 months ago

Hmm... There was another error that I didn't notice before. https://github.com/uber/h3/actions/runs/9521371842/job/26248637576?pr=846#step:7:301

Let me see if I can figure that out.

dfellis commented 2 months ago

So that last failure was legit, and was a copy-paste error when I set up arg parsing in one of the new subcommands.

I have no idea what black magic the GNU libc is doing under the hood to get that casting to work "correctly" on Linux.

coveralls commented 2 months ago

Coverage Status

coverage: 98.826%. remained the same when pulling 4bea9bd4908fe6b822fcd08b537dcb62821c077f on h3-cli-hierarchical-subcommands into efdd514b2d80c49973e5dd55a842f68be73ed0e5 on master.

coveralls commented 2 months ago

Coverage Status

coverage: 98.826%. remained the same when pulling 4bea9bd4908fe6b822fcd08b537dcb62821c077f on h3-cli-hierarchical-subcommands into efdd514b2d80c49973e5dd55a842f68be73ed0e5 on master.

coveralls commented 1 month ago

Coverage Status

coverage: 98.826%. remained the same when pulling c3b5cfe0350318a49c60c2d4cba17f881e8b9eea on h3-cli-hierarchical-subcommands into efdd514b2d80c49973e5dd55a842f68be73ed0e5 on master.