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 docker_base to use inversion of control #421

Merged
merged 4 commits into from Jan 5, 2024

Conversation

lathanh
Copy link
Collaborator

@lathanh lathanh commented Nov 30, 2023

Pull Request Description

Use inversion of control in docker_base so that it can more strongly and easily ensure consistency between various implementations (GCP implementation to come).

This also includes teasing apart the several batch prep steps (weather, assets, and jobs) into their own methods so they can each be more easily understood, shared, and maintained.

Checklist

Not all may apply

  • Code changes (must work)
    • This code works with the GCP implementation in our fork (to be merged later); we're unable to try it on AWS.
  • Tests exercising your feature/bug fix (check coverage report on Checks -> BuildStockBatch Tests -> Artifacts)
    • test_docker_base.py passes
  • Coverage has increased or at least not decreased. Update minimum_coverage in .github/workflows/coverage.yml as necessary.
  • All other unit and integration tests passing
  • Update validation for project config yaml file changes
  • Update existing documentation
  • Run a small batch run on Kestrel/Eagle to make sure it all works if you made changes that will affect Kestrel/Eagle
  • Add to the changelog_dev.rst file and propose migration text in the pull request

Copy link

github-actions bot commented Nov 30, 2023

File Coverage
All files 86%
base.py 90%
exc.py 57%
hpc.py 78%
local.py 70%
postprocessing.py 84%
utils.py 91%
cloud/docker_base.py 89%
sampler/base.py 79%
sampler/downselect.py 33%
sampler/precomputed.py 93%
sampler/residential_quota.py 61%
test/shared_testing_stuff.py 85%
test/test_docker.py 33%
test/test_validation.py 97%
workflow_generator/base.py 90%
workflow_generator/commercial.py 53%
workflow_generator/residential_hpxml.py 86%

Minimum allowed coverage is 33%

Generated by 🐒 cobertura-action against eccb933

@lathanh lathanh marked this pull request as ready for review November 30, 2023 01:23
Copy link
Member

@nmerket nmerket left a comment

Choose a reason for hiding this comment

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

Today I learned inversion of control. Thanks for that. This looks good to me. I still would like to see these PRs getting entries in the changelog, so we can track when these things go in. Thanks for doing this. I'm really interested in seeing where this goes.

@lathanh
Copy link
Collaborator Author

lathanh commented Dec 4, 2023

I still would like to see these PRs getting entries in the changelog, so we can track when these things go in.

Sure; done!

nweires and others added 2 commits December 8, 2023 11:08
# Conflicts:
#	buildstockbatch/cloud/docker_base.py
#	docs/changelog/changelog_dev.rst
@lathanh lathanh requested a review from nmerket December 11, 2023 21:32
@nmerket nmerket merged commit a047cf7 into NREL:develop Jan 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants