-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class Inheritance Reporter #129
Conversation
…nto feature/r6-methods
…ass generator functions
3286e59
to
3842a55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jayqi , I am excited to see results from these two tests:
devtools::install('.')
devtools::install("./inst/milne")
t3 <- InheritanceReporter$new()
t3$set_package(pkg_name = 'milne')
t3$edges
t3$graph_viz
t4 <- InheritanceReporter$new()
t4$set_package(pkg_name = 'lubridate')
t4$edges
t4$graph_viz
However, I cannot reference this as a reporter through our high level function CreatePackageReport()
.
pkgnet::CreatePackageReport('lubridate', pkg_reporters = c(DefaultReporters, InheritanceReporter)) # error
pkgnet::CreatePackageReport('milne', pkg_reporters = c(DefaultReporters, InheritanceReporter)) # error
In both cases, I get the error "At least one of the reporters in the pkg_reporters parameter is not a PackageReporter. See ?AbstractPackageReporter for details." stemming from this test: https://github.com/UptakeOpenSource/pkgnet/blob/master/R/CreatePackageReport.R#L37
Can we enable this reporter to be used in this fashion (a specific call out in CreatePackageReport
) before we merge this PR? Then, in a later R, we could automate this with an R6::is.R6()
check.
@bburns632 Ironically, you are getting the errors because you are using both The following works for me:
The key two things are:
cc: @jameslamb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, Jay! I added some suggestions for changed. @
me when you want me to review again.
Overall I agreed with the approach and the core of the implementation. My recommendations are mostly about hardening it a bit to avoid subtle errors or pedantic stuff like whitespace.
ef234a1
to
4b43991
Compare
4b43991
to
7cad3bf
Compare
@jameslamb I think I have resolved all of your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Yes, the irony is delicious here. Clearly, this is not an issue with this reporter, but a UX issue to bring up later regarding using speciality or custom reporters (now that we have a new one!). All changes look good to me. |
Closes #14
Summary:
InheritanceReporter
that extracts the inheritance network for S4, Reference, and R6 classes within a given package.FunctionReporter
to explicitly exclude generator functions for Reference classes for now.I'm not sure the best way to represent object construction in FunctionReporter yet.
pallete
to correct spellingpalette
.Viz for
![pkgnet_inheritance](https://user-images.githubusercontent.com/2721979/49304107-01a7a780-f491-11e8-915d-c4b8d635a124.png)
pkgnet
:Viz for
![milne_inheritance](https://user-images.githubusercontent.com/2721979/49304110-03716b00-f491-11e8-8dc7-0fc7c9462a2c.png)
milne