Prevent blank CSV fields in generated AMY EPW files - #75
Open
ericmartinpe wants to merge 1 commit into
Open
Conversation
fields and add test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create_amy_epw_filecould write blank fields into the output EPW file when AMY values were missing and not fully resolved by interpolation/imputation, producing malformed CSV rows (double commas). This PR ensures every observation field is always populated, and fixes a related issue where the output directory wasn't created if it didn't already exist.Changes
create_amy_epw_file.py:amy_epw_dirviaos.makedirsif it doesn't already exist, instead of failing.Flagscolumn so synthesized leap-day rows don't leave the EPW flag field empty.Tdb,Tdew,Patm,Wdir, andWspeed: any AMY value still missing after interpolation/imputation now falls back first to the corresponding TMY observation, then to forward/backward fill, and finally to the EPW-standard missing-value sentinel (e.g.99.9,999999,999) as a last resort — so no field is ever left blank.tests/test_create_amy_epw_file.py:test_no_empty_fields_in_observation_rows, which generates a file and asserts no observation row contains a,,(empty field).test_creates_missing_output_directory, which verifiesamy_epw_diris created automatically (including nested paths) and the resulting file is valid.Test plan