Skip to content
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

S3 object HospiNet #2

Closed
PascalCrepey opened this issue Jul 22, 2019 · 10 comments
Closed

S3 object HospiNet #2

PascalCrepey opened this issue Jul 22, 2019 · 10 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@PascalCrepey
Copy link
Owner

We need to build an S3 object, let's call it HospiNet, which will contain the hospital matrix and relevant indicators (see vignette for details). This object should have a dedicated summary and print method.

@PascalCrepey PascalCrepey added enhancement New feature or request help wanted Extra attention is needed labels Jul 22, 2019
@PascalCrepey
Copy link
Owner Author

Just created a constructor for this S3 object but no generic method yet...

@nolwenn
Copy link
Collaborator

nolwenn commented Jul 31, 2019

Why do you have matrix and edgelist in your object?

@PascalCrepey
Copy link
Owner Author

Well, sometimes we need the matrix (in spreading simulation) and sometimes we need the edgelist (for igraph), so since both are created at one point I thought we could keep them both and let the user choose what he/she wants...

@nolwenn
Copy link
Collaborator

nolwenn commented Jul 31, 2019

But you have methods to go from one to the other, no? You might not want to store the two types in one object as it might take a lot of memory?

@PascalCrepey
Copy link
Owner Author

mydb = create_fake_patientDB(n_patients = 100000, n_hospital = 2500)
hnet = hospinet_from_patient_database(base = mydb, noloops = FALSE)
format(object.size(hnet), units = "Mb") #27.3Mb
format(object.size(mat$matrix), units = "Mb") #24.3Mb
format(object.size(mat$edgelist), units = "Mb") #3.1Mb

we'll know what to remove if we have a memory size issue... ;-)

@nolwenn
Copy link
Collaborator

nolwenn commented Aug 1, 2019

Other question: should not we be able to apply the getMetrics, get_degree... functions on the HospiNet object and not on some igraph object only ?

@PascalCrepey
Copy link
Owner Author

PascalCrepey commented Aug 1, 2019 via email

@tjibbed
Copy link
Collaborator

tjibbed commented Aug 12, 2019

I will need to do some reading up here on the difference between S3 and R6 objects, but the last option sounds like the best solution to me, indeed.

As for @nolwenn 's question, it seems most intuitive to be able to apply these functions on the HospiNet object.

@PascalCrepey
Copy link
Owner Author

I've implemented the R6 mechanism. You can see it at work at the end of the work-flow vignette (text of the vignette still needs to be updated...)

@tjibbed
Copy link
Collaborator

tjibbed commented Aug 12, 2019

Brilliant. Hadn't noticed yet... I'm still catching/reading up after being away for a week and a half.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants