icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Refactor: Rename uncategorized unit struct to erased

Open younies opened this issue 5 months ago • 3 comments

Description

  • Rename MeasureUnit and MeasureUnitParser to ErasedMeasureUnit and ErasedMeasureUnitParser respectively
  • Updating all references throughout the codebase.
  • Additionally, remove the old MeasureUnit and MeasureUnitParser bindings from FFI and update related documentation and tests accordingly.

younies avatar Jun 04 '25 14:06 younies

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments to provide feedback.

gemini-code-assist[bot] avatar Jun 04 '25 14:06 gemini-code-assist[bot]

Not a big fan of either naming

How about FixedCategoryMeasureUnit and AnyMeasureUnit

sffc avatar Jun 05 '25 23:06 sffc

I am adding this PR to the ICU4X standup discussion in order to agree on a specific name

younies avatar Jun 09 '25 19:06 younies

Some notes from 2025-06-10:

  • @robertbastian the parser should return a CategorizedMeasureUnit and not ErasedMeasureUnit and not depend on compiled_data
  • @sffc What data does the unit parser need? I think it is just the id data?
  • @younies The parser needs to have ids data and also the category -- also we need the conversion data.
  • @sffc : we need AnyMeasureUnit because not all categories are enumerable. For example, square-meter-square-second-per-square-kilogram.
  • @younies : we can start now by rename
  • @robertbastian : if you rename now we have to discuss FFI names as well, as MeasureUnit is already exposed there. lets get the formatter API done and then we can discuss what the best names for all the pieces are
  • @younies Okay, lets get the categorized formatter done, at lease we can make also the duration formatter ready for the graduation too. After that we will look at the AnyMeasureUnitFormatter
  • @Manishearth and @sffc , we need to have the whole crate implemented before graduation, and also include MixedUnits too
  • @robertbastian : everything that you want to add in the future should be added before graduation, otherwise it might not work
  • @Manishearth : A trait based solution would be nice, where you have a single MeasureUnitFormatter<M> type, and it has specific constructors for AnyUnit, LengthUnit, Meter, CompoundLengthUnit, etc, which all implement the same trait.
  • @sffc : calendar conversion is to DateTimeFormatter as unit conversion is to MeasureUnitFormatter, because it changes the API (you need to convert the input). Field sets are to DateTimeFormatter as unit categories are to MeasureUnitFormatter: they impact how much data you need to load, but they don't themselves impact the API signature.

sffc avatar Aug 13 '25 05:08 sffc