-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add quadbinToBoundary utility #16
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f4871a7
Add quadbinToBoundary utility
jmgaya ef8d9b8
PR Feedback
jmgaya 9f198cb
Fix node engine
jmgaya 8ef5917
Use import type instead of import
jmgaya 132bf42
Update README.md with proper function name
jmgaya 7f279fe
PR Feedback
jmgaya e528abf
PR Feedback
jmgaya 944e71a
PR Feedback
jmgaya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## Quickstart | ||
|
||
To install and build `quadbin-js` locally from source: | ||
|
||
```bash | ||
# install dependencies | ||
yarn | ||
|
||
# build package once | ||
yarn build | ||
``` | ||
|
||
To run tests, coverage, or a linter, you should execute `yarn build`, and afterward: | ||
|
||
```bash | ||
# run tests once | ||
yarn test | ||
``` | ||
|
||
## Releases | ||
|
||
1. Create a new version: `yarn version [ major | minor | patch | prerelease ]` | ||
|
||
2. Execute `yarn publish` |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,20 +32,23 @@ | |
"build:esm": "tsc -p tsconfig/tsconfig.esm.json", | ||
"build:types": "tsc -p tsconfig/tsconfig.types.json", | ||
"build:umd": "webpack --config tsconfig/webpack.config.cjs", | ||
"lint": "npx prettier --check src", | ||
"lint": "prettier --check src", | ||
"test": "yarn lint && yarn test-fast", | ||
"test-fast": "npx ts-node node_modules/tape/bin/tape test/**/*.spec.js" | ||
"test-fast": "ts-node node_modules/tape/bin/tape test/**/*.spec.js", | ||
"prepublishOnly": "yarn build" | ||
}, | ||
"browser": { | ||
"jsdom": false | ||
}, | ||
"devDependencies": { | ||
"@babel/register": "^7.13.0", | ||
"@types/geojson": "^7946.0.14", | ||
"babel-loader": "^8.0.0", | ||
"babel-preset-minify": "^0.5.0", | ||
"prettier": "^2.4.1", | ||
"tape": "^5.3.0", | ||
"ts-loader": "^9.2.5", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^4.4.4", | ||
"webpack": "^5.52.1", | ||
"webpack-cli": "^4.8.0" | ||
|
@@ -54,6 +57,12 @@ | |
"node": ">=14" | ||
}, | ||
"dependencies": { | ||
"@mapbox/tile-cover": "3.0.1" | ||
"@mapbox/tile-cover": "3.0.1", | ||
"@math.gl/web-mercator": "^4.1.0" | ||
}, | ||
"packageManager": "[email protected]", | ||
"volta": { | ||
"node": "14.21.3", | ||
"yarn": "1.22.22" | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Could you rename these 3 functions to be
cellTo...
and export them?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.
Sure!
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.
I think you missed this comment
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.
I kept them as they are because they have this name in
deck.gl
, and not only that, but they receive a parameterquadbin
, so I think we should re-think it a bit before renaming?Regarding your export suggestion, done!
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.
I think if we are going to add functions to the package we shouldn't change the names later. So best to include them as
cellToOffset(cell: bigint)
etc, i.e. renaming also the parameter. It's not an issue for deck that the name changesThere 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.
What I'm afraid of is that we are proposing some changes that may require a major version, and I'm not sure if we should go for them in this PR, just it 🤷
What's your proposal then? Mine is:
Quadbin
type everywhereQuadbin
instead ofcell
in all the function namesThere 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.
As stated originally, I want the API to be aligned with
quadbin-py
. Which it currently is.quadbin-py
should have the same namecellToOffset
should follow the conventions already usedI see no value in renaming the existing function names, that would be a breaking change and require a major version and diverge from
quadbin-py
.For the new functions we should stick with the conventions, so using
cell
in function names andquadbin: Quadbin
in the parameters. It doesn't matter to the calling code what the name of the parameter isThere 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 API is modeled on https://github.com/uber/h3-js, which means that it is simpler to port code between the spatial indices, which is not the case if the functions are things like
quadbinToBoundary
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.
Sounds like a plan, let's go for it 👍
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.
I'll say now, every function:
quadbin: Quadbin
cell
in its nameCould you please re-re-re-review it 😆 ?