finos / datahelix

The DataHelix generator allows you to quickly create data, based on a JSON profile that defines fields and the relationships between them, for the purpose of testing and validation
https://finos.github.io/datahelix/
Apache License 2.0
141 stars 50 forks source link

fix(#1552): use user provided weights instead of uniform distribution #1687

Closed Ro4052 closed 4 years ago

Ro4052 commented 4 years ago

Description

As highlighted in #1552, when using inSet constraints, user weights are ignored and the distribution is uniform. This PR attempts to correct this behaviour.

Changes

As mentioned in the issue, we currently drop the weights provided by the user after processing the file and then force the distribution to be uniform.

Additional notes

This is a fist attempt, although all the tests past I am not fully aware of the wider implications of these changes.

Issue

Resolves #1552

Ro4052 commented 4 years ago

Does anyone have any ideas of how we could write a test (some tests) for weighted constraints?