-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Doctests #557
Use Doctests #557
Conversation
Codecov Report
@@ Coverage Diff @@
## master #557 +/- ##
==========================================
+ Coverage 79.12% 80.12% +0.99%
==========================================
Files 39 39
Lines 2721 2732 +11
==========================================
+ Hits 2153 2189 +36
+ Misses 568 543 -25
Continue to review full report at Codecov.
|
@davidanthoff for the tutorials, using doctests would require pulling down models from our registry. Is there a particular way you would suggest doing that? I don't think I can do it in the Project.toml file, but thought maybe I could do something similar to what you do for testing dependencies or something? |
Hm, good question... I guess we could add the registry here, and then the models can just be listed in the |
Ah @davidanthoff that's a good idea, do you know the command when you aren't in the UPDATE: I'll use this https://julialang.github.io/Pkg.jl/v1.1/api/#Registry-API-Reference-1 |
docs/src/tutorials/tutorial_1.md
Outdated
using MimiFUND | ||
m = getfund(nsteps = 100) | ||
m = MimiFUND.get_model(nsteps = 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckingdon95 I'm seeing an error after this call now:
ERROR: Mismatched data size for a parameter connection: dimension :time in <ComponentId MimiFUND.scenariouncertainty> has 101 elements; external parameter :scenpgrowth has 1051 elements.
any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR address this and needs discussion:
fund-model/MimiFUND.jl#44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lrennels should we change this nsteps
example since the fix for this isn't merged into FUND yet? Or should we wait? Ideally these blocks would also be doctested right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you’re right we should change or remove it since it isn’t merged yet and we’d want these blocks doctested.
Handled the change, Cora and I will handle this branch from here
hmm now it's stalling with the error: "No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself." Which is the same thing that's happening on your other PR to run Travis on Windows (except that it's also happening here on mac and linux) @davidanthoff |
What an endless nightmare, this branch :) I think the strategy now is to insert |
@davidanthoff we already have those @info statements, so we can see that the last one to give output before it stalled was "test_timesteparrays.jl" which is about 3/4 of the way through all the tests in "runtests.jl". Not sure what to do with that info though |
It did successfully run the doctests I think, since I put that at the top of the "runtests" file, so that's good that that's working in the test environment now. So I guess this is now a different Travis problem? |
This branch is my nightmare. Ok so do we know what the commit is that caused Mac Travis to start failing? It’s when we changed the .yml file calls to the registry adds etc? |
Ah ok I see. This might be off base, but I was running into that exact problem when I ran the doctests once before the documentation ran, and then they were run again in |
@ckingdon95 @davidanthoff I think there's something going on here with the explorer and broken pipes, which I've seen before. When we run Trying this locally, if I run
While I do not see this error in the testing log, it seems likely that this is related. One solution might be to remove tests of |
Can we try the following:
I tried to look through Electron.jl to figure out how that error that @lrennels reported might come about, but I don't understand. @lrennels could you actually open an issue over at Electron.jl with a replication steps for that pipe error, just so we don't lose track of it? |
Yep I can certainly do both of those things! Per #1, I can move the specific test we are doing to |
So I think many of the structural problems are now ok, but now we are running into output comparison tests that depend on a digit very far to the right, and we get slight differences there on different platforms, so the tests fail... I guess we could a) for now just not compare outputs for these specific tests, just so that we can merge this and then fix remaining problems in smaller follow up PRs, or b) try to output the results with less digits so that we don't run into these problems. But that of course is tricky because it would make our example code much more complicated with something that is really only needed for the tests.... @lrennels and @ckingdon95 in any case, can you two take it from here? Let me know if you run into more of the infrastructure problems again, happy to help with those! |
This PR addresses issue #548.
Adding Documenter doctests to the Mimi documentation so that the code blocks are run during testing. Doctests will be included as much as possible, including in the tutorials, but for now are not used comprehensively in files such as the
userguide.md
, since that would require substantial configuring of the file (it has most syntax instructions that don't have enough setup code to fully run).nsteps
error fixed in new FUND version