From 069a3de7141630280f109e9b2a6e35af0036e0f4 Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Sun, 16 Feb 2020 13:03:19 +0900 Subject: [PATCH 1/2] Add #[serde(default)] attribute to optional fields --- kurobako_problems/src/sigopt.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kurobako_problems/src/sigopt.rs b/kurobako_problems/src/sigopt.rs index 07fc883..f84ccb4 100644 --- a/kurobako_problems/src/sigopt.rs +++ b/kurobako_problems/src/sigopt.rs @@ -31,16 +31,19 @@ pub struct SigoptProblemRecipe { /// Dimension of the test function. #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default)] #[structopt(long)] pub dim: Option, /// Input resolution of the test function. #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default)] #[structopt(long)] pub res: Option, /// List of the dimensions which should only accept integer values. #[serde(skip_serializing_if = "Vec::is_empty")] + #[serde(default)] #[structopt(long)] pub int: Vec, } From 7e68ae646c1a2addfaecd945db866e707cbd0fbb Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Sun, 16 Feb 2020 13:08:56 +0900 Subject: [PATCH 2/2] Update ci.yml --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ca4762..b3cdf0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,8 @@ jobs: with: command: test args: --all-features --all + - name: studies command + run: cargo run -- studies --solvers $(cargo run -- solver random) --problems $(cargo run -- problem sigopt --dim 5 ackley) --repeats 10 --budget 100 lints: name: Lints