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

Bnb/meta enum #451

Merged
merged 63 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
30637a3
init commit
bnb32 May 2, 2024
08d091b
MetaKeyName class for replacing hardcoded strings in summaries and metas
bnb32 May 3, 2024
2b6b919
fix: bad replacements
bnb32 May 12, 2024
477aa73
lint: line breaks after binary operators
bnb32 May 12, 2024
227e1af
lint: lines too long
bnb32 May 12, 2024
d3253c3
probably dont need aliases for country, state, and county
bnb32 May 12, 2024
73515d2
MetaKeyName enum: init commit
bnb32 May 12, 2024
664eaf4
all MetaKeyName replacements and imports
bnb32 May 12, 2024
cc4b85e
linting after replacements
bnb32 May 13, 2024
1a12433
fix: missing imports and long lines.
bnb32 May 13, 2024
45e8717
seemlingly unused numpy import actually needed for eval call on strin…
bnb32 May 13, 2024
b64d831
need pylint disable=unused-import statement also.
bnb32 May 13, 2024
71e4858
fix: case insensitive replacement broke some gen tests.
bnb32 May 13, 2024
04aeca7
nobody likes long lines
bnb32 May 13, 2024
5c66da7
Add eos mult and reg mult to meta enum
ppinchuk May 20, 2024
414f68e
Walk back changes pt 1
ppinchuk May 20, 2024
538f260
Add county, state, country, enum values
ppinchuk May 20, 2024
33cfd26
Walk back changes pt 2
ppinchuk May 20, 2024
7b47085
Add `ResourceMetaField` enum
ppinchuk May 20, 2024
0fe7a68
Fix missing 'cf_profile' keys
ppinchuk May 20, 2024
dbfe47e
Format string
ppinchuk May 20, 2024
906c6b7
Add `SiteDataField` enum
ppinchuk May 20, 2024
d5a6c70
Walk back changes final
ppinchuk May 20, 2024
e6a66af
Merge branch 'bnb/sc_columns_enum' into bnb/meta_enum
ppinchuk May 20, 2024
2a45169
Linter fixes
ppinchuk May 20, 2024
bb53ab1
Fix tests
ppinchuk May 20, 2024
27e4e34
Fix tests
ppinchuk May 21, 2024
bca098b
Add `variable_operating_cost` enum value
ppinchuk May 21, 2024
a55a768
Fix test
ppinchuk May 21, 2024
5c05c47
Fix reVX test (hopefully)
ppinchuk May 21, 2024
4866bca
MetaKeyName -> SupplyCurveField. more descriptive and match other enu…
bnb32 May 27, 2024
49da781
some enum class methods for mapping between sc fields, res fields, an…
bnb32 May 28, 2024
a8ab4c8
all bespoke tests passing. exclusion file in `test_bespoke_5min_sampl…
bnb32 May 29, 2024
51c12d8
need conditional axis selection for field renaming in tz_elev_check. …
bnb32 May 29, 2024
d3142b7
Don't use Enum in pytest parametrize
ppinchuk May 29, 2024
ce68fec
Rename meta columns when reading data
ppinchuk May 29, 2024
36d00ef
Don't use enum in pytest parametrize pt 2
ppinchuk May 29, 2024
3b8deff
using `.name.lower` to match fixed sc point attributes
bnb32 May 29, 2024
4687ed6
Use supply curve field names for lookup
ppinchuk May 29, 2024
f604e81
`extra_atts` now agnostic to changes in field values
ppinchuk May 29, 2024
073f227
Use `ResourceMetaField` when looking at gen file meta columns
ppinchuk May 29, 2024
078bebc
Fix tests
ppinchuk May 29, 2024
8b2f060
Merge remote-tracking branch 'origin/bnb/meta_enum' into bnb/meta_enum
ppinchuk May 29, 2024
a11bc33
Linter fix
ppinchuk May 29, 2024
fa71fd6
map_from_legacy method with internal access to old name dict for base…
bnb32 May 29, 2024
123162c
re: private legacy name map within enums - not fancy but this works.
bnb32 May 29, 2024
7dd1090
Use `ResourceMetaField` for accessing gen fields
ppinchuk May 29, 2024
3c22616
Fix tests
ppinchuk May 29, 2024
5f8ffb0
Use `SupplyCurveField` enum
ppinchuk May 29, 2024
7c72c62
Fix tests
ppinchuk May 29, 2024
da09ca7
Fix NRWAL tests
ppinchuk May 29, 2024
96f7eff
Fix QA/QC tests
ppinchuk May 29, 2024
8e7f398
Fix tests
ppinchuk May 29, 2024
6fcaefc
Fix tests
ppinchuk May 29, 2024
549a5a1
Fix tests
ppinchuk May 29, 2024
d338e0e
Fix tests
ppinchuk May 29, 2024
bd71b0e
Performn column rename when parsing table
ppinchuk May 29, 2024
f2b8136
Fix tests
ppinchuk May 29, 2024
14c794b
Fix test
ppinchuk May 29, 2024
dddf821
Updated handling of aliases
ppinchuk May 30, 2024
f6f677e
Bump version
ppinchuk May 30, 2024
2cecd2b
Linter fixes
ppinchuk May 30, 2024
b267dac
Linter fix
ppinchuk May 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions examples/aws_pcluster/make_project_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
from rex import Resource


if __name__ == '__main__':
fp = '/nrel/nsrdb/v3/nsrdb_2019.h5'
fp = '/nrel/wtk/conus/wtk_conus_2007.h5'
Expand All @@ -22,7 +21,7 @@

print(meta[mask])
pp = meta[mask]
pp['gid'] = pp.index.values
pp["gid"] = pp.index.values
pp['config'] = 'def'
pp = pp[['gid', 'config']]
pp = pp[["gid", 'config']]
pp.to_csv('./points_front_range.csv', index=False)
25 changes: 15 additions & 10 deletions examples/bespoke_wind_plants/single_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
"""
An example single run to get bespoke wind plant layout
"""
import numpy as np
import matplotlib.pyplot as plt
from reV.bespoke.bespoke import BespokeSinglePlant
from reV.bespoke.plotting_functions import plot_poly, plot_turbines,\
plot_windrose
from reV import TESTDATADIR
from reV.supply_curve.tech_mapping import TechMapping

import json
import os
import shutil
import tempfile

import matplotlib.pyplot as plt
import numpy as np

from reV import TESTDATADIR
from reV.bespoke.bespoke import BespokeSinglePlant
from reV.bespoke.plotting_functions import (
plot_poly,
plot_turbines,
plot_windrose,
)
from reV.supply_curve.tech_mapping import TechMapping

SAM = os.path.join(TESTDATADIR, 'SAM/i_windpower.json')
EXCL = os.path.join(TESTDATADIR, 'ri_exclusions/ri_exclusions.h5')
RES = os.path.join(TESTDATADIR, 'wtk/ri_100_wtk_{}.h5')
Expand All @@ -29,7 +33,7 @@
'ri_reeds_regions': {'inclusion_range': (None, 400),
'exclude_nodata': False}}

with open(SAM, 'r') as f:
with open(SAM) as f:
SAM_SYS_INPUTS = json.load(f)

SAM_SYS_INPUTS['wind_farm_wake_model'] = 2
Expand All @@ -56,7 +60,8 @@
1E5 * 0.1 + (1 - 0.1))"""
objective_function = "cost / aep"

output_request = ('system_capacity', 'cf_mean', 'cf_profile')
output_request = ('system_capacity', 'cf_mean',
'cf_profile')
gid = 33
with tempfile.TemporaryDirectory() as td:
excl_fp = os.path.join(td, 'ri_exclusions.h5')
Expand Down
5 changes: 3 additions & 2 deletions examples/marine_energy/plot_lcoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
Simple plot script for wave LCOE
"""
import os
import pandas as pd

import matplotlib.pyplot as plt
import pandas as pd

fps = ['./atlantic_rm5/atlantic_rm5_agg.csv',
'./pacific_rm5/pacific_rm5_agg.csv',
]

for fp in fps:
df = pd.read_csv(fp)
a = plt.scatter(df.longitude, df.latitude, c=df['mean_lcoe'],
a = plt.scatter(df.longitude, df.latitude, c=df["mean_lcoe"],
s=0.5, vmin=0, vmax=1500)
plt.colorbar(a, label='lcoe_fcr ($/MWh)')
tag = os.path.basename(fp).replace('_agg.csv', '')
Expand Down
Loading
Loading