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

Store offset in packing #137

Merged
merged 10 commits into from
Nov 21, 2024
Merged

Store offset in packing #137

merged 10 commits into from
Nov 21, 2024

Conversation

richfitz
Copy link
Member

@richfitz richfitz commented Nov 19, 2024

This PR automatically computes offsets when creating a packing object in C++

It also sneaks in a couple of things for mrc-ide/odin2#123:

  • add offset integer_sequence tool
  • sanitise package names from classes containing an underscore

R/compile.R Outdated
@@ -218,7 +218,7 @@ dust_template_data <- function(name,
has_adjoint = deparse1(has_adjoint),
parameters = deparse_df(parameters, 4),
default_dt = deparse1(default_dt),
package = paste0(name, mangle %||% ""),
package = paste0(gsub("[^A-Za-z1-9]", ".", name), mangle %||% ""),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you ever need a zero in a package name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, great catch

@richfitz richfitz merged commit 4f02d7c into main Nov 21, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants