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

Datagen API polish #3951

Merged
merged 14 commits into from
Aug 30, 2023
Merged

Datagen API polish #3951

merged 14 commits into from
Aug 30, 2023

Conversation

robertbastian
Copy link
Member

@Manishearth Manishearth removed their request for review August 28, 2023 17:26
@Manishearth
Copy link
Member

(happy to review if needed but at this point there's a lot of stuff going on in datagen and I've only kept up with the high level things)

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.

Seems good; some minor comments/questions

provider/datagen/src/bin/datagen/args.rs Outdated Show resolved Hide resolved
provider/datagen/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines +75 to +76
#[arg(help = "Load a JSON config. All options other than --verbose are ignored.")]
config: Option<PathBuf>,
Copy link
Member

Choose a reason for hiding this comment

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

Observation: you made this a positional argument

/// | [`Preresolved`] | No | Small |
/// | [`Runtime`] | Required, Automatic | Smallest |
/// | [`RuntimeManual`] | Required, Manual | Smallest |
/// | [`Preresolved`] | Not required | Small |
Copy link
Member

Choose a reason for hiding this comment

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

The problem with runtime fallback on preresolved is that we don't guarantee that things like en-001 are present. You really shouldn't be using preresolved if you plan on runtime fallback.

Copy link
Member Author

Choose a reason for hiding this comment

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

do you have a suggestion? I'd rather say required for the first two

Copy link
Member

Choose a reason for hiding this comment

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

Now about "N/A" or "Not applicable"

Copy link
Member Author

Choose a reason for hiding this comment

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

Not supported? If it's actually a problem we should discourage people from doing it

Copy link
Member

Choose a reason for hiding this comment

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

Ok

provider/datagen/src/lib.rs Outdated Show resolved Hide resolved
/// fail with the appropriate error:
/// * [`is_missing_cldr_error`](Self::is_missing_cldr_error)
/// * [`is_missing_icuexport_error`](Self::is_missing_icuexport_error)
/// * [`is_missing_segmenter_lstm_error`](Self::is_missing_segmenter_lstm_error)
Copy link
Member

Choose a reason for hiding this comment

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

Why did you move these onto DatagenProvider? I think they were good as free functions in the error module

Copy link
Member Author

Choose a reason for hiding this comment

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

Free functions are messy. These errors are a property of the DatagenProvider, not of any other part of datagen.

sffc
sffc previously approved these changes Aug 30, 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.

lgtm modulo the preresolved docs

@robertbastian robertbastian merged commit 7063d12 into unicode-org:main Aug 30, 2023
25 checks passed
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.

3 participants