Closed ClementPinard closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Files with missing lines | Coverage Δ | |
---|---|---|
lours/dataset/dataset.py | 86.01% <100.00%> (+0.38%) |
:arrow_up: |
lours/evaluation/detection/util.py | 81.20% <100.00%> (ø) |
Ok took me some time to investigate, but I now understand: codecov complains that these 2 new lines are not covered by tests. Codecov default rule is that coverage can only go up, so the coverage of newly added lines must be above current coverage (which is 86%)
Why are these two lines never reached ? Because since we are always dealing with numpy arrays, the .item()
method will always work. Even if I try to put something else like I do in the new test (my_dummy_dataset.annotations.loc[my_dummy_dataset.annotations.index[0], "category_id"] = 1
) it gets converted back to int64 with this line : https://github.com/XXII-AI/Lours/blob/2f9d16614072c16f9924bd2b53896a8cf70733f3/lours/dataset/dataset.py#L1018
An interesting issue would be to discuss the possibility to have flexible dtypes. For example, you could use category_id with strings, especially uuids.
We'll see about that in the future. In the mean time, I just remove this try except since it cannot be triggered by design
Just updated the branch to also have the changelog changed, we need to add an action to check it everytime :p
Update code to be compatible with numpy 2.0 :