Skip to content

Move all state variables into environment within package #39

@ethanplunkett

Description

@ethanplunkett

Instead of using constants in the package or writing to variables to the global (user's) environment, store state variables in a config environment within the package.

  • Create config environment and assign default values to it.

  • Move most of the items in in globals.R to config by adding a prefix config$ when assigning and retrieving them. If there's any chance it would change in a different deployment it should be in config and not defined as a global constant in the package.

  • Move state variables created by set_s3_config and retrieved by get_s3_config to the config environment. Replace assign() with config$option <- .

  • Add Items in config to set:

    • local_temp_path
    • log_file_path,
    • log (flag to turn logging on and off)
  • Update logging to honor log_file_path and log

  • Update flow to honor local_temp_path

  • Write function to set and retrieve options. See example

  • Move set_s3_config and get_s3_config into s3_config.R (from flow.R)

  • Set all list items as variables in config using config$...

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions