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

Jinja macro-centric refactor & organization #155

Closed
dogversioning opened this issue Dec 8, 2023 · 2 comments
Closed

Jinja macro-centric refactor & organization #155

dogversioning opened this issue Dec 8, 2023 · 2 comments
Assignees

Comments

@dogversioning
Copy link
Contributor

We've had several discussions about jinja macros for readability recently, and we're on board with more liberal use of them. This ticket is about trying to do this in a structured way - the google approach seems like a reasonable analog to what we should be thinking about.

While this does not need to be done in one go, generally we should follow these steps:

  • When updating old templates, try to replace repeated/quirky control logic with macros
  • If you're using the same macro more than one file, move that macro to someplace inside of ./cumulus_library/template_sql/macros, and import it from there
  • if you're working on a downstream study, try to follow this same pattern, and merge shared, non-study specific macros back to the main library.

We'll close this issue by consensus when we feel like we've made enough progress on this that this pattern will be self-enforcing due to utility.

@dogversioning
Copy link
Contributor Author

Not specifying the binning structure for macros just yet - @mikix , we should chat about this a bit more?

@dogversioning dogversioning self-assigned this Jan 24, 2024
@dogversioning
Copy link
Contributor Author

Addressed via #177

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

No branches or pull requests

1 participant