mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-07 17:10:07 +08:00
Add the test for checking the distribution property as well
This commit is contained in:
@@ -22,10 +22,52 @@ describe("Test Journal File Storage", async () => {
|
||||
study.union_search_space.map((item) => item.name).sort(),
|
||||
["x", "x", "category"].sort()
|
||||
)
|
||||
assert.strictEqual(
|
||||
study.union_search_space.some(
|
||||
(item) =>
|
||||
item.name === "category" &&
|
||||
item.distribution.type === "CategoricalDistribution" &&
|
||||
item.distribution.choices.length === 2
|
||||
),
|
||||
true
|
||||
)
|
||||
assert.strictEqual(
|
||||
study.union_search_space.some(
|
||||
(item) =>
|
||||
item.name === "x" &&
|
||||
item.distribution.type === "FloatDistribution" &&
|
||||
item.distribution.low === 0 &&
|
||||
item.distribution.high === 10 &&
|
||||
item.distribution.step === null &&
|
||||
item.distribution.log === false
|
||||
),
|
||||
true
|
||||
)
|
||||
assert.strictEqual(
|
||||
study.union_search_space.some(
|
||||
(item) =>
|
||||
item.name === "x" &&
|
||||
item.distribution.type === "FloatDistribution" &&
|
||||
item.distribution.low === -10 &&
|
||||
item.distribution.high === 0 &&
|
||||
item.distribution.step === null &&
|
||||
item.distribution.log === false
|
||||
),
|
||||
true
|
||||
)
|
||||
assert.deepStrictEqual(
|
||||
study.intersection_search_space.map((item) => item.name).sort(),
|
||||
["category"].sort()
|
||||
)
|
||||
assert.strictEqual(
|
||||
study.intersection_search_space.some(
|
||||
(item) =>
|
||||
item.name === "category" &&
|
||||
item.distribution.type === "CategoricalDistribution" &&
|
||||
item.distribution.choices.length === 2
|
||||
),
|
||||
true
|
||||
)
|
||||
})
|
||||
|
||||
it("Check the study including Infinities", () => {
|
||||
|
||||
Reference in New Issue
Block a user