Open matthew-w-lundy opened 1 month ago
Located first by @BryanOwens55
In index_dict the keys are set to <class cppyy.gbl.std.string at 0x22b4ac90> instead of a <class 'str'>. These should be equivalent but they throw a key error in some configurations.
Do you have a reproducer? They really should be the same in all cases since the strings hash to the same values. Example:
import cppyy
s1 = "Hello, World!"
s2 = cppyy.gbl.std.string(s1)
d = {s1: True}
assert s1 in d
assert s2 in d
assert d[s2]
d[s2] = False
assert len(d) == 1
assert s1 in d
assert s2 in d
assert not d[s1]
The only reason I could see it would fail, if is there is some decoding mishap, but then str(name)
would fail as well.
When running the vegas branch the following error appears:
In index_dict the keys are set to <class cppyy.gbl.std.string at 0x22b4ac90> instead of a <class 'str'>. These should be equivalent but they throw a key error in some configurations. If you add the line "name=str(name)" above this section of the code https://github.com/VERITAS-Observatory/V2DL3/blob/ee2a5fc6a06cfe1a826db9073fb09536357033b9/pyV2DL3/vegas/EffectiveAreaFile.py#L79C1-L79C42 it will work. This might be good as a small commit to the main branch