-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add QueueManager (Juan Chavez's WAVES project) #414
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #414 +/- ##
==========================================
+ Coverage 82.02% 83.03% +1.00%
==========================================
Files 294 297 +3
Lines 33200 33596 +396
==========================================
+ Hits 27233 27897 +664
+ Misses 5967 5699 -268
Continue to review full report at Codecov.
|
Okay, tests written, ready for review! Does prefab seem like the right place for this? |
And test coverage is now sufficient! The process of writing tests for SettingConfig revealed an obscure issue where in certain cases if you include both map_utils.h and vector_util.h and then try to call |
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.
Could you make a pass to undo the 4-indent to 2-indent whitespace changes you made? I bet your editor maybe just changed all that I assume it's not intentional? It's making telling what changed in the diffs really hard and it looks like 2-indent is being used everywhere else in Empirical. Ideally, we would fixup the git history and remove these changes so that git blame would be more useful on these files in the future but I don't think that's really worth the hassle in this case. We could just squash commit, which would be easy but then we'd lose all of the history of how it was put together.
Ideally, we'd might run everything through a formatter and be done with it but we haven't set that up :/
Oof, I'm not sure what happened to the formatting, but it was worse than it looked. My guess is that Juan's editor did some sort of autoformatting and mine just went along with it when I was doing this final pass. And because we're not using a real formatting standard for Empirical there wasn't a way to auto-fix it. So what I'm saying is that I would absolutely be in favor of running everything through clang-tidy or something on commit :). Also might be worth explicitly discussing in an early WAVES enrichment this year. Anyway, it's fixed now. |
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.
A few minor suggestions, but looks great!
return result; | ||
} | ||
|
||
/// Retrieves all of the setting names in config and places into std::vector |
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.
don't think this docstring is quite right
* tool was written by Juan Chavez as part of WAVES 2020) | ||
*/ | ||
|
||
#pragma once |
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.
Switch this out for #ifndef/#define style header guards, I think we're trying to stay /entirely/ standards-compliant
display_div << queue_button; | ||
} | ||
|
||
/// Adds new metric to table |
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.
Missing . at end
/// a lambda function and capturing the information you need instead. | ||
/// @param header_name the name this column should have in the table | ||
/// | ||
void AddMetric(std::function<std::string()> func, std::string header_name) { |
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.
take header_name by const&?
queue_manager->AddRun(get_setting_config(), get_epochs()); | ||
queue_manager->AddNewQueuedRunToTable(); | ||
|
||
emp_assert(!queue_manager->IsEmpty()); |
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.
Should we make these tests emp_always_assert
so we don't have to worry about them getting turned off if we define NDEBUG?
Finally had a chance to put the necessary finishing touches on this! It is a class that makes a web interface for queuing up multiple runs on a web GUI. Useful for educational purposes (since students can actually collect data in the web version of a program) and for writing simple models to hand off to non-coders to analyze.
I still need to write some tests for it before this is ready for merge, but I updated the SpatialCoop2017 demo to use it (since that was the initial inspiration) and it's working fine.