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

refactor: templateFiles as dict instead of individual parameters insetTemplateFilename #36

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

ombahiwal
Copy link
Contributor

@ombahiwal ombahiwal commented Jan 24, 2025

from list of issues #17

  • Issue: Pass all the template files in a dictionary instead of all of them individually like here.

Changes:

  • The function setTemplateFilename now takes a single templateFiles dictionary as an argument, where keys are the names of the expected filenames (like EDfilename, SEDfilename, etc.) and values are the actual filenames (e.g., 'EDtemplate', 'SEDtemplate', etc.).
  • The function loops over the templateFiles dict. For each key-value pair, it processes the file similarly to how it did for individual parameters before, checking the filename extension and constructing the file path.
  • By using a dict, you can easily add or remove template files without changing the function signature or adding new parameters. It's now easier to modify and extend the template setup.

@ombahiwal
Copy link
Contributor Author

@rthedin

Reverting back several changes that were made incorrectly.
Lots of checks were simply deleted, tempates given as filepaths were
replaced incorrectly with filename, among a few other things. Overall
the proposed logic of having a dictionary was kept.
@rthedin
Copy link
Collaborator

rthedin commented Feb 27, 2025

Lots of changes made to make sure the proposed changes are in line with what was already in the code. Unfortunately with the refactor, several checks and details were deleted and had to be restored. Additional checks on the input dictionary has been put in place too.

@rthedin
Copy link
Collaborator

rthedin commented Feb 27, 2025

This is good to go. Thanks for the contribution, @ombahiwal.

@rthedin rthedin merged commit d764333 into OpenFAST:main Feb 27, 2025
5 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