-
Notifications
You must be signed in to change notification settings - Fork 1
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
Defensive checks for ml labels in config #20
Conversation
Hello @9and3 ! Just a little note that this PR needs to be checked, no need to merge it yet! Thank you! |
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.
Try to check it with some manually added wrong data in the config, e.g.:
- wrong name labels classifier
- wrong name model zenodo
- missing labels classifier
And see if this doesn't break your implementation.
Checked this branch on NUC, seems to be working fine! |
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.
We are almost there. I proposed I tiny modification that I think won't alter anything but it's just nicer and tider. Please have a look and let me know when it's done (should not take long).
include/ttool.hh
Outdated
InitializeConfig(ttoolRootPath, configFile); | ||
m_ConfigPtr->CheckAcitFiles(ttoolRootPath); |
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.
As discussed, I think m_ConfigPtr->CheckAcitFiles(ttoolRootPath);
should not be exposed in the constructor.
I propose simply to put it in the definition of InitializeConfig(..)
function, in the same ttool.hh
header. Here:
void InitializeConfig(std::string ttoolRootPath, std::string configFile)
{
m_ConfigFile = configFile;
m_ConfigPtr = std::make_shared<ttool::Config>(configFile);
m_ConfigPtr->SetTToolRootPath(ttoolRootPath);
# what I propose
m_ConfigPtr->CheckAcitFiles(ttoolRootPath);
m_ConfigPtr->CheckClassifierLabelsConfig();
}
Let me know if it works, and give it a go on a compiled AC just to be 100% sure that there are no problems.
Hey @9and3 ! Done it as you proposed, thank you so much! Please, have a look! |
This PR implements a verification process to ensure that each classifier label corresponds with the appropriate model and acit files.