From fb93fcf41195c4372ddbae7f18e37e13b2d3bdb1 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 11:13:45 -0600 Subject: [PATCH 01/11] Update pyproj.toml --- pyproject.toml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 2ed27f63..6d7650c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,56 @@ requires = ["setuptools >= 40.6.0", "wheel"] 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" +readme-content-type = "text/markdown" +requires-python = ">=3.9" +authors = [ + { name = "NREL National Wind Technology Center", email = "paul.fleming@nrel.gov" } +] +homepage = "https://github.com/NREL/flasc" +license = { file = "LICENSE.txt" } +keywords = ["flasc"] +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==0.19.5", + "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" +] + +[project.urls] +"Homepage" = "https://github.com/NREL/flasc" +Documentation = "https://readthedocs.org" + [coverage.run] # Coverage.py configuration file From 9c324e732d3f663bf3f185fd8bef8d26e902a487 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 11:23:06 -0600 Subject: [PATCH 02/11] fix errors --- pyproject.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6d7650c8..f5fc0023 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 40.6.0", "wheel"] +requires = ["setuptools >= 61.0"] build-backend = "setuptools.build_meta" [project] @@ -7,12 +7,10 @@ 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" -readme-content-type = "text/markdown" requires-python = ">=3.9" authors = [ { name = "NREL National Wind Technology Center", email = "paul.fleming@nrel.gov" } ] -homepage = "https://github.com/NREL/flasc" license = { file = "LICENSE.txt" } keywords = ["flasc"] dependencies = [ @@ -49,7 +47,7 @@ develop = [ ] [project.urls] -"Homepage" = "https://github.com/NREL/flasc" +Homepage = "https://github.com/NREL/flasc" Documentation = "https://readthedocs.org" From 772a2d7979ac50aac57d795c1da2d6c4ad9f7e84 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 11:55:10 -0600 Subject: [PATCH 03/11] Update polars syntax --- flasc/analysis/energy_ratio.py | 4 ++-- flasc/utilities/energy_ratio_utilities.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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"), ] ) ) From 08a09250811a3f058809f6557ed31740e99cfa15 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 12:16:46 -0600 Subject: [PATCH 04/11] hide setup.py and update polars --- pyproject.toml | 2 +- setup.py => setup_old.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename setup.py => setup_old.py (100%) diff --git a/pyproject.toml b/pyproject.toml index f5fc0023..f16dfb2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ "streamlit~=1.0", "tkcalendar~=1.0", "seaborn~=0.0", - "polars==0.19.5", + "polars~=1.0", "ephem", "coloredlogs~=15.0", ] diff --git a/setup.py b/setup_old.py similarity index 100% rename from setup.py rename to setup_old.py From a1e58cc281d50e5aa8fe313609cd23b1c791f265 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 12:20:47 -0600 Subject: [PATCH 05/11] id the package folder --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f16dfb2b..a853860e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,9 @@ develop = [ "isort" ] +[tool.setuptools.packages.find] +include = ["flasc*"] + [project.urls] Homepage = "https://github.com/NREL/flasc" Documentation = "https://readthedocs.org" From df25bb766f8cc6819e268b43bf5ee97ca29f2f75 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 12:22:28 -0600 Subject: [PATCH 06/11] add classifers --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a853860e..19ca0211 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,13 @@ authors = [ ] 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", From 198abc44316e0a22f0a08c552551aa64f129037e Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 12:24:03 -0600 Subject: [PATCH 07/11] Update authors --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 19ca0211..1eb737c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,9 @@ description = "FLASC provides a rich suite of analysis tools for SCADA data filt readme = "README.md" requires-python = ">=3.9" authors = [ - { name = "NREL National Wind Technology Center", email = "paul.fleming@nrel.gov" } + { 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"] From ad49d567bceaae98a9d33f319aed53f39a3ba187 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 12:37:18 -0600 Subject: [PATCH 08/11] Delete setup.py --- setup_old.py | 94 ---------------------------------------------------- 1 file changed, 94 deletions(-) delete mode 100644 setup_old.py diff --git a/setup_old.py b/setup_old.py deleted file mode 100644 index af6075c2..00000000 --- a/setup_old.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, -) From 06daf07383976c754ef2cd566b2975ae54f8bef4 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 14:52:28 -0600 Subject: [PATCH 09/11] consolidate version into toml --- flasc/version.py | 1 - pyproject.toml | 1 - 2 files changed, 2 deletions(-) delete mode 100644 flasc/version.py 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 1eb737c5..94fee0ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,6 @@ filterwarnings = [ # Exclude a variety of commonly ignored directories. exclude = [ - "flasc/version.py", ".bzr", ".direnv", ".eggs", From c5fc3b51fb48394b828c2c9882f2a877b7090ab9 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 14:54:03 -0600 Subject: [PATCH 10/11] update template --- .github/PULL_REQUEST_TEMPLATE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 @@ From 0ee3e99a59a212eb5045811a3ca2f71294f98c3a Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 16 Oct 2024 15:12:33 -0600 Subject: [PATCH 11/11] consolidate version information --- flasc/__init__.py | 6 ++---- flasc/data_processing/__init__.py | 1 - flasc/model_fitting/__init__.py | 1 - flasc/utilities/__init__.py | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) 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/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