Skip to content

Commit

Permalink
Merge pull request #167 from respec/develop
Browse files Browse the repository at this point in the history
Merge Develop in Main in preparation for new release
  • Loading branch information
PaulDudaRESPEC committed Jun 19, 2024
2 parents 4a7b941 + 7a88a65 commit 0caedc5
Show file tree
Hide file tree
Showing 154 changed files with 34,496 additions and 63,976 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/hsp2-pip-install-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Python application

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master", "develop", "develop-specact" ]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics --exclude=build/*
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
test-pytest:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
pandas-version: [""]
include:
- python-version: "3.11"
pandas-version: "pandas>2.0"
coverage: true
- python-version: "3.11"
pandas-version: "pandas>1.5,<2.0"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install hsp2
run: |
# install the hsp2 executable
pip install .[dev]
- if: ${{ matrix.pandas-version }}
run: pip install "${{ matrix.pandas-version }}"
- if: ${{ matrix.coverage }}
run: |
# python coverage
NUMBA_DISABLE_JIT=1 pytest --cov --cov-branch --cov-report term-missing
- if: ${{ ! matrix.coverage }}
run: pytest

test-cmd:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install hsp2
run: |
# install the hsp2 executable
pip install .
- name: Run hsp2
run: |
# TODO: find much shorter test case.
hsp2 import_uci ./tests/test10/HSP2results/test10.uci _temp_test10.h5
hsp2 run _temp_test10.h5
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Manual
_no_git*

# Editors & IDEs
.vscode
.vs
Expand Down Expand Up @@ -42,6 +45,7 @@ htmlcov
*.log
*.hbnhead
*.units.dbf
*_temp*.h5

# Translations
*.mo
Expand All @@ -62,6 +66,11 @@ tests/GLWACSO/HSP2results/hspp007.hdf
tests/GLWACSO/HSPFresults/hspf006.HBN
tests/GLWACSO/HSP2results/hspp007.uci
tests/test_report_conversion.html
tests/land_spec/hwmA51800.h5
tests/testcbp/HSP2results/PL3_5250_0001.h5

# Omit big files
tests/**/*.h5
tests/testcbp/HSP2results/*.csv

# R files
.Rdata
.Rhistory
18 changes: 0 additions & 18 deletions HSP2/SPECL.py

This file was deleted.

10 changes: 0 additions & 10 deletions HSP2/__init__.py

This file was deleted.

10 changes: 5 additions & 5 deletions HSP2_Driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@

if file_ext.upper() == "UCI":
h5_name = filename[:-3] + "h5"
from HSP2tools.readUCI import readUCI
from hsp2.hsp2tools.readUCI import readUCI
readUCI(filename, h5_name)
# readUCI('HSPF.uci', 'test.h5')

if file_ext.upper() == "WDM":
h5_name = filename[:-3] + "h5"
from HSP2tools.readWDM import readWDM
from hsp2.hsp2tools.readWDM import readWDM
readWDM(filename, h5_name)
# readWDM('GRICM.wdm', 'test.h5')
# readWDM('ZUMBROSCEN.WDM', 'test.h5')

if file_ext.upper() == ".H5":
from HSP2.main import main
from HSP2IO.hdf import HDF5
from HSP2IO.io import IOManager
from hsp2.hsp2.main import main
from hsp2.hsp2io.hdf import HDF5
from hsp2.hsp2io.io import IOManager

hdf5_instance = HDF5(filename)
io_manager = IOManager(hdf5_instance)
Expand Down
14 changes: 0 additions & 14 deletions HSP2tools/__init__.py

This file was deleted.

Loading

0 comments on commit 0caedc5

Please sign in to comment.