-
Notifications
You must be signed in to change notification settings - Fork 48
Lint: Utils module #350
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
Lint: Utils module #350
Changes from all commits
3b5578b
6c62bfd
738e3d0
f91ef77
8b8d54b
e1196e1
f4ec009
88810cf
71974b3
8d0263f
769a26f
2f2655b
e6da2ed
1c3602a
0e343d5
486708d
bdf74b3
dfad8dc
8d551e4
cf54e12
7720670
92ad905
65ad2e4
44416f5
ef04cc2
7064645
7aaedea
9e0d63d
03c9552
ddfd14f
9f5e427
e5f1b5c
fd9646b
b721f03
e7fc584
24fa8a5
259e7e5
af3800d
a06ad1a
f616e1c
ff35897
18fc9ff
c5244a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,23 +65,30 @@ jobs: | |
| auto-update-conda: true | ||
| python-version: ${{ env.PYTHON_VER }} | ||
| activate-environment: TESTconda | ||
| use-only-tar-bz2: true | ||
| use-only-tar-bz2: false | ||
|
|
||
| - name: Setup Conda environment | ||
| - name: Create MHKiT Conda environment | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda install numpy cython pip hdf5 libnetcdf cftime netcdf4 --strict-channel-priority | ||
| pip install -e . --force-reinstall | ||
| conda env create -f environment.yml | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the MHKiT conda env from enviroment.yml file |
||
| conda activate mhkit-env | ||
|
|
||
| - name: Install dependencies | ||
| - name: Install testing dependencies | ||
| shell: bash -l {0} | ||
| run: | | ||
| python -m pip install --upgrade pip wheel | ||
| pip install coverage pytest coveralls . | ||
| conda activate mhkit-env | ||
| conda install -y pytest coverage coveralls | ||
|
Comment on lines
+79
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. install development specific packages |
||
|
|
||
| - name: Install mhkit | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pip install -e . --no-deps | ||
|
|
||
| - name: Prepare non-hindcast API data | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pytest mhkit/tests/river/test_io_usgs.py | ||
| pytest mhkit/tests/tidal/test_io.py | ||
| pytest mhkit/tests/wave/io/test_cdip.py | ||
|
|
@@ -109,23 +116,30 @@ jobs: | |
| auto-update-conda: true | ||
| activate-environment: TEST | ||
| python-version: ${{ env.PYTHON_VER }} | ||
| use-only-tar-bz2: true | ||
| use-only-tar-bz2: false | ||
|
|
||
| - name: Setup Conda environment | ||
| - name: Create MHKiT Conda environment | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4 coverage --strict-channel-priority | ||
| pip install -e . --force-reinstall | ||
| conda env create -f environment.yml | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the MHKiT conda env from enviroment.yml file |
||
| conda activate mhkit-env | ||
|
|
||
| - name: Install dependencies | ||
| - name: Install testing dependencies | ||
| shell: bash -l {0} | ||
| run: | | ||
| python -m pip install --upgrade pip wheel | ||
| pip install coverage pytest coveralls . | ||
| conda activate mhkit-env | ||
| conda install -y pytest coverage coveralls | ||
|
|
||
| - name: Install mhkit | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pip install -e . --no-deps | ||
|
|
||
| - name: Prepare Wave Hindcast data | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pytest mhkit/tests/wave/io/hindcast/test_hindcast.py | ||
|
|
||
| - name: Upload Wave Hindcast data as artifact | ||
|
|
@@ -151,23 +165,30 @@ jobs: | |
| auto-update-conda: true | ||
| activate-environment: TEST | ||
| python-version: ${{ env.PYTHON_VER }} | ||
| use-only-tar-bz2: true | ||
| use-only-tar-bz2: false | ||
|
|
||
| - name: Setup Conda environment | ||
| - name: Create MHKiT Conda environment | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4 coverage --strict-channel-priority | ||
| pip install -e . --no-deps --force-reinstall | ||
| conda env create -f environment.yml | ||
| conda activate mhkit-env | ||
|
|
||
| - name: Install dependencies | ||
| - name: Install testing dependencies | ||
| shell: bash -l {0} | ||
| run: | | ||
| python -m pip install --upgrade pip wheel | ||
| pip install coverage pytest coveralls . | ||
| conda activate mhkit-env | ||
| conda install -y pytest coverage coveralls | ||
|
|
||
| - name: Install mhkit | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pip install -e . --no-deps | ||
|
|
||
| - name: Prepare Wind Hindcast data | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pytest mhkit/tests/wave/io/hindcast/test_wind_toolkit.py | ||
|
|
||
| - name: Upload Wind Hindcast data as artifact | ||
|
|
@@ -201,21 +222,28 @@ jobs: | |
| python-version: ${{ matrix.python-version }} | ||
| use-only-tar-bz2: false | ||
|
|
||
| - name: Create and setup Conda environment | ||
| - name: Create MHKiT Conda environment | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda install -c conda-forge pytest coverage=7.5.0 coveralls --strict-channel-priority | ||
| pip install -e . --force-reinstall | ||
| conda env create -f environment.yml | ||
| conda activate mhkit-env | ||
|
|
||
| - name: Download data from artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: data | ||
| path: ~/.cache/mhkit | ||
| - name: Install testing dependencies | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| conda install -y pytest coverage coveralls | ||
|
|
||
| - name: Install mhkit | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pip install -e . --no-deps | ||
|
|
||
| - name: Run pytest & generate coverage report | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| coverage run --rcfile=.github/workflows/.coveragerc --source=./mhkit/ -m pytest -c .github/workflows/pytest.ini | ||
| coverage lcov | ||
|
|
||
|
|
@@ -310,11 +338,23 @@ jobs: | |
| python-version: ${{ matrix.python-version }} | ||
| use-only-tar-bz2: false | ||
|
|
||
| - name: Setup Conda environment | ||
| - name: Create MHKiT Conda environment | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda install -c conda-forge pytest coverage=7.5.0 coveralls --strict-channel-priority | ||
| pip install -e . --force-reinstall | ||
| conda env create -f environment.yml | ||
| conda activate mhkit-env | ||
|
|
||
| - name: Install testing dependencies | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| conda install -y pytest coverage coveralls | ||
|
|
||
| - name: Install mhkit | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| pip install -e . --no-deps | ||
|
|
||
| - name: Download Wave Hindcast data from artifact | ||
| uses: actions/download-artifact@v4 | ||
|
|
@@ -335,9 +375,10 @@ jobs: | |
| mv ~/.cache/mhkit/wind-hindcast/hindcast/* ~/.cache/mhkit/hindcast/ | ||
| shell: bash | ||
|
|
||
| - name: Install MHKiT and run pytest | ||
| - name: Run hindcast pytest | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| coverage run --rcfile=.github/workflows/.coveragehindcastrc -m pytest -c .github/workflows/pytest-hindcast.ini | ||
| coverage lcov | ||
|
|
||
|
|
@@ -416,23 +457,25 @@ jobs: | |
| auto-update-conda: true | ||
| python-version: '3.11' | ||
| activate-environment: TESTconda | ||
| use-only-tar-bz2: true | ||
| use-only-tar-bz2: false | ||
|
|
||
| - name: Install dependencies | ||
| - name: Create MHKiT Conda environment | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda install numpy cython pip hdf5 libnetcdf cftime netcdf4 --strict-channel-priority | ||
| pip install -e . --force-reinstall | ||
| python -m pip install --upgrade pip wheel | ||
| pip install nbval jupyter | ||
| pip install utm folium | ||
| conda env create -f environment.yml | ||
| conda activate mhkit-env | ||
|
|
||
| - name: Install notebook testing dependencies | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| conda install -y pytest coverage coveralls nbval jupyter utm folium | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra packages this time for the notebook examples |
||
|
|
||
| - name: Ensure Conda environment is activated | ||
| - name: Install mhkit | ||
| shell: bash -l {0} | ||
| run: | | ||
| echo "source ~/miniconda3/etc/profile.d/conda.sh" >> ~/.bashrc | ||
| echo "conda activate TESTconda" >> ~/.bashrc | ||
| source ~/.bashrc | ||
| conda activate mhkit-env | ||
| pip install -e . --no-deps | ||
|
|
||
| - name: Download non-hindcast data | ||
| uses: actions/download-artifact@v4 | ||
|
|
@@ -470,6 +513,7 @@ jobs: | |
| - name: Run notebook | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda activate mhkit-env | ||
| if [[ "${{ matrix.notebook }}" == "examples/metocean_example.ipynb" || "${{ matrix.notebook }}" == "examples/WPTO_hindcast_example.ipynb" ]]; then | ||
| if [[ "${{ needs.check-changes.outputs.should-run-hindcast }}" == 'true' ]]; then | ||
| jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=${{ matrix.timeout }} "${{ matrix.notebook }}" | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to install mhkit in this file at the end? It saves the installer a step? Not sure if you are not installing mhkit here on purpose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be possible and I am not installing it on purpose because it would not make sense for testing. If MHKiT was included in the My thoughts on how users would interact with the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense to me. I think our documentation could use an update on clearly delineating the use of the different install methods (environment.yml, conda install, editable) for different use cases (developer, user, user who wants notebooks too). I can take that on in the docs repo as I make other updates
Also pip install -e . is being deprecated and we'll need a new method soon |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: myenv | ||
| name: mhkit-env | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set env name to |
||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
|
|
@@ -12,16 +12,16 @@ dependencies: | |
| - scikit-learn>=1.5.1 | ||
| - h5py>=3.11.0 | ||
| - h5pyd>=0.18.0 | ||
| - netCDF4>=1.6.5 | ||
| - hdf5>=1.14.3,<1.14.5.0a0 | ||
| - statsmodels>=0.14.2 | ||
| - requests | ||
| - beautifulsoup4 | ||
| - numexpr>=2.10.0 | ||
| - lxml | ||
| - bottleneck | ||
| - pip: | ||
| - netCDF4>=1.7.1.post1 | ||
| - matplotlib>=3.9.1 | ||
| - pecos>=0.3.0 | ||
| - fatpack | ||
| - NREL-rex>=0.2.63 | ||
| - notebook | ||
| - pecos>=0.3.0 | ||
| - notebook | ||
| - matplotlib>=3.9.1 | ||
| - fatpack | ||
| - nrel-rex | ||
|
Comment on lines
+23
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Solve everything using conda (no pip) |
||
Uh oh!
There was an error while loading. Please reload this page.