diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 53b91b537bdf7334008904722c2ffd6672b5cf45..8ad2acc78e400e4f9ff020c3ca7a4d663167d995 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,8 +41,10 @@ pages: # "pages" is a job specifically for GitLab pages [1] script: # use sphinx to build docs, move to public page - pip install --upgrade pip - pip install sphinx --upgrade + - pip install sphinx sphinx_rtd_theme - pip install nbsphinx==0.3.5 - pip install git+https://github.com/vidartf/nbsphinx-link.git + - pip install -e . - cd docs; make html - cd ../; mv docs/build/html public/ artifacts: # required for GitLab pages [1] diff --git a/docs/Makefile b/docs/Makefile index cb6f40a684fe75a70351c3847c2c794b1cdee6b3..061f2593381bd9360f2a2b9d13a61b06ad28e83c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,7 +5,7 @@ SPHINXOPTS = SPHINXBUILD = python -msphinx SPHINXPROJ = TOPFARM -SOURCEDIR = source +SOURCEDIR = . BUILDDIR = build # Put it first so that "make" without argument is like "make help". diff --git a/docs/source/bladed/Bladed_airfoil.png b/docs/bladed/Bladed_airfoil.png similarity index 100% rename from docs/source/bladed/Bladed_airfoil.png rename to docs/bladed/Bladed_airfoil.png diff --git a/docs/source/bladed/Bladed_st_centers.png b/docs/bladed/Bladed_st_centers.png similarity index 100% rename from docs/source/bladed/Bladed_st_centers.png rename to docs/bladed/Bladed_st_centers.png diff --git a/docs/source/bladed/Bladed_turbine_coord.png b/docs/bladed/Bladed_turbine_coord.png similarity index 100% rename from docs/source/bladed/Bladed_turbine_coord.png rename to docs/bladed/Bladed_turbine_coord.png diff --git a/docs/source/bladed/HAWC2_c2_def_ccord.png b/docs/bladed/HAWC2_c2_def_ccord.png similarity index 100% rename from docs/source/bladed/HAWC2_c2_def_ccord.png rename to docs/bladed/HAWC2_c2_def_ccord.png diff --git a/docs/source/bladed/HAWC2_st_centers.png b/docs/bladed/HAWC2_st_centers.png similarity index 100% rename from docs/source/bladed/HAWC2_st_centers.png rename to docs/bladed/HAWC2_st_centers.png diff --git a/docs/source/bladed/HAWC2_turbine_coord.png b/docs/bladed/HAWC2_turbine_coord.png similarity index 100% rename from docs/source/bladed/HAWC2_turbine_coord.png rename to docs/bladed/HAWC2_turbine_coord.png diff --git a/docs/source/bladed/bladed2hawc.ipynb b/docs/bladed/bladed2hawc.ipynb similarity index 100% rename from docs/source/bladed/bladed2hawc.ipynb rename to docs/bladed/bladed2hawc.ipynb diff --git a/docs/source/bladed/bladed2hawc.rst b/docs/bladed/bladed2hawc.rst similarity index 98% rename from docs/source/bladed/bladed2hawc.rst rename to docs/bladed/bladed2hawc.rst index 20f4faaa4d1e51bd10e94010180a6afcd3f4e325..444432683f9de3d13664995dc9b43317187ef9e2 100644 --- a/docs/source/bladed/bladed2hawc.rst +++ b/docs/bladed/bladed2hawc.rst @@ -58,9 +58,9 @@ available to extract a ``numpy`` array, for example as follows:: prj.bd['BSTIFFMB'] ---------------------------------- +------------------------------------ Convert BLADED project file to HAWC2 ---------------------------------- +------------------------------------ The class ``wetb.bladed.prj2hawc.Convert2Hawc`` will convert a Bladed project file into a set of HAWC2 input files. This process assumes that a standard diff --git a/docs/source/conf.py b/docs/conf.py similarity index 99% rename from docs/source/conf.py rename to docs/conf.py index eb03b91056d484baf3afbfc8225f83a5ad931f81..f8ea741e53cc0ff19686c01ba4215e205a22c737 100644 --- a/docs/source/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ extensions = [ 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', - 'nbsphinx_link', + 'nbsphinx', ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/source/fatigue_tools/fatigue.rst b/docs/fatigue.rst similarity index 94% rename from docs/source/fatigue_tools/fatigue.rst rename to docs/fatigue.rst index 9b2f27993f4e5432e2ba04b1ee8a4d33d4aff78a..d9d96a16db33616881c8315c95fa202ac4df50c3 100644 --- a/docs/source/fatigue_tools/fatigue.rst +++ b/docs/fatigue.rst @@ -10,4 +10,4 @@ notebook format. You can download the source notebook from the :caption: Fatigue tools :maxdepth: 2 - fatigue_nb \ No newline at end of file + notebooks/Fatigue \ No newline at end of file diff --git a/docs/source/hawc2/hawc2.rst b/docs/hawc2.rst similarity index 73% rename from docs/source/hawc2/hawc2.rst rename to docs/hawc2.rst index bbb579eef561ed4b5998ff509bd4d59febc4d856..8bfa15418219d1fe03b1798a9625189269ea3462 100644 --- a/docs/source/hawc2/hawc2.rst +++ b/docs/hawc2.rst @@ -9,6 +9,6 @@ notebook format. You can download the source notebooks from the .. toctree:: :caption: HAWC2 - InputFileWriting_nb - RunningSimulations_nb - RunningSimulationsJess_nb \ No newline at end of file + notebooks/hawc2/InputFileWriting + notebooks/hawc2/RunningSimulations + notebooks/hawc2/RunningSimulationsJess \ No newline at end of file diff --git a/docs/source/index.rst b/docs/index.rst similarity index 92% rename from docs/source/index.rst rename to docs/index.rst index b3c1c44073bb7bd66edc49d0bb4328d039931319..34de79b132c2ef3c3ecb4eafa28ed63b9bc0c224 100644 --- a/docs/source/index.rst +++ b/docs/index.rst @@ -24,7 +24,7 @@ Contents: .. toctree:: installation - fatigue_tools/fatigue - hawc2/hawc2 + fatigue + hawc2 bladed/bladed2hawc diff --git a/docs/source/installation.rst b/docs/installation.rst similarity index 100% rename from docs/source/installation.rst rename to docs/installation.rst diff --git a/docs/make.bat b/docs/make.bat index 4d9eb83d9f9309029f4b14ff09024658bb0f5563..c1becfd151e17788ba5654b4add51eab9f021624 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -7,7 +7,7 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) -set SOURCEDIR=source +set SOURCEDIR=. set BUILDDIR=build if "%1" == "" goto help diff --git a/notebooks/fatigue/Fatigue.ipynb b/docs/notebooks/Fatigue.ipynb similarity index 100% rename from notebooks/fatigue/Fatigue.ipynb rename to docs/notebooks/Fatigue.ipynb diff --git a/notebooks/hawc2/InputFileWriting.ipynb b/docs/notebooks/hawc2/InputFileWriting.ipynb similarity index 100% rename from notebooks/hawc2/InputFileWriting.ipynb rename to docs/notebooks/hawc2/InputFileWriting.ipynb diff --git a/notebooks/hawc2/RunningSimulations.ipynb b/docs/notebooks/hawc2/RunningSimulations.ipynb similarity index 100% rename from notebooks/hawc2/RunningSimulations.ipynb rename to docs/notebooks/hawc2/RunningSimulations.ipynb diff --git a/notebooks/hawc2/RunningSimulationsJess.ipynb b/docs/notebooks/hawc2/RunningSimulationsJess.ipynb similarity index 100% rename from notebooks/hawc2/RunningSimulationsJess.ipynb rename to docs/notebooks/hawc2/RunningSimulationsJess.ipynb diff --git a/docs/source/fatigue_tools/fatigue_nb.nblink b/docs/source/fatigue_tools/fatigue_nb.nblink deleted file mode 100644 index 1125cbfedf638e5b7c49d38edb47634ca6d3da6f..0000000000000000000000000000000000000000 --- a/docs/source/fatigue_tools/fatigue_nb.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../notebooks/fatigue/Fatigue.ipynb" -} \ No newline at end of file diff --git a/docs/source/hawc2/InputFileWriting_nb.nblink b/docs/source/hawc2/InputFileWriting_nb.nblink deleted file mode 100644 index 4ccd43b6c7b0210c73653a08a0b002962cd4d3c3..0000000000000000000000000000000000000000 --- a/docs/source/hawc2/InputFileWriting_nb.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../notebooks/hawc2/InputFileWriting.ipynb" -} \ No newline at end of file diff --git a/docs/source/hawc2/RunningSimulationsJess_nb.nblink b/docs/source/hawc2/RunningSimulationsJess_nb.nblink deleted file mode 100644 index 42789e02ff818f9e169c07dbccaa1067fc472aa9..0000000000000000000000000000000000000000 --- a/docs/source/hawc2/RunningSimulationsJess_nb.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../notebooks/hawc2/RunningSimulationsJess.ipynb" -} \ No newline at end of file diff --git a/docs/source/hawc2/RunningSimulations_nb.nblink b/docs/source/hawc2/RunningSimulations_nb.nblink deleted file mode 100644 index e4ea927f8ab1c549a40becc6e041c67d12b64b97..0000000000000000000000000000000000000000 --- a/docs/source/hawc2/RunningSimulations_nb.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../notebooks/hawc2/RunningSimulations.ipynb" -} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 95e01699472de040704d9a9f07963f8a4df4547b..3cf235fc38fb215bcbb1b96528b74a3e995eae38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.1.0" description = "The Wind Energy Toolbox (or wetb, pronounce as wee-tee-bee) is a collection of Python scripts that facilitate working with (potentially a lot) of HAWC2, HAWCStab2, FAST or other text input based simulation tools." authors = ["Your Name <you@example.com>"] license = "wetb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL, http://www.gnu.org/copyleft/gpl.html) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. wetb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details http://www.gnu.org/licenses/ We encourage you to submit new code for possible inclusion in future versions of wetb." -readme = "README.md" + [tool.poetry.dependencies] click = "^8.0.4" diff --git a/update_pyproject.py b/update_pyproject.py index 065a0ce4a48c51dd1c2fb3e0f15a2ffdd8b78ae4..3b1b55795348fe12a072633c7a163a3ada3f1b43 100644 --- a/update_pyproject.py +++ b/update_pyproject.py @@ -10,7 +10,7 @@ with open("README.md") as f: readme = f.read().split("\n# ") for section in readme: if section.startswith("Introduction"): - description = " ".join(section.split("\n")[1:]).lstrip().rstrip() + description = " ".join(section.split("\n")[1:]).lstrip().rstrip()[:512] # Getting the package version. repo = git.cmd.Git("./") diff --git a/wetb/hawc2/htc_file.py b/wetb/hawc2/htc_file.py index bedd72b2271d3798dfa9583d7c52b16387483fc4..4f9724777979aee74fd3ed4b269ef99254594036 100644 --- a/wetb/hawc2/htc_file.py +++ b/wetb/hawc2/htc_file.py @@ -197,8 +197,8 @@ class HTCFile(HTCContents, HTCDefaults, HTCExtensions): """Saves the htc object to an htc file. Args: - filename (str, optional): Specifies the filename of the htc file to be saved. - If the value is none, the filename attribute of the object will be used as the filename. + filename (str, optional): Specifies the filename of the htc file to be saved. + If the value is none, the filename attribute of the object will be used as the filename. Defaults to None. """ self.contents # load if not loaded @@ -213,12 +213,12 @@ class HTCFile(HTCContents, HTCDefaults, HTCExtensions): fid.write(str(self)) def set_name(self, name, subfolder=''): - """Sets the base filename of the simulation files. + """Sets the base filename of the simulation files. Args: name (str): Specifies name of the log file, dat file (for animation), hdf5 file (for visualization) and htc file. - subfolder (str, optional): Specifies the name of a subfolder to place the files in. - If the value is an empty string, no subfolders will be created. + subfolder (str, optional): Specifies the name of a subfolder to place the files in. + If the value is an empty string, no subfolders will be created. Defaults to ''. Returns: @@ -306,6 +306,7 @@ class HTCFile(HTCContents, HTCDefaults, HTCExtensions): files.append(dll.filename[0]) f, ext = os.path.splitext(dll.filename[0]) files.append(f + "_64" + ext) + files.append(f + ".so") if 'wind' in self: files.append(self.wind.get('user_defined_shear', [None])[0]) files.append(self.wind.get('user_defined_shear_turbulence', [None])[0]) diff --git a/wetb/hawc2/tests/test_htc_file.py b/wetb/hawc2/tests/test_htc_file.py index 22bcca5558c854463a88a3d79440299556a9fc2a..ed15b9f4d1357df69119ebd498c999be3e5f71be 100644 --- a/wetb/hawc2/tests/test_htc_file.py +++ b/wetb/hawc2/tests/test_htc_file.py @@ -246,14 +246,19 @@ end turb_export;""" './data/DTU_10MW_RWT_pc.dat', './control/risoe_controller.dll', './control/risoe_controller_64.dll', + './control/risoe_controller.so', './control/generator_servo.dll', './control/generator_servo_64.dll', + './control/generator_servo.so', './control/mech_brake.dll', './control/mech_brake_64.dll', + './control/mech_brake.so', './control/servo_with_limits.dll', './control/servo_with_limits_64.dll', + './control/servo_with_limits.so', './control/towclearsens.dll', './control/towclearsens_64.dll', + './control/towclearsens.so', './data/user_shear.dat', self.testfilepath.replace("\\", "/") + 'test.htc' ]: