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

add support for measurement type #884

Merged
merged 6 commits into from
Apr 27, 2022
Merged

Conversation

jmhw0123
Copy link
Contributor

@jmhw0123 jmhw0123 commented Mar 24, 2022

Added support for the measurement type

@jmhw0123 jmhw0123 requested a review from sileix March 24, 2022 08:36
@jmhw0123 jmhw0123 self-assigned this Mar 24, 2022
Copy link
Member

@sileix sileix left a comment

Choose a reason for hiding this comment

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

don't we need to update sample-constants first?

support measurement type
@sileix sileix force-pushed the wip/synthetic-data-sampler branch from 195e8ac to 55b71b8 Compare April 7, 2022 06:54
Copy link
Member

@sileix sileix left a comment

Choose a reason for hiding this comment

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

As it gets more and more complicated, I think we should have a unit test for it. Use a small fake schema with different thingtalk types to test it. Probably a good idea to have a parameter to control how many examples per annotation - so we can set it to 1 to make the unit test shorter.

if (argument.type instanceof Type.Measure)
argumentCanonical = '#' + argumentCanonical;
else
argumentCanonical = argumentCanonical + ' #';
Copy link
Member

Choose a reason for hiding this comment

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

why do you need this?

function retrieveSampleValues(classDef : Ast.ClassDef,
sampleMeta : Record<string, Constant[]>,
fname : string,
arg : Ast.ArgumentDef) : string[] {
if (arg.type instanceof Type.Enum)
return arg.type.entries!.slice(0, 10).map(utils.clean);
if (arg.type instanceof Type.Measure)
return generateRandomIntArray(100).map(String);
Copy link
Member

Choose a reason for hiding this comment

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

include number, time, date, and location?

@jmhw0123 jmhw0123 requested a review from sileix April 18, 2022 16:39
Copy link
Member

@sileix sileix 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

@jmhw0123 jmhw0123 merged commit 3d10e05 into master Apr 27, 2022
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.

None yet

2 participants