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

Added greenbutton_objects #218

Closed
wants to merge 0 commits into from
Closed

Conversation

AdamFinkle
Copy link
Collaborator

Added greenbutton_objects to parse Green Button XML electric and natural gas bills and wrote tests for the same, pydantic models for the same, and tests for the pydantic models.

@thadk
Copy link
Member

thadk commented Jul 3, 2024

Ah, at least in the 4th failing test in javascript, to make that pass Test, build, & deploy / ⚡ Heat-Stack - Vitest pyodide.test.ts (pull_request) we need to add new code to download and install the greenbutton_objects library in javascript python aka pyodide, sort of the equivalent of requirements.txt

@AdamFinkle
Copy link
Collaborator Author

AdamFinkle commented Jul 3, 2024

I have corrected the linting error and the first MyPy error part, which was a typing signature mismatch. The second part of the MyPy error seems to involve the lack of typing in greenbutton_objects, which I could correct in one of three ways:

  1. Add type hints to greenbutton_objects
  2. Generate stubs for greenbutton_objects, potentially with the automatic stub generator of mypy, perhaps requiring these stubs to be installed into HEAT separately
  3. Suppress this warning by suffixing the relevant greenbutton_python import statement with # type: ignore

I have chosen option three for now and made type hinting an issue for later. The pytest failure doesn't happen on my end and seems to be an off-by-one error, which may be caused by a difference between the GitHub pytest environment and the one on my end, where I have carefully checked the expected result saved in the .txt file and found that it matches the code.

@AdamFinkle
Copy link
Collaborator Author

AdamFinkle commented Jul 11, 2024

All but the last two tests now pass. Trying additional National Grid .csv and .xml files does not yet work.

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