|
31 | 31 | )
|
32 | 32 | @test chain[1].a == -1.8
|
33 | 33 | @test chain[1].b == 3.2
|
| 34 | + |
| 35 | + # test warning for initial_parameters (typo) |
| 36 | + # Note: initial_parameters will be ignored, but it should warn the user |
| 37 | + @test_logs (:warn, r"initial_parameters.*not recognised.*initial_params") (:warn,) sample( |
| 38 | + MyModel(), MySampler(), MCMCThreads(), 3, 2; progress=false, initial_parameters=(b=1.0, a=2.0) |
| 39 | + ) |
34 | 40 | end
|
35 | 41 |
|
36 | 42 | @testset "IJulia" begin
|
|
282 | 288 | MyModel(), MySampler(), MCMCDistributed(), 5, 10; chain_type=MyChain
|
283 | 289 | )
|
284 | 290 |
|
| 291 | + # Test warning for initial_parameters (typo) |
| 292 | + @test_logs (:warn, r"initial_parameters.*not recognised.*initial_params") sample( |
| 293 | + MyModel(), MySampler(), MCMCDistributed(), 3, 2; progress=false, initial_parameters=(b=1.0, a=2.0) |
| 294 | + ) |
| 295 | + |
285 | 296 | # Suppress output.
|
286 | 297 | logs, _ = collect_test_logs(; min_level=Logging.LogLevel(-1)) do
|
287 | 298 | sample(
|
|
408 | 419 | MyModel(), MySampler(), MCMCSerial(), 5, 10; chain_type=MyChain
|
409 | 420 | )
|
410 | 421 |
|
| 422 | + # Test warning for initial_parameters (typo) |
| 423 | + @test_logs (:warn, r"initial_parameters.*not recognised.*initial_params") sample( |
| 424 | + MyModel(), MySampler(), MCMCSerial(), 3, 2; progress=false, initial_parameters=(b=1.0, a=2.0) |
| 425 | + ) |
| 426 | + |
411 | 427 | # Suppress output.
|
412 | 428 | logs, _ = collect_test_logs(; min_level=Logging.LogLevel(-1)) do
|
413 | 429 | sample(
|
|
0 commit comments