forked from WISDEM/WISDEM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into ptfm_updates
- Loading branch information
Showing
93 changed files
with
12,212 additions
and
11,957 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build and upload to PyPI | ||
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml | ||
|
||
# Build on every branch push, tag push, and pull request change: | ||
#on: [push, pull_request] | ||
# Alternatively, to publish when a (published) GitHub Release is created, use the following: | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- name: Setup GNU Fortran | ||
uses: awvwgk/setup-fortran@v1 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
# upload to PyPI on every tag starting with 'v' | ||
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
# alternatively, to publish when a GitHub Release is created, use the following rule: | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
# unpacks default artifact into dist/ | ||
# if `name: artifact` is omitted, the action will create extra parent dir | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
# To test: repository_url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
import numpy as np | ||
import pandas as pd | ||
import json | ||
|
||
# these were spot checked, unclear if there's a better way to directly | ||
# obtain this mapping | ||
var_prefixes = { | ||
'assembly': '*.', # scattered all over the place | ||
'ccblade': 'rotorse.', | ||
're': 'rotorse.', | ||
'rp': 'rotorse.', | ||
'rs': 'rotorse.', | ||
'stall_check': 'rotorse.', | ||
'wt_class': 'rotorse.', | ||
} | ||
|
||
# the variable guide in csv format is generated by get_omdao_vars.py | ||
tab = pd.read_csv('variable_guide.csv') | ||
if tab.iloc[-1]['Description'] == 'description': | ||
# throw out footer | ||
tab = tab.iloc[:-1] | ||
tab = tab.set_index('Variable') | ||
tab['Units'] = tab['Units'].replace(np.nan, '-') | ||
tab['Description'] = tab['Description'].replace(np.nan,'None') | ||
|
||
# convert to dict | ||
varsdict = {} | ||
for varn,info in tab.iterrows(): | ||
curlev = varsdict | ||
varlevels = varn.split('.') | ||
toplevel = varlevels[0] | ||
for lev in varlevels[:-1]: | ||
if lev not in curlev: | ||
curlev[lev] = {} | ||
curlev = curlev[lev] | ||
curlev[varlevels[-1]] = info.to_dict() # Units, Description | ||
curlev[varlevels[-1]]['Name'] = var_prefixes.get(toplevel,'') + varn | ||
|
||
# save | ||
with open('variable_guide.json','w') as f: | ||
json.dump(varsdict, f, indent=2) |
Oops, something went wrong.