NREL-reV 0.14.1__py3-none-any.whl → 0.14.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: NREL-reV
3
- Version: 0.14.1
3
+ Version: 0.14.2
4
4
  Summary: National Renewable Energy Laboratory's (NREL's) Renewable Energy Potential(V) Model: reV
5
5
  Author-email: Galen Maclaurin <galen.maclaurin@nrel.gov>
6
6
  Maintainer-email: Grant Buster <gbuster@nrel.gov>, Paul Pinchuk <ppinchuk@nrel.gov>
@@ -23,7 +23,7 @@ License-File: LICENSE
23
23
  Requires-Dist: NREL-gaps<0.9,>=0.8.0
24
24
  Requires-Dist: NREL-NRWAL<0.1,>=0.0.11
25
25
  Requires-Dist: NREL-PySAM~=7.0.0
26
- Requires-Dist: NREL-rex<0.4,>=0.3.2
26
+ Requires-Dist: NREL-rex<0.4,>=0.3.5
27
27
  Requires-Dist: numpy<3,>=2.0.2
28
28
  Requires-Dist: packaging<25,>=24.2
29
29
  Requires-Dist: plotly<7,>=6.0.1
@@ -1,7 +1,7 @@
1
- nrel_rev-0.14.1.dist-info/licenses/LICENSE,sha256=hDwoTANtan2ZpufBlXm5C3W_PJ-mCqItvlcobgjxL7k,1526
1
+ nrel_rev-0.14.2.dist-info/licenses/LICENSE,sha256=hDwoTANtan2ZpufBlXm5C3W_PJ-mCqItvlcobgjxL7k,1526
2
2
  reV/__init__.py,sha256=tXTpWu_qVo3uotfSw_TJ-gNbidGaIPPfUTwBlpCMJ-g,856
3
3
  reV/cli.py,sha256=u7G5M5moA7q8fCgC_1MB30Z7R14GNcngVf6eVNkfQU8,1682
4
- reV/version.py,sha256=en0eHrVgai6A_9JZVnfZf8ZSffqqCeB8YJG-3yS393g,51
4
+ reV/version.py,sha256=iZ2NEm6j_ZMkwjscuehf0I9OUwsEHrSS3xbfjV9LCbM,51
5
5
  reV/SAM/SAM.py,sha256=3NK9rRaJzqH6wz7CU_5XguKCRhmoilOpDdFFsFgOaxQ,33163
6
6
  reV/SAM/__init__.py,sha256=LJqoncyKDY5ZP5WA4kboh561bce11F9Ge645Izah0EY,240
7
7
  reV/SAM/defaults.py,sha256=JQMJomX7wsbMzxKjx_IMnA_9QFsV2yWCyl_JToDVSJo,6703
@@ -75,9 +75,9 @@ reV/rep_profiles/cli_rep_profiles.py,sha256=i3fRolT7HTzTQePXpNLDyxwgpRa7FEfHO1mO
75
75
  reV/rep_profiles/rep_profiles.py,sha256=dJ2jcklbelYYNS3IUXIYHg8E0poXLOWrwdqeBBnqYIE,48271
76
76
  reV/supply_curve/__init__.py,sha256=dbf0cO0qmt1VhV8dnDddztrcpnwua9T2HBhM6tLKaP8,274
77
77
  reV/supply_curve/aggregation.py,sha256=DvIUmj0PbZ8NxgOSmpXvzn9wJnOiQO2Xm2w_WCRVK-U,40908
78
- reV/supply_curve/cli_sc_aggregation.py,sha256=qGfJyZjg4tFARG2dl-wAlHv9KjEp2u4wg1Boxz18Gf0,3347
78
+ reV/supply_curve/cli_sc_aggregation.py,sha256=iDBHlUUPg-Ce4N4Rqb4scn8A_Ygq2q4i9v_ypbH-krs,3387
79
79
  reV/supply_curve/cli_supply_curve.py,sha256=e-XrHQIe4OqWTL6u-TUAyHrw7Alk7vkXQ2HoLbE3zTM,2163
80
- reV/supply_curve/cli_tech_mapping.py,sha256=ztNJhgk3WlSD5Gn7Rh3qBLMvX_pFkjuQT7qUK4s0P2w,1731
80
+ reV/supply_curve/cli_tech_mapping.py,sha256=Dirn4JOmu_3BIP7WgcRLAepsreKqmDhChHLPEUqcDAo,1735
81
81
  reV/supply_curve/competitive_wind_farms.py,sha256=eOjM72-4oWtsqxB7Wh2gnB2zVAt4LY3iPE_DqWdXbQ4,15795
82
82
  reV/supply_curve/exclusions.py,sha256=4-ZxTO5Vlu03vie0V_74uvdajQfCuC8FE96Pg8I4U_c,42950
83
83
  reV/supply_curve/extent.py,sha256=a31po753hXSxQ8lfcCvpE8hoKc4bY7MmYq0NO0jtdqA,17414
@@ -92,8 +92,8 @@ reV/utilities/curtailment.py,sha256=As902-2aLGnCiVEutYfAFIOwuV--_rCQhxGNOY9RB-4,
92
92
  reV/utilities/exceptions.py,sha256=f7sRGsbFLpmL6Caq_H1cD4GfVhnLMyvYUsLPA1UVDDE,3974
93
93
  reV/utilities/pytest_utils.py,sha256=spCw9yQ8KEYOkQZpCi9IEmaWIvIqHqbUPDXXNQJJ68U,3241
