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

[DOC] Centralize and clarify documentation on mutation, compactification, and other footguns #444

Open
dshemetov opened this issue Apr 30, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@dshemetov
Copy link
Contributor

dshemetov commented Apr 30, 2024

There are a number of gotchas and footguns available for our users. We want to warn them, but we shouldn't overload them. Let's write a "cautions" document and link to that in the rest of the documentation.

Some previous ideas:

  • It's generally unsafe for a user to modify epi_archive internals on their own. Use epiprocess functions whenever possible. epi_archive$clobberable_versions_start <- ... will not go through validation like it does on construction. Same goes for all the other attributes.
  • Partial attribute matching can occur: archive_cases_dv_subset$version will partial match to archive_cases_dv_subset$versions_end.
  • Maybe a "For data.table users:" section. "Reseating" (not sure what this means)
  • see the "Compactify" doc section after wip feat: replace R6 epi_archive with S3 implementation #431 is merged
@dshemetov dshemetov added the documentation Improvements or additions to documentation label Apr 30, 2024
@brookslogan
Copy link
Contributor

brookslogan commented Apr 30, 2024

  • Reseat = mutate pointer to point to something different.
    • If you definitely reseat to an unaliased object, then you can do mutation of the "pointee" without as much worry, and can also "move" it / give ownership of it away assuming that you own the pointer & don't use it again.
    • If you potentially reseat, then you cannot do aliased mutation for the purpose of modifying the original pointee.
    • [This is a different concern set than if you mutated the pointee; e.g., in that case you may worry about whether the pointee is aliased, whereas if you definitely reseat & definitely don't mutate the original pointee you don't care whether you were originally aliasing.]

Compactify doc seems like an okay stop-gap. Hoping that we can add a filter implementation, then encapsulate DT and provide only something like a get_diff_data() so that we can just compactify and not talk about it when people are constructing the archive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants