Closed flongford closed 4 years ago
Merging #334 into master will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #334 +/- ##
=======================================
Coverage 98.39% 98.39%
=======================================
Files 60 60
Lines 1685 1686 +1
Branches 170 172 +2
=======================================
+ Hits 1658 1659 +1
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 50caa07...0ec6d67. Read the comment docs.
This PR closes #332
The
UniformSampler
class is refactored so that the same number of points is generated whetherwith_zero_values
is set toTrue
orFalse
. Consequently, it no longer matters if theresolution
attribute is less thandimension
, we just sample at different points along the grid.Example:
For a
dimension = 3
vector, a sampleresolution = 2
(weight combinations per dimension) will yield the following normalised weight combinations ifwith_zero_values = True
:This is because 2 possible weight values are allowed:
0.0
and1.0
. However, settingwith_zero_values = False
will result in the following normalised combinations:Notice how in each situation the ratio of weightings per dimension is the same, only the values are different (now
0.25
and0.5
).Additional changes:
SpaceSampler
unit tests have also been updated and moved into a separatetest_space_sampling.py
fileresolution_to_sample_size
function is removed.