force-h2020 / force-bdss

Business Decision System general interface
BSD 2-Clause "Simplified" License
2 stars 2 forks source link

FIX: Correction to #334 to ensure UniformSpaceSampler and DirichletSpaceSampler behave similarly #336

Closed flongford closed 4 years ago

flongford commented 4 years ago

This PR corrects some mistakes introduced in #334.

It reintroduces the resolution_to_sample_size function in order to ensure that the UniformSpaceSampler and DirichletSpaceSampler sample the same number of points for a given pair of dimension and resolution attributes.

Additionally, some extra logic is introduced into the UniformSpaceSampler to handle edge cases when only one weight will be returned. This is always set to 1.0 due to our normalisation constraints.

codecov[bot] commented 4 years ago

Codecov Report

Merging #336 into master will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #336   +/-   ##
=======================================
  Coverage   98.39%   98.40%           
=======================================
  Files          60       60           
  Lines        1686     1693    +7     
  Branches      172      172           
=======================================
+ Hits         1659     1666    +7     
  Misses         23       23           
  Partials        4        4           
Impacted Files Coverage Δ
force_bdss/mco/optimizer_engines/space_sampling.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ff30c7...2916ed8. Read the comment docs.