Skip to content
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

Split MeasureUnit into MeasureUnitParser and MeasureUnit #4391

Merged
merged 70 commits into from
Dec 13, 2023

Conversation

younies
Copy link
Member

@younies younies commented Nov 30, 2023

No description provided.

@younies younies changed the title Implement the convertibility Create and Implement MeasureUnitParser Dec 3, 2023
Copy link

dpulls bot commented Dec 7, 2023

🎉 All dependencies have been resolved !

@younies younies marked this pull request as ready for review December 7, 2023 14:16
sffc
sffc previously approved these changes Dec 8, 2023
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Good for experimental. Looking forward to when we start running it with data

impl MeasureUnit {
impl<'data> MeasureUnitParser<'data> {
/// Creates a new MeasureUnitParser from a ZeroTrie payload.
pub fn new(zerotrie_payload: &'data ZeroTrie<ZeroVec<'data, u8>>) -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

issue: the public API should construct this from the data struct, through a provider. this looks like a datagen-only API, so it should be behind the datagen feature

Copy link
Member Author

Choose a reason for hiding this comment

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

let's discuss this API before submission in the ICU4X meeting today.

Copy link
Member

Choose a reason for hiding this comment

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

On talking to Younies: the way to construct the Parser should be a method from the MeasureUnitConversionFactory which is what owns the data

We should:

  • Temporarily mark this cfg(feature = datagen) (since it's still needed by datagen)
  • Rename it to from_payload()
  • Add a todo to revisit the public nature of the API
  • (separate PR) make this constructable from a Factory

Copy link
Member Author

Choose a reason for hiding this comment

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

done

experimental/unitsconversion/src/measureunit.rs Outdated Show resolved Hide resolved
experimental/unitsconversion/src/measureunit.rs Outdated Show resolved Hide resolved
@robertbastian
Copy link
Member

Consider renaming the PR to "Split MeasureUnit into MeasureUnitParser and MeasureUnit". You're not really implementing anything here.

@younies younies changed the title Create and Implement MeasureUnitParser Split MeasureUnit into MeasureUnitParser and MeasureUnit Dec 12, 2023
@younies younies changed the title Split MeasureUnit into MeasureUnitParser and MeasureUnit Split MeasureUnit into MeasureUnitParser and MeasureUnit Dec 12, 2023
@younies younies merged commit efed14b into unicode-org:main Dec 13, 2023
29 checks passed
@younies younies deleted the convertibilty branch June 27, 2024 20:01
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.

4 participants