You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
concoredocker.hpp has several broken functions that don't match Python behavior #224
I was comparing concoredocker.hpp against concoredocker.py (similar to what I did for the Java side in #197) and found a few functions that don't actually work correctly. This file was added in PR #143 and the author mentioned it wasn't tested, looks like a few things slipped through.
1.safe_literal_eval() always returns the default value
std::unordered_map<std::string, std::string> safe_literal_eval(const std::string& filename, std::unordered_map<std::string, std::string> defaultValue) {
std::ifstream file(filename);
if (!file) {
std::cerr << "Error reading " << filename << "\n";
return defaultValue;
}
return defaultValue; // returns default even when the file opens fine
}
The file is opened but the content is never read or parsed. So iport and oport are always empty {}, which means port mappings are completely ignored.
load_params() never populates the params map
The function reads concore.params, transforms the string with regex, but never actually inserts anything into this->params. The transformed string is just discarded. So tryparam() always returns the default.
read() doesn't parse the data or track simtime
Python's read() does:
Parse the list with literal_eval
Extract simtime from inval[0]
Return inval[1:] (data without simtime)
The C++ version just returns the raw string {ins} without any parsing. Simtime is never updated from reads.
Missing initval()
Both concoredocker.py and concoredocker.java have initval() which parses a string like "[0.0, 0.0]", sets simtime from the first element, and returns the rest. This function doesn't exist in the .hpp file at all.
Where, All in concoredocker.hpp. I can put up a fix that brings these in line with the Python version.
Activity
avinxshKD commentedon Feb 8, 2026
@pradeeban working on the fix, pls do let me know, thanks
pradeeban commentedon Feb 8, 2026
ok, go ahead, @avinxshKD. Make sure to check and develop against the dev branch.
Fix broken functions in concoredocker.hpp to match Python behavior
Fix broken functions in concoredocker.hpp to match Python behavior