-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add wetbulb temp and darkness fraction functions to era5_data_a… #29
Conversation
41d7685
to
5ef9b71
Compare
cd7fcda
to
55ba46c
Compare
5ef9b71
to
3bf669a
Compare
…gg.py, now renamed weather_data_agg.py
55ba46c
to
ad7411c
Compare
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 good from my end
3d44358
to
84cbe57
Compare
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.
There are a few minor places where we will want to clean things up, but I think this is safe to merge into evan/zone_profile_gen
for now, and we can focus on those issues (and any others that pop up) before that branch gets merged.
) | ||
|
||
|
||
state_list = [ |
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.
Now that we have state abbreviations in prereise.gather.const
, we can use them (plus "DC"
, and minus "AK"
and "HI"
) to build this list.
puma_dark_frac.to_csv( | ||
f"https://besciences.blob.core.windows.net/datasets/bldg_el/pumas/dark_frac/dark_frac_pumas_{state}_{year}.csv", | ||
index=False, | ||
) |
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 the meaning here (and within generate_wetbulb_temps
) is 'save these CSVs, then upload them to the blob storage so that they can be retrieved later', but please correct me if I'm wrong.
If so, I don't think we can currently write to the blob storage this way, so we'll need to change this to write to local files and then perform the upload ourselves.
# Create folder to store data for given variable if it doesn't yet exist | ||
# Create folder to store data for given variable if it doesn"t yet exist |
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.
black
is being silly
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 see the only thing left is to add several libraries into the pipenv file, cdsapi, psychrolib, xarray, suntime.
#29) * feat: add wetbulb temp and darkness fraction functions to era5_data_agg.py, now renamed weather_data_agg.py * chore: code style cleanup * chore: import sorting * chore: linting fixes Co-authored-by: Daniel Olsen <[email protected]>
* feat: puma latitude and longitude added to puma_data dataframe * feat: puma latitude/longitude csv to be appeneded to puma_data * feat: national pumas and balanacing authorities shapefiles * feat: zone profile generator * refactor: linting * refactor: linting * refactor: replace while loop in bkpt_scale() with a sorting method * refactor: move all logic within functions or if block (#26) * refactor: simplify hourly_load_fit and improve pandas 1.3 compatibility (#27) * zone_profile_gen.py updates from Evan - puma.area error fix, cooling equations update, zonal_data() refactor, wb/db fit update, profile year added * feat: updated min daily number of load/temp points to fit to from 8 to 10 * feat: folder for generated profiles * feat: folder for zone day hour coefficients * feat: hourly fits graphs, profile stats export * "profiles, hourly fits, and profile graphs" * graphs * profiles for zones in NY, CA, and TX. update to zone_profile_generator to account for puma_data year update * linting * linting * feat: add wetbulb temp and darkness fraction functions to era5_data_a… (#29) * feat: add wetbulb temp and darkness fraction functions to era5_data_agg.py, now renamed weather_data_agg.py * chore: code style cleanup * chore: import sorting * chore: linting fixes Co-authored-by: Daniel Olsen <[email protected]> * Mike/weather write fix (#30) * fix: reference const.state_list * refactor: save dark_frac output to local files * refactor: save temps_wetbulb to local files * chore: remove unused state_list * style: linting fixes with black * fix: remove 2010 reference for cdd65 * chore: update puma_data * refactor: use base_year from const.py * refactor: rename load_year to base_year * Yinbo/zone profile gen refactor (#32) * Fix: create output folders if the address is not exist on local machine; Refactor: add plot_boolean to control whether or not plot result profiles * test * style: style correction using 'black' * style:switch the order of package importing * style * chore: change os.path.exists to os.path.isdir in order to avoid same file names * chore: add docstring * style: docstring style fixed Co-authored-by: danielolsen <[email protected]> Co-authored-by: Daniel Olsen <[email protected]> Co-authored-by: mbwaite <[email protected]> Co-authored-by: yinboHU <[email protected]>
…gg.py, now renamed weather_data_agg.py
Pull Request doc
Purpose
What is the larger goal of this change?
Add wetbulb temperature and darkness fraction functions to era5_data_agg script, now named weather_data_agg.py
What the code is doing
How is the purpose executed?
The same code that was used to generate wetbulb temperatures and darkness fractions, just moved into modular functions within this script
Testing
How did you test this change (unit/functional testing, manual testing, etc.)?
New functions produced correct output csv's.
Where to look
New functions added to this file:
-dark_fractions()
-generate_dark_fracs()
-t_to_twb()
-generate_wetbulb_temps()
weather_data_agg.py
Time estimate
How long will it take for reviewers and observers to understand this code change?
5 minutes