94
94
  reV/utilities/slots.py,sha256=xsw-JuUVZ0YeoCNuwP_HxGNxFMA4xRs1tuImXHIJqaU,2618
95
- nrel_rev-0.14.1.dist-info/METADATA,sha256=0EADVsx-loQXOEowljo4an8-FB9ZjXBm9XBC_Ie0edA,10733
96
- nrel_rev-0.14.1.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
97
- nrel_rev-0.14.1.dist-info/entry_points.txt,sha256=4IfJtZm2iMJwrbC8J0Or7VjZWnFpvCaHYVpvSWfIwDA,616
98
- nrel_rev-0.14.1.dist-info/top_level.txt,sha256=S6YF2ZYgXUB6n28SY0K2H8YB9tMJdXQ9CyQbo6VC89M,4
99
- nrel_rev-0.14.1.dist-info/RECORD,,
95
+ nrel_rev-0.14.2.dist-info/METADATA,sha256=lIgkZ3PQLu5YOtLYAP62nRtNVAhxkwRuHGqS_2mSwDY,10733
96
+ nrel_rev-0.14.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
97
+ nrel_rev-0.14.2.dist-info/entry_points.txt,sha256=4IfJtZm2iMJwrbC8J0Or7VjZWnFpvCaHYVpvSWfIwDA,616
98
+ nrel_rev-0.14.2.dist-info/top_level.txt,sha256=S6YF2ZYgXUB6n28SY0K2H8YB9tMJdXQ9CyQbo6VC89M,4
99
+ nrel_rev-0.14.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -6,6 +6,7 @@ import os
6
6
  import logging
7
7
 
8
8
  from rex.multi_file_resource import MultiFileResource
9
+ from rex.utilities.utilities import check_res_file
9
10
  from gaps.cli import as_click_command, CLICommandFromClass
10
11
 
11
12
  from reV.supply_curve.sc_aggregation import SupplyCurveAggregation
@@ -32,7 +33,7 @@ def _preprocessor(config, out_dir):
32
33
  dict
33
34
  Updated config file.
34
35
  """
35
- config = _format_res_fpath(config)
36
+ config = _validate_res_fpath(config)
36
37
  _validate_tm(config)
37
38
 
38
39
  key_to_modules = {"gen_fpath": [ModuleName.MULTI_YEAR,
@@ -47,32 +48,37 @@ def _preprocessor(config, out_dir):
47
48
  return config
48
49
 
49
50
 
50
- def _format_res_fpath(config):
51
- """Format res_fpath with year, if need be. """
51
+ def _validate_res_fpath(config):
52
+ """Format res_fpath with year (if needed) and check for file existence"""
52
53
  res_fpath = config.setdefault("res_fpath", None)
53
- if isinstance(res_fpath, str):
54
- if '{}' in res_fpath:
55
- for year in range(1950, 2100):
56
- if os.path.exists(res_fpath.format(year)):
57
- break
58
- else:
59
- msg = ("Could not find any files that match the pattern"
60
- "{!r}".format(res_fpath.format("<year>")))
61
- logger.error(msg)
62
- raise FileNotFoundError(msg)
63
-
64
- res_fpath = res_fpath.format(year)
65
-
66
- elif not os.path.exists(res_fpath):
67
- msg = "Could not find resource file: {!r}".format(res_fpath)
68
- logger.error(msg)
69
- raise FileNotFoundError(msg)
70
-
71
- config["res_fpath"] = res_fpath
54
+ if not isinstance(res_fpath, str):
55
+ return config
56
+
57
+ if '{}' in res_fpath:
58
+ config["res_fpath"] = _get_filepath_with_year(res_fpath)
59
+ else:
60
+ check_res_file(res_fpath)
72
61
 
73
62
  return config
74
63
 
75
64
 
65
+ def _get_filepath_with_year(res_fpath):
66
+ """Find first file that exists on disk with year filled in"""
67
+
68
+ for year in range(1950, 2100):
69
+ fp = res_fpath.format(year)
70
+ try:
71
+ check_res_file(fp)
72
+ except FileNotFoundError:
73
+ continue
74
+ return fp
75
+
76
+ msg = ("Could not find any files that match the pattern"
77
+ "{!r}".format(res_fpath.format("<year>")))
78
+ logger.error(msg)
79
+ raise FileNotFoundError(msg)
80
+
81
+
76
82
  def _validate_tm(config):
77
83
  """Check that tm_dset exists or that res_fpath is given (to generate tm)"""
78
84
  paths = config["excl_fpath"]
@@ -9,7 +9,7 @@ from gaps.cli import as_click_command, CLICommandFromClass
9
9
  from reV.supply_curve.tech_mapping import TechMapping
10
10
  from reV.utilities import ModuleName
11
11
  from reV.utilities.exceptions import ConfigError
12
- from reV.supply_curve.cli_sc_aggregation import _format_res_fpath
12
+ from reV.supply_curve.cli_sc_aggregation import _validate_res_fpath
13
13
 
14
14
  logger = logging.getLogger(__name__)
15
15
 
@@ -28,7 +28,7 @@ def _preprocessor(config):
28
28
  Updated config file.
29
29
  """
30
30
  _validate_excl_fpath(config)
31
- config = _format_res_fpath(config)
31
+ config = _validate_res_fpath(config)
32
32
  _validate_dset(config)
33
33
 
34
34
  return config
reV/version.py CHANGED
@@ -2,4 +2,4 @@
2
2
  reV Version number
3
3
  """
4
4
 
5
- __version__ = "0.14.1"
5
+ __version__ = "0.14.2"