Skip to content

Commit

Permalink
Merge pull request #18 from rafmudaf/main
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrbortolotti authored Oct 24, 2023
2 parents 0ea5d88 + 49344f5 commit 2eeff57
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 23 deletions.
4 changes: 2 additions & 2 deletions examples/plant/validation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import yaml
import os
from utils import plant_schemas_path, plant_examples_data_path
from utils.yml_utils import validate_yaml, XrResourceLoader
from windIO.utils import plant_schemas_path, plant_examples_data_path
from windIO.utils.yml_utils import validate_yaml, XrResourceLoader


if __name__ == '__main__':
Expand Down
30 changes: 26 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
import setuptools

# Required packages to use the library
REQUIRED = [
'jsonschema',
'numpy',
'pyyaml',
'xarray',
]

# Optional packages
# To use:
# pip install -e ".[test]" installs testing packages in editable install
# pip install "windIO[test]" installs testing packages in non-editable install
EXTRAS = {
"test": {
'pytest',
'py_wake',
'topfarm',
},
}

metadata = dict(
name="windIO",
url='https://github.com/IEAWindTask37/windIO',
version="1.0",
description="Frameworks defining the inputs and outputs for systems engineering MDAO of wind turbine and plants.",
author="IEA Wind Task 37",
packages=setuptools.find_packages(exclude=["test", "examples"]),
packages=setuptools.find_packages(exclude=["docs*", "examples*", "test*"]),
python_requires=">=3.7",
zip_safe=True,
install_requires=['jsonschema', 'numpy', 'pyyaml', 'pytest', 'xarray']
)
install_requires=REQUIRED,
extras_require=EXTRAS,
license="Apache-2.0",
)

setuptools.setup(**metadata)
setuptools.setup(**metadata)
2 changes: 1 addition & 1 deletion test/plant/test_resources_pywake.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from utils.pywake_utils import yml2Site, xr2Site
from windIO.utils.pywake_utils import yml2Site, xr2Site
import numpy.testing as npt
import numpy as np
import pytest
Expand Down
8 changes: 4 additions & 4 deletions test/plant/test_system_pywake.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from utils import plant_examples_data_path
from utils.yml_utils import load_yaml
from utils.pywake_utils import ymlSystem2PyWake
from windIO.utils import plant_examples_data_path
from windIO.utils.yml_utils import load_yaml
from windIO.utils.pywake_utils import ymlSystem2PyWake
from py_wake.deficit_models.gaussian import IEA37SimpleBastankhahGaussian
import numpy as np
import numpy.testing as npt
Expand All @@ -13,7 +13,7 @@
from topfarm.cost_models.py_wake_wrapper import PyWakeAEPCostModelComponent
from topfarm.constraint_components.boundary import CircleBoundaryConstraint
from topfarm.plotting import XYPlotComp
from utils.topfarm_utils import ymlSystem2TopFarm
from windIO.utils.topfarm_utils import ymlSystem2TopFarm
from test.plant import examples_data_path
except ModuleNotFoundError:
topfarm = None
Expand Down
4 changes: 2 additions & 2 deletions test/plant/test_turbine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from utils.pywake_utils import yml2WindTurbines
from utils import plant_examples_data_path
from windIO.utils.pywake_utils import yml2WindTurbines
from windIO.utils import plant_examples_data_path
from py_wake.examples.data.iea37._iea37 import IEA37_WindTurbines
import numpy.testing as npt
import numpy as np
Expand Down
7 changes: 0 additions & 7 deletions utils/__init__.py

This file was deleted.

7 changes: 7 additions & 0 deletions windIO/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import os

plant_examples_data_path = os.path.dirname(__file__) + "/../../examples/plant/"
plant_schemas_path = os.path.dirname(__file__) + "/../../windIO/plant/"

turbine_examples_data_path = os.path.dirname(__file__) + "/../../examples/turbine/"
turbine_schemas_path = os.path.dirname(__file__) + "/../../windIO/turbine/"
2 changes: 1 addition & 1 deletion utils/pywake_utils.py → windIO/utils/pywake_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import xarray as xr
from utils.yml_utils import load_yaml, XrResourceLoader
from windIO.utils.yml_utils import load_yaml, XrResourceLoader
from py_wake.wind_turbines import WindTurbine
from py_wake.wind_turbines.power_ct_functions import CubePowerSimpleCt, PowerCtFunctions
from py_wake.site.xrsite import XRSite
Expand Down
4 changes: 2 additions & 2 deletions utils/topfarm_utils.py → windIO/utils/topfarm_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from utils.pywake_utils import ymlSystem2PyWake
from utils.yml_utils import load_yaml
from windIO.utils.pywake_utils import ymlSystem2PyWake
from windIO.utils.yml_utils import load_yaml
from py_wake.deficit_models.gaussian import IEA37SimpleBastankhahGaussian
from topfarm._topfarm import TopFarmProblem
from topfarm.constraint_components.boundary import CircleBoundaryConstraint
Expand Down
File renamed without changes.

0 comments on commit 2eeff57

Please sign in to comment.