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

Initial addition of validation capabilities #68

Merged
merged 15 commits into from Jul 26, 2019
Merged

Conversation

rHorsey
Copy link
Contributor

@rHorsey rHorsey commented Jul 1, 2019

@nmerket @joseph-robertson Some initial thoughts for our discussion tomorrow.

Cheers,

…around the cli parsing functionality and intended direction.
@rHorsey rHorsey added DO NOT MERGE PR is open but please don't merge! enhancement New feature or request labels Jul 1, 2019
@nmerket nmerket mentioned this pull request Jul 2, 2019
@nmerket
Copy link
Member

nmerket commented Jul 22, 2019

@rHorsey What do we need to do to get this ready to merge?

@rHorsey
Copy link
Contributor Author

rHorsey commented Jul 22, 2019

@nmerket A few more hours. Once I'm happy with my understanding of existing testing I'll extend it. I have a good example yml already.

@rHorsey rHorsey added help wanted Extra attention is needed and removed DO NOT MERGE PR is open but please don't merge! labels Jul 22, 2019
@rHorsey
Copy link
Contributor Author

rHorsey commented Jul 22, 2019

@nmerket This is ready for review.

@rHorsey rHorsey requested a review from nmerket July 22, 2019 19:00
@rHorsey
Copy link
Contributor Author

rHorsey commented Jul 22, 2019

Also @nmerket I'm not sure why that col-names are causing issues in the test. I reran the master tests and buildstockbatch/test/test_base.py::test_combine_files fails with the same error as in this branch. See https://circleci.com/gh/NREL/buildstockbatch/156

@rajeee
Copy link
Contributor

rajeee commented Jul 22, 2019

Also @nmerket I'm not sure why that col-names are causing issues in the test. I reran the master tests and buildstockbatch/test/test_base.py::test_combine_files fails with the same error as in this branch. See https://circleci.com/gh/NREL/buildstockbatch/156

@rHorsey Apparently, the order of the columns are different between the reference results.csv and the results.csv created during the test.

When I run the pytest on the latest master in my computer, it is working fine.

Two solutions that comes to mind (both of which involves some coding on my part):

  1. Ensure that the column orders remain consistent when when creating the results.csv. My guess is the column are created by iterating over the keys of a dictionary or using dask's to_dataframe function , which doesn't always return things in the same order.

  2. Make the testing column-order independent.

I think option 1 is probably a better idea for consistency, but option 2 would make the testing a bit more flexible to future (deliberate) order changes. Maybe a combination of both?

@rHorsey rHorsey added needs review and removed help wanted Extra attention is needed labels Jul 22, 2019
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.

I like where this is going. I think there's some stuff missing from the validation, which I commented on.

@joseph-robertson I assume we'll do extra validation against what's in NREL/OpenStudio-BuildStock as another PR?

buildstockbatch/__version__.py Outdated Show resolved Hide resolved
buildstockbatch/eagle.py Outdated Show resolved Hide resolved
buildstockbatch/eagle.py Outdated Show resolved Hide resolved
buildstockbatch/localdocker.py Show resolved Hide resolved
buildstockbatch/peregrine.py Outdated Show resolved Hide resolved
buildstockbatch/schemas/v0.1.yaml Show resolved Hide resolved
buildstockbatch/schemas/v0.1.yaml Show resolved Hide resolved
buildstockbatch/schemas/v0.1.yaml Show resolved Hide resolved
buildstockbatch/schemas/v0.1.yaml Outdated Show resolved Hide resolved
buildstockbatch/schemas/v0.1.yaml Outdated Show resolved Hide resolved
@joseph-robertson
Copy link
Contributor

I like where this is going. I think there's some stuff missing from the validation, which I commented on.

@joseph-robertson I assume we'll do extra validation against what's in NREL/OpenStudio-BuildStock as another PR?

@nmerket Sounds good to me.

Copy link
Contributor Author

@rHorsey rHorsey left a comment

Choose a reason for hiding this comment

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

@nmerket Ready for a second round of reviews. Thanks for the CLI test! Thoughts on allowing cfg['eagle']['n_jobs'] to not be set?

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.

@rHorsey A few more minor comments and suggestions.

As for cfg['eagle']['n_jobs'] If we have a good default, we could let it not be set. Do you have a recommendation for a default or a nice way to calculate the number of jobs we should use?

One last thought, this probably needs some testing with real project files that are in use "out in the wild". I'm on the fence of whether I 1.) collect a few project files from people and run them through the validation, or 2.) just merge this and deal with the backlash.

I should probably do 1. I'll go ask around for some project files.

buildstockbatch/base.py Show resolved Hide resolved
buildstockbatch/localdocker.py Outdated Show resolved Hide resolved
buildstockbatch/schemas/v0.1.yaml Show resolved Hide resolved
Tks Noel!!!

Co-Authored-By: Noel Merket <noel.merket@nrel.gov>
@rHorsey
Copy link
Contributor Author

rHorsey commented Jul 25, 2019

@nmerket Please do. @ekpresent sent me what she's been using in the wild, which is what the complete test file is based off of. If you can find some more that'd be great. Otherwise I think we're ready to merge. Also I'm not opposed to 2.

@nmerket
Copy link
Member

nmerket commented Jul 26, 2019

I got a few yaml files. I'll run them through the validator this morning as a sanity check. Otherwise this looks good to me.

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.

@rHorsey I made one change to the csv export measure arguments. Namely that I'm not validating them. We'll write a separate validator for that.

This is ready to merge. I ran CI locally because OS Standards was taking too long.

@nmerket nmerket merged commit 1b9990b into master Jul 26, 2019
@nmerket nmerket deleted the rHorsey/validation branch July 26, 2019 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants