Skip to content

Commit 0caedc5

Browse files
Merge pull request #167 from respec/develop
Merge Develop in Main in preparation for new release
2 parents 4a7b941 + 7a88a65 commit 0caedc5

File tree

154 files changed

+34496
-63976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+34496
-63976
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Python application
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master", "develop", "develop-specact" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
cache: "pip"
22+
- name: Install dependencies
23+
run: |
24+
pip install flake8
25+
- name: Lint with flake8
26+
run: |
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics --exclude=build/*
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
32+
test-pytest:
33+
runs-on: ubuntu-latest
34+
continue-on-error: true
35+
strategy:
36+
matrix:
37+
python-version: ["3.9", "3.10", "3.11", "3.12"]
38+
pandas-version: [""]
39+
include:
40+
- python-version: "3.11"
41+
pandas-version: "pandas>2.0"
42+
coverage: true
43+
- python-version: "3.11"
44+
pandas-version: "pandas>1.5,<2.0"
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up Python
48+
uses: actions/setup-python@v4
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
cache: "pip"
52+
- name: Install hsp2
53+
run: |
54+
# install the hsp2 executable
55+
pip install .[dev]
56+
- if: ${{ matrix.pandas-version }}
57+
run: pip install "${{ matrix.pandas-version }}"
58+
- if: ${{ matrix.coverage }}
59+
run: |
60+
# python coverage
61+
NUMBA_DISABLE_JIT=1 pytest --cov --cov-branch --cov-report term-missing
62+
- if: ${{ ! matrix.coverage }}
63+
run: pytest
64+
65+
test-cmd:
66+
runs-on: ubuntu-latest
67+
continue-on-error: true
68+
strategy:
69+
matrix:
70+
python-version: ["3.9", "3.10", "3.11", "3.12"]
71+
steps:
72+
- uses: actions/checkout@v4
73+
- name: Set up Python
74+
uses: actions/setup-python@v4
75+
with:
76+
python-version: ${{ matrix.python-version }}
77+
cache: "pip"
78+
- name: Install hsp2
79+
run: |
80+
# install the hsp2 executable
81+
pip install .
82+
- name: Run hsp2
83+
run: |
84+
# TODO: find much shorter test case.
85+
hsp2 import_uci ./tests/test10/HSP2results/test10.uci _temp_test10.h5
86+
hsp2 run _temp_test10.h5
87+

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Manual
2+
_no_git*
3+
14
# Editors & IDEs
25
.vscode
36
.vs
@@ -42,6 +45,7 @@ htmlcov
4245
*.log
4346
*.hbnhead
4447
*.units.dbf
48+
*_temp*.h5
4549

4650
# Translations
4751
*.mo
@@ -62,6 +66,11 @@ tests/GLWACSO/HSP2results/hspp007.hdf
6266
tests/GLWACSO/HSPFresults/hspf006.HBN
6367
tests/GLWACSO/HSP2results/hspp007.uci
6468
tests/test_report_conversion.html
65-
tests/land_spec/hwmA51800.h5
66-
tests/testcbp/HSP2results/PL3_5250_0001.h5
69+
70+
# Omit big files
71+
tests/**/*.h5
6772
tests/testcbp/HSP2results/*.csv
73+
74+
# R files
75+
.Rdata
76+
.Rhistory

HSP2/SPECL.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

HSP2/__init__.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

HSP2_Driver.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@
3232

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

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

4646
if file_ext.upper() == ".H5":
47-
from HSP2.main import main
48-
from HSP2IO.hdf import HDF5
49-
from HSP2IO.io import IOManager
47+
from hsp2.hsp2.main import main
48+
from hsp2.hsp2io.hdf import HDF5
49+
from hsp2.hsp2io.io import IOManager
5050

5151
hdf5_instance = HDF5(filename)
5252
io_manager = IOManager(hdf5_instance)

HSP2tools/__init__.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)