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

Vapply refactor 377 #658

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

njtierney
Copy link
Collaborator

Resolves #377

- replace `vapply(x, length, 1L)` with `lengths`
- replace `vapply(x, inherits, "greta_array", TRUE)` with `vapply(x, is.greta_array, TRUE)`
@njtierney njtierney changed the base branch from master to tf2-poke-tf-fun July 30, 2024 06:03
@njtierney njtierney added this to the 0.5.0 milestone Jul 30, 2024
@njtierney njtierney added the low hanging fruit Issue is simple to implement. label Jul 30, 2024
- updated NEWS.md
- rename `get_unique_name()` to `create_unique_name()` as this better describes what it does - creation, not extraction.
- `extract_unique_names(x)` wraps `vapply(x, member, "unique_name", character(1))`
- `are_identical(x, y)` wraps `vapply(x, identical, y, logical(1))`
- `are_null(x)` wraps `vapply(x, is.null, logical(1))` (needs to be exported to work with future in MCMC
- `are_greta_array(x)` replaces `vapply(x, is.greta_array, logical(1))`
- `have_distribution(x)` replaces `vapply(x, has_distribution, logical(1))`
@njtierney njtierney merged commit 4131f30 into greta-dev:tf2-poke-tf-fun Aug 1, 2024
@njtierney njtierney deleted the vapply-refactor-377 branch August 1, 2024 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low hanging fruit Issue is simple to implement.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

review uses of vapply and refactor where duplicated
1 participant