alan-turing-institute / DetectorChecker

Project to develop software to assess developing detector screen damage (Web App based on the original DetectorChecker package)
https://detectorchecker.azurewebsites.net
MIT License
0 stars 1 forks source link

[JOSS review] Some code and documentation comments #110

Closed craddm closed 3 years ago

craddm commented 4 years ago

JOSS review issue: openjournals/joss-reviews#2474

Neat package, looks like it could be very useful to the end users.

The API documentation could use quite a bit of improvement:

1) API documentation exposes a number of unexported functions - all the "misc" functions starting with a ., such as .derive_detector. It'd be best if these were switched to being internal (using @keywords internal) so they only appear for the developers. Otherwise, it's a little confusing for the user.

2) Repeated references are made to S3 classes - for example, the create_detector(detector_name) function is supposed to return a detector object with an S3 class reflecting the type of detector (e.g. Excalibur). But there aren't actually any S3 classes or methods involved in the package. All of these various functions actually only return lists. I appreciate that S3 objects are essentially just lists with a class attribute, but all the same, a list isn't an S3 object. From reading the docs I'd get the impression that there is an overarching detector class and everything else is a variation on that. But the docs are also inconsistent on this, as they state that each type of detector has its own class (e.g. Pilatus_Detector() returns a "Pilatus detector object" - it doesn't, it returns a list). It looks to me that, since all these various detectors return fundamentally the same structure, you really want a single S3 detector class, for which you could create custom methods (like print.detector(), for example.

3) Overall, the use of many of the functions is opaque to the user. Typically the function documentation simply states the name of the function and gives the title of the help file as the description, without ever really explaining anything about the function. In addition, as far as I can see, none of the function documentation shows any examples of use of specific functions. Examples:

again, I get the feeling some functions are really meant to be internal rather than user-facing, so would be better left out of the docs using @keywords internal or @noRd