-
Notifications
You must be signed in to change notification settings - Fork 22
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
ci: add flake8 and fix warnings #79
Conversation
@@ -74,7 +71,7 @@ def extract_data(results): | |||
outputs = {} | |||
|
|||
tic = time.process_time() | |||
for filename in tqdm(results): | |||
for i, filename in tqdm(enumerate(results)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an easy way to test this but I believe we reference this here (currently L88, below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you're right. This is an artifact of our previous load shedding strategy: on any infeasible interval, shed 5% of the original demand for that interval and re-run (as many times as necessary), so that a string of interval_num:shed_amount_...
is enough to specify all load shedding details.
Breakthrough-Energy/PowerSimData#219 is related to the need to improve the summarization of load shed results in the new more-flexible load shedding method.
{format,checkformatting}: black | ||
{format,checkformatting}: isort | ||
flake8: flake8 | ||
changedir = pyreisejl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this file was copied from powersimdata but I added the changedir
option so passing the current directory to commands still works. Also, the flake8 ignore section is customized for this repo.
Why do we change version numbers in |
Added pytest so when tox sets up the environment to run tests, it can simply install from requirements.txt instead of having pytest as a separate dependency. Changed versions to compatible release, which would be the same as adding a |
Do we know for sure that these new version are compatible with everything that we're doing on the python side? Our test coverage is pretty poor at this point, we're not actually testing to ensure that we can read and convert .mat files in the way that REISE.jl is currently producing them. |
I can't say much about it unless we've tested with what is checked into |
@jon-hagg I see what you mean now, this way is indeed cleaner. To improve the test coverage here, I think the ultimate thing to do is to:
|
Agreed, I think that's really the only way to validate compatibility for sure. Semantic versioning is good but not quite enough. Side note, we could probably run the existing julia tests in github as well (something to look into when there is time) |
|
||
[testenv] | ||
deps = | ||
pytest: -rrequirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here? rrequirements
-> requirements
? Should this typo create an error in the CI check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is actually right (otherwise I'd expect pytest to fail) - docs here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa! TIL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
Purpose
Add flake8 linting as done in powersimdata and refactor the github action yaml to use tox. Fixes include defining an undefined variable and removing unused imports.
What it does