Skip to content

Bump to h3 4.4.0#213

Merged
nrabinowitz merged 7 commits into
uber:masterfrom
isaacbrodsky:bump-4.4.0
Nov 18, 2025
Merged

Bump to h3 4.4.0#213
nrabinowitz merged 7 commits into
uber:masterfrom
isaacbrodsky:bump-4.4.0

Conversation

@isaacbrodsky
Copy link
Copy Markdown
Collaborator

No description provided.

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 11, 2025

Pull Request Test Coverage Report for Build 19382556864

Details

  • 26 of 27 (96.3%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 99.325%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/h3core.js 22 23 95.65%
Totals Coverage Status
Change from base Build 18623676084: -0.3%
Covered Lines: 606
Relevant Lines: 608

💛 - Coveralls

Comment thread lib/h3core.js
Comment on lines +774 to +787
* @static
* @param {number} res Resolution of cell to return
* @param {number} baseCellNumber Base cell number of cell to return
* @param {number[]} digits Indexing digits of cell to return
* @return {H3Index} H3 index
* @throws {H3Error} If input is invalid
*/
export function constructCell(res, baseCellNumber, digits) {
if (digits.length < res) {
throw H3LibraryError(E_DIGIT_DOMAIN, digits.length);
}
if (digits.length > 15) {
throw H3LibraryError(E_DIGIT_DOMAIN, digits.length);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be natural to just have the resolution be inferred directly from the length of the digits array? I understand this matches the C function more closely, but these seems less natural for a language like JS or Python, where we would more naturally just take the length of the array.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, the compactCells in JS function doesn't take in the length of the array as a separate parameter.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind this, TBH. I think it's natural for most callers to think about the res separately from the digits being set, even though they're closely related.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference? For this function, they should be exactly the same, no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed offline, let's move res to the end and make it optional

Copy link
Copy Markdown
Collaborator

@nrabinowitz nrabinowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thanks for putting this up!

Comment thread doc-files/README.tmpl.md Outdated
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![npm version](https://badge.fury.io/js/h3-js.svg)](https://badge.fury.io/js/h3-js)
[![H3 Version](https://img.shields.io/static/v1?label=h3%20api&message=v4.1.0&color=blue)](https://github.com/uber/h3/releases/tag/v4.1.0)
[![H3 Version](https://img.shields.io/static/v1?label=h3%20api&message=v4.4.0&color=blue)](https://github.com/uber/h3/releases/tag/v4.4.0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I guess we missed this in previous updates. I could potentially auto-gen this I think

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Svtsalogistic

Comment thread lib/h3core.js Outdated
Comment thread test/h3core.spec.js
assert.end();
});

test('isValidIndex', assert => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want tests here to assert that an edge or a vertex is a valid index?

Comment thread package.json Outdated
},
"dependencies": {}
"dependencies": {},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this matter?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. It's added automatically by this version of yarn. Maybe we can turn that off in the package.json settings so it doesn't propose doing that.

Comment thread lib/h3core.js
}

/**
* Whether a given string represents a valid H3 index
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe add some clarifying text to explain the difference between isValidCell and isValidIndex

Comment thread lib/h3core.js
Comment on lines +774 to +787
* @static
* @param {number} res Resolution of cell to return
* @param {number} baseCellNumber Base cell number of cell to return
* @param {number[]} digits Indexing digits of cell to return
* @return {H3Index} H3 index
* @throws {H3Error} If input is invalid
*/
export function constructCell(res, baseCellNumber, digits) {
if (digits.length < res) {
throw H3LibraryError(E_DIGIT_DOMAIN, digits.length);
}
if (digits.length > 15) {
throw H3LibraryError(E_DIGIT_DOMAIN, digits.length);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind this, TBH. I think it's natural for most callers to think about the res separately from the digits being set, even though they're closely related.

@nrabinowitz nrabinowitz merged commit 61cc7b0 into uber:master Nov 18, 2025
8 checks passed
Copy link
Copy Markdown

@artur19simonyan81-rgb artur19simonyan81-rgb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Svtsalogistic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants