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

Remove loops over calendar types where not needed #767

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

mjs2369
Copy link
Contributor

@mjs2369 mjs2369 commented Nov 5, 2024

Description:

The subroutines set_calendar_type_string and get_calendar_string in the time_manager_mod have unnecessary loops over the number of max_types (calendar types). This PR removes these loops for improved code efficiency and readability

Fixes issue

fixes #653

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Ran model_mod_check and filter with print statements to ensure the correct calendar_type was being set/used

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

@hkershaw-brown
Copy link
Member

For commits like these, where you've just missed something from the commit (removing the loop variable) and there aren't a bunch of people working with the pull request, you can rebase and squash the commits together.
I'll go ahead an squish them.

@hkershaw-brown hkershaw-brown added the release+1 bundle with release after next label Nov 6, 2024
@hkershaw-brown hkershaw-brown added release! bundle with next release and removed release+1 bundle with release after next labels Nov 7, 2024
Copy link
Member

@hkershaw-brown hkershaw-brown left a comment

Choose a reason for hiding this comment

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

Looks good Marlee!

For reference I added (and tested with) a unit test in the DART-tests repo:
https://github.com/NCAR/DART-tests/tree/main/unit/time_manager_mod

@hkershaw-brown hkershaw-brown merged commit 646c376 into main Nov 8, 2024
4 checks passed
@hkershaw-brown hkershaw-brown deleted the calendar_loops branch November 8, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release! bundle with next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

loops over calendar types are unneeded
2 participants