diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8be79f0e..de46d133 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -19,7 +19,6 @@ diff --git a/flasc/__init__.py b/flasc/__init__.py index 2b76b5c1..ba5591e0 100644 --- a/flasc/__init__.py +++ b/flasc/__init__.py @@ -4,12 +4,10 @@ __author__ = """Bart Doekemeijer, Paul Fleming""" __email__ = "paul.fleming@nrel.gov, michael.sinner@nrel.gov" -__version__ = "0.1.0" -from pathlib import Path +from importlib.metadata import version -with open(Path(__file__).parent / "version.py") as _version_file: - __version__ = _version_file.read().strip() +__version__ = version("flasc") # from . import ( # optimization, diff --git a/flasc/analysis/energy_ratio.py b/flasc/analysis/energy_ratio.py index 39c5884d..a88581d1 100644 --- a/flasc/analysis/energy_ratio.py +++ b/flasc/analysis/energy_ratio.py @@ -141,8 +141,8 @@ def _compute_energy_ratio_single( index="wd_bin", aggregate_function="first", ) - .rename({f"energy_ratio_df_name_{n}": n for n in df_names}) - .rename({f"count_df_name_{n}": f"count_{n}" for n in df_names}) + .rename({f"energy_ratio_{n}": n for n in df_names}) + .rename({f"count_{n}": f"count_{n}" for n in df_names}) .sort("wd_bin") ) diff --git a/flasc/data_processing/__init__.py b/flasc/data_processing/__init__.py index 874874ac..15196284 100644 --- a/flasc/data_processing/__init__.py +++ b/flasc/data_processing/__init__.py @@ -4,7 +4,6 @@ __author__ = """Bart Doekemeijer, Paul Fleming""" __email__ = "paul.fleming@nrel.gov, michael.sinner@nrel.gov" -__version__ = "0.1.0" from pathlib import Path diff --git a/flasc/model_fitting/__init__.py b/flasc/model_fitting/__init__.py index bfbaa993..d613fd12 100644 --- a/flasc/model_fitting/__init__.py +++ b/flasc/model_fitting/__init__.py @@ -4,7 +4,6 @@ __author__ = """Bart Doekemeijer, Paul Fleming""" __email__ = "paul.fleming@nrel.gov, michael.sinner@nrel.gov" -__version__ = "0.1.0" from pathlib import Path diff --git a/flasc/utilities/__init__.py b/flasc/utilities/__init__.py index 4bf78e84..c8e8a6ad 100644 --- a/flasc/utilities/__init__.py +++ b/flasc/utilities/__init__.py @@ -4,7 +4,7 @@ __author__ = """Bart Doekemeijer, Paul Fleming""" __email__ = "paul.fleming@nrel.gov, michael.sinner@nrel.gov" -__version__ = "1.0" + from pathlib import Path diff --git a/flasc/utilities/energy_ratio_utilities.py b/flasc/utilities/energy_ratio_utilities.py index f23f01a9..6db4db6d 100644 --- a/flasc/utilities/energy_ratio_utilities.py +++ b/flasc/utilities/energy_ratio_utilities.py @@ -162,8 +162,8 @@ def add_wd(df_: pl.DataFrame, wd_cols: List[str], remove_all_nulls: bool = False # Add the cosine columns .with_columns( [ - pl.col(wd_cols).mul(np.pi / 180).cos().suffix("_cos"), - pl.col(wd_cols).mul(np.pi / 180).sin().suffix("_sin"), + pl.col(wd_cols).mul(np.pi / 180).cos().name.suffix("_cos"), + pl.col(wd_cols).mul(np.pi / 180).sin().name.suffix("_sin"), ] ) ) diff --git a/flasc/version.py b/flasc/version.py deleted file mode 100644 index 38f77a65..00000000 --- a/flasc/version.py +++ /dev/null @@ -1 +0,0 @@ -2.0.1 diff --git a/pyproject.toml b/pyproject.toml index 2ed27f63..94fee0ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,67 @@ [build-system] -requires = ["setuptools >= 40.6.0", "wheel"] +requires = ["setuptools >= 61.0"] build-backend = "setuptools.build_meta" +[project] +name = "flasc" +version = "2.0.1" +description = "FLASC provides a rich suite of analysis tools for SCADA data filtering & analysis, wind farm model validation, field experiment design, and field experiment monitoring." +readme = "README.md" +requires-python = ">=3.9" +authors = [ + { name = "Paul Fleming", email = "paul.fleming@nrel.gov" }, + { name = "Michael (Misha) Sinner", email = "Michael.Sinner@nrel.gov" }, + { name = "Eric Simley", email = "Eric.Simley@nrel.gov" }, +] +license = { file = "LICENSE.txt" } +keywords = ["flasc"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python :: 3", +] +dependencies = [ + "bokeh>=2, <4", + "floris~=4.0", + "feather-format~=0.0", + "ipympl~=0.9", + "matplotlib~=3.8", + "numpy~=1.20", + "pandas~=2.0", + "SALib~=1.0", + "scipy~=1.1", + "streamlit~=1.0", + "tkcalendar~=1.0", + "seaborn~=0.0", + "polars~=1.0", + "ephem", + "coloredlogs~=15.0", +] + +[project.optional-dependencies] +docs = [ + "jupyter-book", + "sphinx-book-theme", + "sphinx-autodoc-typehints", + "sphinxcontrib-autoyaml", + "sphinxcontrib.mermaid" +] +develop = [ + "pytest", + "pre-commit", + "ruff", + "isort" +] + +[tool.setuptools.packages.find] +include = ["flasc*"] + +[project.urls] +Homepage = "https://github.com/NREL/flasc" +Documentation = "https://readthedocs.org" + [coverage.run] # Coverage.py configuration file @@ -25,7 +85,6 @@ filterwarnings = [ # Exclude a variety of commonly ignored directories. exclude = [ - "flasc/version.py", ".bzr", ".direnv", ".eggs", diff --git a/setup.py b/setup.py deleted file mode 100644 index af6075c2..00000000 --- a/setup.py +++ /dev/null @@ -1,94 +0,0 @@ -"""The setup script.""" - -from pathlib import Path - -from setuptools import find_packages, setup - -# Package meta-data. -NAME = "flasc" -DESCRIPTION = ( - "FLASC provides a rich suite of analysis tools for SCADA data filtering & analysis, " - " wind farm model validation, field experiment design, and field experiment monitoring." -) -URL = "https://github.com/NREL/flasc" -EMAIL = "paul.fleming@nrel.gov" -AUTHOR = "NREL National Wind Technology Center" - -# What packages are required for this module to be executed? -REQUIRED = [ - "bokeh>=2, <4", - "floris~=4.0", - "feather-format~=0.0", - "ipympl~=0.9", - "matplotlib~=3.8", - "numpy~=1.20", - "pandas~=2.0", - "SALib~=1.0", - "scipy~=1.1", - "streamlit~=1.0", - "tkcalendar~=1.0", - "seaborn~=0.0", - "polars==0.19.5", - "ephem", - "coloredlogs~=15.0", -] - -EXTRAS = { - "docs": { - "jupyter-book", - "sphinx-book-theme", - "sphinx-autodoc-typehints", - "sphinxcontrib-autoyaml", - "sphinxcontrib.mermaid", - }, - "develop": { - "pytest", - "pre-commit", - "ruff", - "isort", - }, -} - -ROOT = Path(__file__).parent -with open(ROOT / "flasc" / "version.py") as version_file: - VERSION = version_file.read().strip() - -with open("README.md") as readme_file: - README = readme_file.read() - -setup_requirements = [ - # Placeholder -] - -test_requirements = [ - # Placeholder -] - -setup( - name=NAME, - version=VERSION, - description=DESCRIPTION, - long_description=README, - long_description_content_type="text/markdown", - author=AUTHOR, - author_email=EMAIL, - url=URL, - packages=find_packages(include=["flasc*"]), - entry_points={"console_scripts": ["flasc=flasc.cli:main"]}, - include_package_data=True, - install_requires=REQUIRED, - extras_require=EXTRAS, - license_files=("LICENSE.txt",), - zip_safe=False, - keywords="flasc", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - ], - test_suite="tests", - tests_require=test_requirements, - setup_requires=setup_requirements, -)