Skip to content

Commit 1d4074e

Browse files
authored
Maintenance: Complete Adoption of project.toml (NREL#273)
* convert project to rely entirely on pyproject.toml where able * fix typo * update keywords * fix bad cleansed data ignore setting
1 parent bfea0b8 commit 1d4074e

File tree

4 files changed

+145
-133
lines changed

4 files changed

+145
-133
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ junit-xml-report.xml
2727

2828
examples/operational_AEP_analysis/data/*.csv
2929
examples/turbine_analysis/data/*.csv
30-
examples/cleansed
30+
examples/data/cleansed
3131

3232
examples/data/kelmarsh/
3333
examples/data/penmanshiel/

pyproject.toml

+142-21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,145 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools-scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[metadata]
6+
version = "attr: openoa.__version__"
7+
8+
[project]
9+
name = "OpenOA"
10+
dynamic = ["version"]
11+
authors = [{name = "NREL PRUF OA Team", email = "[email protected]"}]
12+
readme = {file = "readme.md", content-type = "text/markdown"}
13+
description = "A package for collecting and assigning wind turbine metrics"
14+
requires-python = ">=3.8, <3.12"
15+
license = {file = "LICENSE.txt"}
16+
dependencies = [
17+
"scikit-learn>=1.0",
18+
"requests>=2.21.0",
19+
"eia-python>=1.22",
20+
"pyproj>=3.5",
21+
"shapely>=1.8",
22+
"numpy>=1.24",
23+
"pandas>=2.2",
24+
"pygam>=0.9.0",
25+
"scipy>=1.7",
26+
"statsmodels>=0.11; python_version<'3.11'",
27+
"statsmodels>=0.13.3; python_version=='3.11'",
28+
"tqdm>=4.28.1",
29+
"matplotlib>=3.6",
30+
"bokeh>=3.3",
31+
"attrs>=22.2",
32+
"pytz",
33+
"pyyaml",
34+
"tabulate",
35+
"ipython",
36+
]
37+
keywords = [
38+
"python3",
39+
"wind-energy",
40+
"operations",
41+
"operational-analysis",
42+
"operational-assessement",
43+
"turbine-performance",
44+
"wind-plant-performance",
45+
]
46+
classifiers = [ # https://pypi.org/classifiers/
47+
"Development Status :: 5 - Production/Stable",
48+
"Intended Audience :: Developers",
49+
"Intended Audience :: Science/Research",
50+
"Intended Audience :: Other Audience",
51+
"License :: OSI Approved :: BSD License",
52+
"Natural Language :: English",
53+
"Operating System :: OS Independent",
54+
"Programming Language :: Python",
55+
"Programming Language :: Python :: 3 :: Only",
56+
"Programming Language :: Python :: 3.8",
57+
"Programming Language :: Python :: 3.9",
58+
"Programming Language :: Python :: 3.10",
59+
"Programming Language :: Python :: 3.11",
60+
"Topic :: Scientific/Engineering",
61+
"Topic :: Software Development :: Libraries :: Python Modules",
62+
"Typing :: Typed",
63+
]
64+
65+
[project.urls]
66+
source = "https://github.com/NREL/OpenOA"
67+
documentation = "https://openoa.readthedocs.io/"
68+
issues = "https://github.com/NREL/OpenOA/issues"
69+
changelog = "https://github.com/NREL/OpenOA/blob/main/CHANGELOG.md"
70+
71+
[project.optional-dependencies]
72+
develop = [
73+
"pre-commit",
74+
"black",
75+
"isort",
76+
"flake8",
77+
"flake8-docstrings",
78+
"pytest>=5.4.2",
79+
"pytest-cov>=2.8.1",
80+
]
81+
docs = [
82+
"Sphinx>=5.0,!=7.2.0",
83+
"pydata-sphinx-theme",
84+
"sphinx_design>=0.3",
85+
"sphinxcontrib-bibtex",
86+
"myst-nb",
87+
"myst-parser",
88+
]
89+
nrel-wind = ["h5pyd"]
90+
reanalysis = [
91+
"cdsapi",
92+
"xarray[parallel]",
93+
"h5py", # Required for netcdf4
94+
"netcdf4",
95+
]
96+
examples = [
97+
"openoa[reanalysis,nrel-wind]",
98+
"jupyterlab"
99+
]
100+
all = ["openoa[develop,docs,examples]"]
101+
102+
[tool.setuptools]
103+
include-package-data = true
104+
105+
[tool.setuptools.packages.find]
106+
include = ["test", "examples"]
107+
108+
[tool.setuptools.dynamic]
109+
version = {attr = "openoa.__version__"}
110+
111+
[tool.coverage.report]
112+
exclude_lines = [
113+
"# pragma: no cover",
114+
"def .+plot",
115+
"def plot_.+",
116+
]
117+
118+
[tool.coverage.run]
119+
# Coverage.py configuration file
120+
# https://coverage.readthedocs.io/en/latest/config.html
121+
branch = true
122+
source = ["openoa/*"]
123+
omit = [
124+
"setup.py",
125+
"tests/*"
126+
]
127+
128+
[tool.pytest.ini_options]
129+
python_files = [
130+
"test/*.py",
131+
]
132+
testpaths = [
133+
"test/unit/*.py",
134+
"test/regression/*.py",
135+
]
136+
cache_dir = ".cache"
137+
filterwarnings = [
138+
"ignore::DeprecationWarning:sklearn.*:",
139+
"ignore::DeprecationWarning:patsy.*:",
140+
"ignore::DeprecationWarning:pygam.*:",
141+
]
142+
1143
[tool.black]
2144
# https://github.com/psf/black
3145
line-length = 100
@@ -48,24 +190,3 @@ known_third_party = [
48190
"pyproj",
49191
"shapely"
50192
]
51-
52-
[tool.pytest.ini_options]
53-
python_files = [
54-
"test/*.py",
55-
]
56-
testpaths = [
57-
"test/unit/*.py",
58-
"test/regression/*.py",
59-
]
60-
filterwarnings = [
61-
"ignore::DeprecationWarning:sklearn.*:",
62-
"ignore::DeprecationWarning:patsy.*:",
63-
"ignore::DeprecationWarning:pygam.*:",
64-
]
65-
66-
[tool.coverage.report]
67-
exclude_lines = [
68-
"# pragma: no cover",
69-
"def .+plot",
70-
"def plot_.+",
71-
]

setup.py

-109
This file was deleted.

test/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def pytest_configure(config):
2525
regression = config.getoption("--regression")
2626

2727
# Provide the appropriate directories
28-
unit_tests = list((ROOT / "unit").iterdir())
29-
regression_tests = list((ROOT / "regression").iterdir())
28+
unit_tests = [el for el in (ROOT / "unit").iterdir() if el.suffix == ".py"]
29+
regression_tests = [el for el in (ROOT / "regression").iterdir() if el.suffix == ".py"]
3030

3131
# If both, run them all; if neither skip any modifications; otherwise run just the appropriate subset
3232
if regression and unit:

0 commit comments

Comments
 (0)