Automated feature tracker
Closed this issue · 6 comments
doc/features.md currently lists which functionality has been implemented and is tested.
I think it'd be a good idea to include comments in the source code that lets us automate these checks. Example:
In src/InMemoryAnnData.R
:
X = function(value) {
if (missing(value)) {
# trackstatus: class=InMemoryAnnData, slot=X, what=getter, status=done
private$.X
} else {
# trackstatus: class=InMemoryAnnData, slot=X, what=setter, status=done
private$.X <- private$.validate_matrix(value, "X")
self
}
},
In tests/testthat/test-inMemoryAnnData.R
:
# trackstatus: class=InMemoryAnnData, slot=X, what=test_getter, status=done
test_that("read from X", {
...
})
# trackstatus: class=InMemoryAnnData, slot=X, what=test_setter, status=done
test_that("write to X", {
...
})
The following status could be used:
done
: The implementation is done and should be workingwip
: The implementation is partially complete and should be looked at further or improved uponmissing
: This feature is not implemented yet. If no entry for a particular class or slot can be found, the status is assumed to be missing.
We can search the source files for # trackstatus:
and render features.md
using the retrieved information.
Thoughts
- Does a package like this already exist?
Alternative notations
# trackstatus: class=InMemoryAnnData, feature=get_X, status=done
# trackstatus: class=InMemoryAnnData, feature=set_X, status=done
# trackstatus: class=InMemoryAnnData, feature=test_get_X, status=done
# trackstatus: class=InMemoryAnnData, feature=test_set_X, status=done
I created an initial implementation in #55.
-
Example of InMemoryAnnData.R
-
Resulting features.md.
I'm going to merge #55 already, but I'm happy to change the way this works in the future. I'll a link to what it looks like atm.
I guess I'm ok with this for the initial development but I would probably want to remove the comments once most things are implemented. Is the rendered report thing somewhere?
Here → https://scverse.org/anndataR/articles/features.html
Formatting could definitely be improved, but at least it gets automatically updated when the main branch is updated
Nice! That's super cool. This might actually be a useful thing to keep longer term so maybe we don't need remove things later like I suggested above.
😄 Whay!
In that case, I'll consider this issue closed. Happy to revisit things when needed.