Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to openfast_io to match current dev branch API #2361

Open
wants to merge 72 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
6097a73
Merge branch 'OpenFAST:dev' into dev
mayankchetan Aug 5, 2024
c94e789
update openfast_io to dev, add working main for reader & writer
mayankchetan Aug 5, 2024
3313e72
update lib name to openfast_io
mayankchetan Aug 5, 2024
f506755
add main func to turbsim_file
mayankchetan Aug 5, 2024
c54da68
check if r-test is cloned
mayankchetan Aug 6, 2024
7faa58b
handle blank line before END in certain input files
mayankchetan Aug 6, 2024
8f031f6
genralizing map++ read write
mayankchetan Aug 6, 2024
e18a220
adding moordyn outputs, TODO: flexi outputs
mayankchetan Aug 6, 2024
cd13555
inital add of ExtPtfm & Superelement
mayankchetan Aug 6, 2024
847d5ab
squashed bugs in ExpPtfm
mayankchetan Aug 6, 2024
93eeaa4
squashed bugs in inflow, ad15, olaf
mayankchetan Aug 6, 2024
c73c16e
Abs paths to aux files
mayankchetan Aug 7, 2024
9303fd5
adding double quotes to PrescribedCircFile
mayankchetan Aug 7, 2024
72d2f73
pytest to exercise most OpenFAST modules
mayankchetan Aug 7, 2024
e5cee24
addressing AD15 warning about input format
mayankchetan Aug 7, 2024
4a4d897
removing module versions on inputfile headers
mayankchetan Aug 7, 2024
684952d
renaming folders to follow best practices
mayankchetan Aug 15, 2024
62ce628
updates to .toml & poetry lock
mayankchetan Aug 19, 2024
a0bed7c
update .gitignore for python
mayankchetan Aug 19, 2024
09775e1
testing GH Actions for test pypi upload
mayankchetan Aug 19, 2024
611f269
hatch testing
mayankchetan Aug 19, 2024
bf28ac6
cd since not in main folder
mayankchetan Aug 19, 2024
a6edae7
change workdie
mayankchetan Aug 19, 2024
2f49937
change version
mayankchetan Aug 19, 2024
ab95661
change version
mayankchetan Aug 19, 2024
d628e47
change version
mayankchetan Aug 19, 2024
839e4b5
prepping to add pytest to cmake
mayankchetan Aug 23, 2024
df70883
prepping to add pytest to cmake
mayankchetan Aug 23, 2024
1b9ed0b
working pytest with cmakegit status! :D
mayankchetan Aug 23, 2024
e5a5abd
oops
mayankchetan Aug 23, 2024
0ef25bc
adding openfast_io GH Actions
mayankchetan Aug 23, 2024
9a44fa8
working GH A
mayankchetan Aug 24, 2024
852471b
Install the openfast_io library in GH Action
mayankchetan Aug 24, 2024
f3136d9
correcting path to openfast_io from runner workspace
mayankchetan Aug 24, 2024
19501cc
add log file
mayankchetan Aug 24, 2024
53147f4
adding log files to openfast_io pytest
mayankchetan Aug 24, 2024
bd8fef2
lets get dll location
mayankchetan Aug 24, 2024
36d43d3
artifact name conflict
mayankchetan Aug 25, 2024
721b529
fixed DLL paths in all three test approaches
mayankchetan Aug 26, 2024
7086f90
commenting out furl
mayankchetan Aug 26, 2024
ac925e9
remove openfast_io from rtest-interfaces
mayankchetan Aug 26, 2024
692ddb2
revert artifacts being saved
mayankchetan Aug 26, 2024
8830377
Merge pull request #3 from mayankchetan/switch2Hatch
mayankchetan Aug 26, 2024
02cd902
Merge branch 'OpenFAST:dev' into dev
mayankchetan Aug 26, 2024
d0ef089
updating warning wrt OLAF and UA use
mayankchetan Aug 26, 2024
8bade4c
Merge branch 'dev' into of_io_update
mayankchetan Aug 26, 2024
98b7511
API updates without ADsk & SED
mayankchetan Aug 27, 2024
d3f0c30
added SED & ADsk to read/write, updated outlist reading
mayankchetan Aug 28, 2024
bb7f142
expanding tests to (almost) all openfast glue-code r-tests
mayankchetan Aug 28, 2024
c546c3b
arbritrary comment lines in AF files
mayankchetan Aug 29, 2024
eba1c17
Merge branch 'OpenFAST:dev' into dev
mayankchetan Aug 30, 2024
c3d9859
Merge branch 'dev' into of_io_update
mayankchetan Aug 30, 2024
8789357
adding large angle yaw & bug fix for AD15 nac yaw, thanks to @DanZ
mayankchetan Aug 30, 2024
c766414
remove AD14, change AeroDyn15 --> AeroDyn, and some cleanup
mayankchetan Sep 3, 2024
f6e8883
Merge branch 'OpenFAST:dev' into dev
mayankchetan Sep 5, 2024
662ee35
remove old test
mayankchetan Sep 5, 2024
8ee7a03
Merge branch 'dev' into of_io_update
mayankchetan Sep 5, 2024
1b4da49
Merge branch 'OpenFAST:dev' into dev
mayankchetan Sep 5, 2024
0075994
Merge branch 'dev' into of_io_update
mayankchetan Sep 5, 2024
3d709e9
AF coord changes + SubDyn api removal
mayankchetan Sep 6, 2024
794dfcb
bug fix with FocalDistanceX in inflowind reader
mayankchetan Sep 6, 2024
8342fee
adding fst_vt compare, significant testing robustness increase
mayankchetan Sep 7, 2024
862b4b5
bug fixes caught by fst_vt compare
mayankchetan Sep 7, 2024
7ba57ed
new tests for lib robustness, verifying fst_vt
mayankchetan Sep 9, 2024
e163016
remove np.float_ for numpy >2.0
mayankchetan Sep 9, 2024
3fdc278
Merge branch 'OpenFAST:dev' into dev
mayankchetan Sep 24, 2024
fd44c2a
Merge branch 'dev' into of_io_update
mayankchetan Sep 24, 2024
e734408
extinflow
mayankchetan Sep 24, 2024
44aae75
Merge branch 'OpenFAST:dev' into dev
mayankchetan Oct 1, 2024
be70790
Merge branch 'dev' into of_io_update
mayankchetan Oct 1, 2024
1c96c43
first pypi test
mayankchetan Oct 8, 2024
dce15ea
adding keyring dependancy fot hatch
mayankchetan Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ jobs:
- name: Run Interface / API tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
ctest -VV -L "cpp|python|fastlib"
ctest -VV -L "cpp|python|fastlib" \
-LE "openfast_io"
- name: Failing test artifacts
uses: actions/upload-artifact@v4
if: failure()
Expand Down Expand Up @@ -600,6 +601,51 @@ jobs:
!${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/UAE_VI
!${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline

rtest-openfast_io:
runs-on: ubuntu-22.04
needs: build-openfast-release
steps:
- name: Cache the workspace
uses: actions/cache@v4
with:
path: ${{runner.workspace}}
key: build-openfast-release-${{ github.sha }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
- name: Install openfast_io
working-directory: ${{runner.workspace}}/openfast/openfast_io
run: |
pip install -e .
- name: Configure Tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
cmake \
-DPython_ROOT_DIR:STRING=${{env.pythonLocation}} \
-DBUILD_TESTING:BOOL=ON \
-DCTEST_PLOT_ERRORS:BOOL=ON \
${GITHUB_WORKSPACE}
cmake --build . --target regression_test_controllers
- name: Run openfast_io tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
ctest -VV -j4 \
-L openfast_io
- name: Failing test artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: rtest-openfast_io
path: |
${{runner.workspace}}/openfast/build/reg_tests/openfast_io


rtest-OF-simulink:
runs-on: ubuntu-22.04
Expand Down
75 changes: 55 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,71 @@
# repository. The build cache is stored in GitHub actions.
name: deploy

on:
workflow_dispatch:
# on:
# workflow_dispatch:

release:
types:
- released
# release:
# types:
# - released
on:
push:

jobs:
publish-to-pypi:
# publish-to-pypi:
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: read

# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4

# - name: Install Poetry
# uses: snok/[email protected]

# - name: Build a binary wheel and a source tarball
# run: poetry build
# working-directory: openfast_python

# - name: Publish package distributions to PyPI
# uses: pypa/[email protected]
# with:
# packages-dir: openfast_python/dist

# name: Build and publish python package

# on:
# release:
# types: [ published ]

# jobs:
publish-to-test-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Install Poetry
uses: snok/[email protected]
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Build a binary wheel and a source tarball
run: poetry build
working-directory: openfast_python
- name: Install Hatch
uses: pypa/hatch@install

- name: Publish package distributions to PyPI
uses: pypa/[email protected]
with:
packages-dir: openfast_python/dist

- name: Build package
run: hatch build
working-directory: openfast_io

- name: Publish to PyPI
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
run: hatch publish -r test
working-directory: openfast_io

docker-build-and-push:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ vs-build/
#Simulink cache files
varcache
*.slxc

# Python cache files
openfast_io/dist/
2 changes: 1 addition & 1 deletion modules/hydrodyn/src/WAMIT2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4252,7 +4252,7 @@ SUBROUTINE Read_DataFile4D( InitInp, Filename4D, Data4D, ErrStat, Errmsg )
! See if the diagonal mirror one (WvDir2,WvDir1) value is not filled, set it and its flag
IF ( .NOT. Data4D%DataMask(TmpCoord(1), TmpCoord(2), TmpCoord(4), TmpCoord(3), TmpCoord(5)) ) THEN
Data4D%DataSet(TmpCoord(1), TmpCoord(2), TmpCoord(4), TmpCoord(3), TmpCoord(5) ) = &
Data4D%DataSet(TmpCoord(1), TmpCoord(2), TmpCoord(3), TmpCoord(3), TmpCoord(5) )
Data4D%DataSet(TmpCoord(1), TmpCoord(2), TmpCoord(3), TmpCoord(4), TmpCoord(5) )
Data4D%DataMask(TmpCoord(1), TmpCoord(2), TmpCoord(4), TmpCoord(3), TmpCoord(5) ) = .TRUE.
ENDIF

Expand Down
2 changes: 1 addition & 1 deletion modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8673,7 +8673,7 @@ SUBROUTINE WrVTK_WaveElevVisGrid(t_global, p_FAST, y_FAST, SeaSt)

do ix=1,p_FAST%VTK_surface%NWaveElevPts(1)
do iy=1,p_FAST%VTK_surface%NWaveElevPts(2)
WRITE(Un,VTK_AryFmt) p_FAST%VTK_surface%WaveElevVisX(ix), p_FAST%VTK_surface%WaveElevVisX(iy), p_FAST%VTK_surface%WaveElevVisGrid(y_FAST%VTK_LastWaveIndx,ix,iy)
WRITE(Un,VTK_AryFmt) p_FAST%VTK_surface%WaveElevVisX(ix), p_FAST%VTK_surface%WaveElevVisY(iy), p_FAST%VTK_surface%WaveElevVisGrid(y_FAST%VTK_LastWaveIndx,ix,iy)
end do
end do

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,20 @@ def fread(fid, n, type):


if __name__=="__main__":
d,i = load_binary_output('Test18.T1.outb')
types = []
for j in range(39):
types.append('f8')
print(type(i['attribute_names']))

print(np.dtype({'names':tuple(i['attribute_names']), 'formats': tuple(types) }))
print(type(d))
print(np.array(d,dtype=np.dtype({'names':tuple(i['attribute_names']), 'formats': tuple(types) })))
from openfast_io.FileTools import check_rtest_cloned

parent_dir = os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ) + os.sep

of_outputfile = os.path.join(parent_dir, 'reg_tests', 'r-test', 'glue-codes',
'openfast', '5MW_Land_BD_DLL_WTurb', '5MW_Land_BD_DLL_WTurb.outb')

check_rtest_cloned(of_outputfile)

d,i,p = load_binary_output(of_outputfile)

print(tuple(i['attribute_names']))
print(type(d))
print(i)
print(len(i['attribute_names']))
print(np.shape(d))
Loading
Loading