Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ poetry.lock
*.ipynb_checkpoints*

examples/*.nc
examples/*.py #these are just py copies of the ipynb
buildscripts/*_log


tests/data/*

*.png
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Python wrapper on Rfa using [Xarray](https://docs.xarray.dev/en/stable/). The go

## Required software and install

This package is developed for Linux distributions with a Python3 installation. In addition, R should be installed and the [Rfa](https://github.com/harphub/Rfa) library as well.

This package is developed for Linux distributions with a Python3 installation. In addition, R should be installed with the following libraries:
* [Rfa](https://github.com/harphub/Rfa)
* [ncdf4](https://cran.r-project.org/web/packages/ncdf4/index.html)

For the most stable versions use the github main, or use the version on [PyPI](https://pypi.org/project/PyFa-tool/). Install this with:
```bash
Expand Down
59 changes: 53 additions & 6 deletions buildscripts/build_package
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ cd .. #Navigate to workdir

WORKDIR=$(pwd)
DISTDIR=${WORKDIR}/dist
TESTDIR=${WORKDIR}/tests
TESTDIR=${WORKDIR}/tests
EXAMPLESDIR=${WORKDIR}/examples
#1 execute tests before building the package




#2 install the package using poetry

poetry update #to update the poetry.lock with the latest versions of the depending packages
poetry install
poetry update #to update the poetry.lock with the latest versions of the depending packages
poetry install

poetry show

Expand Down Expand Up @@ -45,14 +46,60 @@ poetry build
#poetry add rioxarray


#make logfile for each test and stream prompt output for the test
make_test_log () {
testfile="$1"
specificlogfile="${DEPLOY_DIR}/${testfile::-3}_log"
rm -f ${specificlogfile}
touch ${specificlogfile}
echo "$specificlogfile"
}



#Run tests in package space
echo 'Running the documentation examples as test'
cd ${EXAMPLESDIR}

#delete all .py versions of the examples (rebuild them from the notebooks)
rm ${EXAMPLESDIR}/*.py
#convert nb to python files
jupyter nbconvert --to python *.ipynb

cd ${EXAMPLESDIR}
filenames=`ls ./*.py`
for t in $filenames; do
example_file=${EXAMPLESDIR}/${t}
logfile="$(make_test_log ${t})"
echo Running ${t} as a test
poetry run python ${example_file} >> ${logfile} 2>&1
if [ $? -eq 0 ]; then
echo "succeeded !!"
else
echo "FAIL!!"
fi

done


cd ${TESTDIR}

poetry run python package_tests.py



echo 'Running the tests'
cd ${TESTDIR}
filenames=`ls ./*.py`
for t in $filenames; do
example_file=${TESTDIR}/${t}
logfile="$(make_test_log ${t})"
echo Running ${t} as a test
poetry run python ${example_file} >> ${logfile} 2>&1
if [ $? -eq 0 ]; then
echo "succeeded !!"
else
echo "FAIL!!"
fi

done



Expand Down
Loading