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

Rep-specific seeds in tar_rep(), tar_map_rep(), etc. #111

Closed
3 tasks done
wlandau opened this issue Oct 14, 2022 · 5 comments
Closed
3 tasks done

Rep-specific seeds in tar_rep(), tar_map_rep(), etc. #111

wlandau opened this issue Oct 14, 2022 · 5 comments
Assignees

Comments

@wlandau
Copy link
Member

wlandau commented Oct 14, 2022

Prework

  • I understand and agree to the code of conduct and contributing guidelines.
  • If there is already a relevant issue, whether open or closed, comment on the existing thread instead of posting a new issue.
  • New features take time and effort to create, and they take even more effort to maintain. So if the purpose of the feature is to resolve a struggle you are encountering personally, please consider first posting a "trouble" or "other" issue so we can discuss your use case and search for existing solutions first.

Proposal

I originally thought this might obfuscate targets' seed-setting behavior, but currently there is a lot of frustration when the batching scheme changes. Ideally the seeds should stay the same when batches * reps stays the same. A tarchetypes at-runtime function could set its own seed that depends on the pattern target name, batch index, and rep index. These special seeds would be saved with target output.

@wlandau wlandau self-assigned this Oct 14, 2022
@wlandau
Copy link
Member Author

wlandau commented Oct 14, 2022

Hash of the pattern target name and ‘rep_index + n_reps_per_batch * (batch_index - 1)’

@wlandau
Copy link
Member Author

wlandau commented Oct 17, 2022

Should affect most non-deprecated functions with batching:

  • tar_rep_raw() (see tar_rep_run_map_rep())
  • tar_map_rep_raw()
  • tar_rep2_raw() (see tar_rep2_run_rep())
  • tar_map2_raw() (see tar_map2_run_rep()) (automatically gets us tar_map2_size() and tar_map2_count() for free)
  • tar_render_rep_raw() (see tar_render_rep_rep())
  • tar_quarto_rep_raw() (see tar_quarto_rep_raw()) (even though the Quarto CLI runs in a separate process and seems to set a random seed. This could change at some point.)

Also:

  • Document new output column "tar_seed".

@wlandau
Copy link
Member Author

wlandau commented Oct 18, 2022

Fixed in #113

@wlandau wlandau closed this as completed Oct 18, 2022
@wlandau
Copy link
Member Author

wlandau commented Sep 5, 2023

I will need to reimplement this along the lines of ropensci/targets#1139.

@wlandau
Copy link
Member Author

wlandau commented Sep 6, 2023

From ropensci/targets#1139 (comment), I may not have plans in tarchetypes to rework seeds.

@wlandau wlandau closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2023
@wlandau wlandau reopened this Sep 23, 2023
@wlandau wlandau closed this as completed Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant