diff --git a/.github/workflows/opgee-test.yml b/.github/workflows/opgee-test.yml index b55cd719..d9f409b9 100644 --- a/.github/workflows/opgee-test.yml +++ b/.github/workflows/opgee-test.yml @@ -7,49 +7,62 @@ on: - dev jobs: - test-linux: - runs-on: ubuntu-latest + test: strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] max-parallel: 5 + runs-on: ${{ matrix.os }} defaults: run: shell: bash -el {0} env: OPGEE_HOME: ${{ github.workspace }}/tests/files - CI: 'true' - opgee_pkg_list: 'opgee-linux64.pkg_list.txt' - opgee_linux_yml: 'py3-opgee-linux.yml' + CI: "true" + opgee_pkg_list: "opgee.pkg_list.txt" + opgee_env_yml: "py3-opgee.yml" steps: - - uses: actions/checkout@v4 - - name: Cache pip dependencies - uses: actions/cache@v3 - id: pip-cache - with: - path: ~/.cache/pip - key: - ${{ runner.os }}-pip-${{ hashFiles('requirements.txt')}} - restore-keys: | - ${{ runner.os }}-pip- - - name: Init Anaconda - uses: conda-incubator/setup-miniconda@v3 - with: - miniforge-version: latest - activate-environment: opgee - python-version: 3.9 - - name: Cache OPGEE env - id: opgee-env-cache - uses: actions/cache@v3 - env: - # increment cache number to invalidate and rebuild the env - CACHE_NUMBER: 0 - with: - path: ${{ env.CONDA }}/envs - key: - ${{ runner.os }}-conda-${{ runner.arch }}-${{ hashFiles(env.opgee_pkg_list) }}-${{ env.CACHE_NUMBER }} - - name: Update Conda env and pip dependencies - run: | - conda env update -n opgee -f $opgee_linux_yml - pip install -e . - python -m pip install -e . - pip install pytest-cov codecov coveralls PyYAML - if: steps.pip-cache.outputs.cache-hit != 'true' || steps.opgee-env-cache.cache-hit != 'true' \ No newline at end of file + - uses: actions/checkout@v4 + - name: Cache Conda packages + uses: actions/cache@v4 + env: + CACHE_NUMBER: 0 + with: + enableCrossOsArchive: true + path: ${{ runner.os == 'Windows' && 'D:\conda_pkgs_dir' || '~/conda_pkgs_dir'}} + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(env.opgee_env_yml) }} + restore-keys: | + ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- + - name: Cache pip dependencies + uses: actions/cache@v4 + id: pip-cache + with: + enableCrossOsArchive: true + path: ${{ runner.os == 'Windows' && 'D:\.cache\pip' || runner.os == 'macOS' && '~/Library/Caches/pip' || '~/.cache/pip' }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt')}} + restore-keys: | + ${{ runner.os }}-pip- + - name: Init Anaconda + uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-version: latest + activate-environment: opgee + python-version: 3.9 + - name: Cache OPGEE env + id: opgee-env-cache + uses: actions/cache@v4 + env: + # increment cache number to invalidate and rebuild the env + CACHE_NUMBER: 0 + with: + enableCrossOsArchive: true + path: ${{ env.CONDA }}/envs + key: ${{ runner.os }}-conda-${{ runner.arch }}-${{ hashFiles(env.opgee_pkg_list) }}-${{ env.CACHE_NUMBER }} + - name: Update Conda env and pip dependencies + run: | + conda env update -n opgee -f $opgee_env_yml + pip install -e . + pip install pytest-cov codecov coveralls PyYAML + if: steps.pip-cache.outputs.cache-hit != 'true' || steps.opgee-env-cache.outputs.cache-hit != 'true' + - name: Run unit tests with coverage + run: coverage run --source=opgee -m pytest diff --git a/Makefile b/Makefile index 8269a0d0..33ab2287 100644 --- a/Makefile +++ b/Makefile @@ -65,14 +65,7 @@ travis-reqs $(TRAVIS_REQS): requirements.in # # Virtual environment / package dependency support # -UNAME=$(strip $(shell uname)) -ifeq ($(UNAME), Darwin) - YML_FILE=py3-opgee-macos.yml -else ifeq ($(UNAME), Linux) - YML_FILE=py3-opgee-linux.yml -else - YML_FILE=py3-opgee-win10.yml -endif +YML_FILE=py3-opgee.yml #INPUT_YML=py3-opgee-macos.yml @@ -92,7 +85,12 @@ create-opgee: $(YML_FILE) install-opgee: bash -l -c 'conda activate opgee && pip install -e .' -rebuild-opgee: remove-opgee create-opgee install-opgee +rebuild-opgee: remove-opgee create-opgee travis-reqs install-opgee + +# Generate a detailed package list to cache for validation of +# environment on CI platform (currently github actions) +env-pkg-list: + conda list --export > opgee.pkg_list.txt NUITKA_EXE = opgee.exe NUITKA_OUTDIR = /tmp/opgee-nuitka diff --git a/opgee-linux64.pkg_list.txt b/opgee-linux64.pkg_list.txt deleted file mode 100644 index b6162271..00000000 --- a/opgee-linux64.pkg_list.txt +++ /dev/null @@ -1,263 +0,0 @@ -# This file may be used to create an environment using: -# $ conda create --name --file -# platform: linux-64 -_libgcc_mutex=0.1=main -_openmp_mutex=5.1=1_gnu -alabaster=0.7.16=py39h06a4308_0 -ansi2html=1.9.1=py39h06a4308_0 -ansicolors=1.1.8=pypi_0 -appdirs=1.4.4=pyhd3eb1b0_0 -arrow-cpp=16.1.0=hc1eb8f0_0 -asttokens=2.4.1=pypi_0 -atk-1.0=2.36.0=ha1a6a79_0 -aws-c-auth=0.6.19=h5eee18b_0 -aws-c-cal=0.5.20=hdbd6064_0 -aws-c-common=0.8.5=h5eee18b_0 -aws-c-compression=0.2.16=h5eee18b_0 -aws-c-event-stream=0.2.15=h6a678d5_0 -aws-c-http=0.6.25=h5eee18b_0 -aws-c-io=0.13.10=h5eee18b_0 -aws-c-mqtt=0.7.13=h5eee18b_0 -aws-c-s3=0.1.51=hdbd6064_0 -aws-c-sdkutils=0.1.6=h5eee18b_0 -aws-checksums=0.1.13=h5eee18b_0 -aws-crt-cpp=0.18.16=h6a678d5_0 -aws-sdk-cpp=1.10.55=h721c034_0 -babel=2.11.0=py39h06a4308_0 -blas=1.0=openblas -blinker=1.6.2=py39h06a4308_0 -bokeh=3.4.3=py39h2f386ee_0 -boost-cpp=1.82.0=hdb19cb5_2 -bottleneck=1.3.7=py39ha9d4c09_0 -brotli-python=1.0.9=py39h6a678d5_8 -bzip2=1.0.8=h5eee18b_6 -c-ares=1.19.1=h5eee18b_0 -ca-certificates=2024.9.24=h06a4308_0 -cairo=1.16.0=hb05425b_5 -certifi=2024.8.30=py39h06a4308_0 -cffi=1.17.1=py39h1fdaa30_0 -charset-normalizer=3.3.2=pyhd3eb1b0_0 -chemicals=1.1.4=pypi_0 -click=8.1.7=py39h06a4308_0 -cloudpickle=3.0.0=py39h06a4308_0 -colorama=0.4.6=pypi_0 -colorpalette=0.3.3=pypi_0 -colour=0.1.5=py39h06a4308_0 -commonmark=0.9.1=pyhd3eb1b0_0 -contourpy=1.2.0=py39hdb19cb5_0 -cycler=0.12.1=pypi_0 -cython=3.0.11=py39h5eee18b_0 -cytoolz=0.12.2=py39h5eee18b_0 -dash=2.14.2=py39h06a4308_0 -dash-cytoscape=0.3.0=pypi_0 -dask=2024.5.0=py39h06a4308_0 -dask-core=2024.5.0=py39h06a4308_0 -dask-expr=1.1.0=py39h06a4308_0 -dask-jobqueue=0.8.2=py39h06a4308_0 -decorator=5.1.1=pypi_0 -distributed=2024.5.0=py39h06a4308_0 -docutils=0.18.1=py39h06a4308_3 -et-xmlfile=1.1.0=pypi_0 -exceptiongroup=1.2.0=py39h06a4308_0 -executing=2.1.0=pypi_0 -expat=2.6.3=h6a678d5_0 -flask=3.0.3=py39h06a4308_0 -flask-compress=1.13=py39h06a4308_0 -flexcache=0.3=pyhd8ed1ab_0 -flexparser=0.3.1=pyhd8ed1ab_0 -flexsolve=0.5.7=pypi_0 -fluids=1.0.24=pypi_0 -font-ttf-dejavu-sans-mono=2.37=hd3eb1b0_0 -font-ttf-inconsolata=2.001=hcb22688_0 -font-ttf-source-code-pro=2.030=hd3eb1b0_0 -font-ttf-ubuntu=0.83=h8b1ccd4_0 -fontconfig=2.14.1=h55d465d_3 -fonts-anaconda=1=h8fa9717_0 -fonts-conda-ecosystem=1=hd3eb1b0_0 -fonttools=4.54.1=pypi_0 -free-properties=0.3.6=pypi_0 -freetype=2.12.1=h4a9f257_0 -fribidi=1.0.10=h7b6447c_0 -fsspec=2024.6.1=py39h06a4308_0 -future=0.18.3=py39h06a4308_0 -gdk-pixbuf=2.42.10=h5eee18b_1 -gflags=2.2.2=h6a678d5_1 -giflib=5.2.2=h5eee18b_0 -glib=2.78.4=h6a678d5_0 -glib-tools=2.78.4=h6a678d5_0 -glog=0.5.0=h6a678d5_1 -gobject-introspection=1.78.1=py39h42194e9_1 -graphite2=1.3.14=h295c915_1 -graphviz=2.50.0=h1b29801_1 -gtk2=2.24.33=h73c1081_2 -gts=0.7.6=hb67d8dd_3 -harfbuzz=4.3.0=hf52aaf7_2 -heapdict=1.0.1=pyhd3eb1b0_0 -icu=73.1=h6a678d5_0 -idna=3.7=py39h06a4308_0 -imagesize=1.4.1=py39h06a4308_0 -importlib-metadata=7.0.1=py39h06a4308_0 -importlib-resources=6.4.5=pypi_0 -iniconfig=1.1.1=pyhd3eb1b0_0 -ipython=8.18.1=pypi_0 -itsdangerous=2.2.0=py39h06a4308_0 -jedi=0.19.1=pypi_0 -jinja2=3.1.4=py39h06a4308_0 -jpeg=9e=h5eee18b_3 -kiwisolver=1.4.7=pypi_0 -krb5=1.20.1=h143b758_1 -lcms2=2.12=h3be6417_0 -ld_impl_linux-64=2.40=h12ee557_0 -lerc=3.0=h295c915_0 -libabseil=20240116.2=cxx17_h6a678d5_0 -libboost=1.82.0=h109eef0_2 -libbrotlicommon=1.0.9=h5eee18b_8 -libbrotlidec=1.0.9=h5eee18b_8 -libbrotlienc=1.0.9=h5eee18b_8 -libcurl=8.9.1=h251f7ec_0 -libdeflate=1.17=h5eee18b_1 -libedit=3.1.20230828=h5eee18b_0 -libev=4.33=h7f8727e_1 -libevent=2.1.12=hdbd6064_1 -libffi=3.4.4=h6a678d5_1 -libgcc-ng=11.2.0=h1234567_1 -libgd=2.3.3=h6a678d5_3 -libgfortran-ng=11.2.0=h00389a5_1 -libgfortran5=11.2.0=h1234567_1 -libglib=2.78.4=hdc74915_0 -libgomp=11.2.0=h1234567_1 -libgrpc=1.62.2=h2d74bed_0 -libiconv=1.16=h5eee18b_3 -libllvm14=14.0.6=hecde1de_4 -libnghttp2=1.57.0=h2d74bed_0 -libopenblas=0.3.21=h043d6bf_0 -libpng=1.6.39=h5eee18b_0 -libprotobuf=4.25.3=he621ea3_0 -libpython-static=3.9.20=h6a678d5_1 -librsvg=2.54.4=haac4a5d_4 -libssh2=1.11.0=h251f7ec_0 -libstdcxx-ng=11.2.0=h1234567_1 -libthrift=0.15.0=h1795dd8_2 -libtiff=4.5.1=h6a678d5_0 -libtool=2.4.6=h6a678d5_1009 -libuuid=1.41.5=h5eee18b_0 -libwebp=1.2.4=h11a3e52_1 -libwebp-base=1.2.4=h5eee18b_1 -libxcb=1.15=h7f8727e_0 -libxml2=2.13.1=hfdd30dd_2 -libxslt=1.1.41=h097e994_0 -llvm-openmp=14.0.6=h9e868ea_0 -llvmlite=0.43.0=py39h6a678d5_0 -locket=1.0.0=py39h06a4308_0 -lxml=5.2.1=py39h57af460_1 -lz4=4.3.2=py39h5eee18b_0 -lz4-c=1.9.4=h6a678d5_1 -markupsafe=2.1.3=py39h5eee18b_0 -matplotlib=3.9.2=pypi_0 -matplotlib-inline=0.1.7=pypi_0 -msgpack-python=1.0.3=py39hd09550d_0 -ncurses=6.4=h6a678d5_0 -nest-asyncio=1.6.0=py39h06a4308_0 -networkx=3.2.1=py39h06a4308_0 -ninja=1.10.2=h06a4308_5 -ninja-base=1.10.2=hd09550d_5 -nspr=4.35=h6a678d5_0 -nss=3.89.1=h6a678d5_0 -nuitka=1.5.8=py39h5eee18b_0 -numba=0.60.0=py39h6a678d5_0 -numexpr=2.8.7=py39h286c3b5_0 -numpy=1.26.4=py39heeff2f4_0 -numpy-base=1.26.4=py39h8a23956_0 -openjpeg=2.5.2=he7f1fd0_0 -openpyxl=3.1.5=pypi_0 -openssl=3.0.15=h5eee18b_0 -opgee=4.0a0=dev_0 -orc=2.0.1=h2d29ad5_0 -ordered-set=4.1.0=py39h06a4308_0 -packaging=24.1=py39h06a4308_0 -pandas=2.2.2=py39h6a678d5_0 -pango=1.50.7=h05da053_0 -parso=0.8.4=pypi_0 -partd=1.4.1=py39h06a4308_0 -pcre2=10.42=hebb0a14_1 -pexpect=4.9.0=pypi_0 -pillow=9.4.0=py39h6a678d5_0 -pint=0.24.3=pyhd8ed1ab_0 -pint-pandas=0.6.2=pyhd8ed1ab_0 -pip=24.2=py39h06a4308_0 -pixman=0.40.0=h7f8727e_1 -plotly=5.24.1=py39h2f386ee_0 -pluggy=1.0.0=py39h06a4308_1 -poppler=24.09.0=h55ad6a6_0 -poppler-data=0.4.11=h06a4308_1 -prompt-toolkit=3.0.48=pypi_0 -psutil=5.9.0=py39h5eee18b_0 -ptyprocess=0.7.0=pypi_0 -pure-eval=0.2.3=pypi_0 -pyarrow=16.1.0=py39h1128e8f_0 -pycparser=2.21=pyhd3eb1b0_0 -pydot=1.4.2=py39h06a4308_0 -pyglet=2.0.18=pypi_0 -pygments=2.15.1=py39h06a4308_1 -pyparsing=2.4.7=pyhd3eb1b0_0 -pysocks=1.7.1=py39h06a4308_0 -pytest=7.4.4=py39h06a4308_0 -python=3.9.20=he870216_1 -python-dateutil=2.9.0post0=py39h06a4308_2 -python-graphviz=0.20.1=py39h06a4308_0 -python-lmdb=1.4.1=py39h6a678d5_0 -python-tzdata=2023.3=pyhd3eb1b0_0 -pytz=2024.1=py39h06a4308_0 -pyxsteam=0.4.9=pypi_0 -pyyaml=6.0.2=py39h5eee18b_0 -re2=2022.04.01=h295c915_0 -readline=8.2=h5eee18b_0 -requests=2.32.3=py39h06a4308_0 -retrying=1.3.3=pyhd3eb1b0_2 -s2n=1.3.27=hdbd6064_0 -scipy=1.13.1=pypi_0 -semver=3.0.2=py39h06a4308_0 -setuptools=75.1.0=py39h06a4308_0 -six=1.16.0=pyhd3eb1b0_1 -snappy=1.2.1=h6a678d5_0 -snowballstemmer=2.2.0=pyhd3eb1b0_0 -sortedcontainers=2.4.0=pyhd3eb1b0_0 -sphinx=7.3.7=py39h5eee18b_0 -sphinx-argparse=0.4.0=pyhd8ed1ab_0 -sphinx_rtd_theme=2.0.0=py39h06a4308_0 -sphinxcontrib-applehelp=1.0.2=pyhd3eb1b0_0 -sphinxcontrib-devhelp=1.0.2=pyhd3eb1b0_0 -sphinxcontrib-htmlhelp=2.0.0=pyhd3eb1b0_0 -sphinxcontrib-jquery=4.1=py39h06a4308_0 -sphinxcontrib-jsmath=1.0.1=pyhd3eb1b0_0 -sphinxcontrib-qthelp=1.0.3=pyhd3eb1b0_0 -sphinxcontrib-serializinghtml=1.1.10=py39h06a4308_0 -sqlite=3.45.3=h5eee18b_0 -stack-data=0.6.3=pypi_0 -tbb=2021.8.0=hdb19cb5_0 -tblib=1.7.0=pyhd3eb1b0_0 -tenacity=8.2.3=py39h06a4308_0 -thermo=0.2.25=pypi_0 -thermosteam=0.34.0=pypi_0 -tk=8.6.14=h39e8969_0 -tomli=2.0.1=py39h06a4308_0 -toolz=0.12.0=py39h06a4308_0 -tornado=6.4.1=py39h5eee18b_0 -traitlets=5.14.3=pypi_0 -typing-extensions=4.11.0=py39h06a4308_0 -typing_extensions=4.11.0=py39h06a4308_0 -tzdata=2024b=h04d1e81_0 -urllib3=2.2.3=py39h06a4308_0 -utf8proc=2.6.1=h5eee18b_1 -wcwidth=0.2.13=pypi_0 -werkzeug=3.0.3=py39h06a4308_0 -wheel=0.44.0=py39h06a4308_0 -xlrd=2.0.1=pypi_0 -xyzservices=2022.9.0=py39h06a4308_1 -xz=5.4.6=h5eee18b_1 -yaml=0.2.5=h7b6447c_0 -zict=3.0.0=py39h06a4308_0 -zipp=3.20.2=py39h06a4308_0 -zlib=1.2.13=h5eee18b_1 -zstandard=0.23.0=py39h2c38b39_0 -zstd=1.5.6=hc292b87_0 diff --git a/opgee.pkg_list.txt b/opgee.pkg_list.txt new file mode 100644 index 00000000..a051cd1e --- /dev/null +++ b/opgee.pkg_list.txt @@ -0,0 +1,289 @@ +# This file may be used to create an environment using: +# $ conda create --name --file +# platform: linux-64 +_libgcc_mutex=0.1=conda_forge +_openmp_mutex=4.5=2_gnu +alabaster=1.0.0=pyhd8ed1ab_0 +ansicolors=1.1.8=pypi_0 +appdirs=1.4.4=pyh9f0ad1d_0 +asttokens=2.4.1=pypi_0 +atk-1.0=2.38.0=h04ea711_2 +aws-c-auth=0.8.0=h56a2c13_4 +aws-c-cal=0.8.0=hd3f4568_0 +aws-c-common=0.9.31=hb9d3cd8_0 +aws-c-compression=0.3.0=hf20e7d7_0 +aws-c-event-stream=0.5.0=h68c3b0c_2 +aws-c-http=0.9.0=hfad4ed3_3 +aws-c-io=0.15.0=h17eb868_2 +aws-c-mqtt=0.11.0=h407ecb8_2 +aws-c-s3=0.7.0=hadeddc1_5 +aws-c-sdkutils=0.2.0=hf20e7d7_0 +aws-checksums=0.2.0=hf20e7d7_0 +aws-crt-cpp=0.29.0=h73f0fd4_6 +aws-sdk-cpp=1.11.407=h6a6dca0_6 +azure-core-cpp=1.14.0=h5cfcd09_0 +azure-identity-cpp=1.10.0=h113e628_0 +azure-storage-blobs-cpp=12.13.0=h3cf044e_1 +azure-storage-common-cpp=12.8.0=h736e048_1 +azure-storage-files-datalake-cpp=12.12.0=ha633028_1 +babel=2.14.0=pyhd8ed1ab_0 +blinker=1.8.2=pyhd8ed1ab_0 +bokeh=3.6.0=pyhd8ed1ab_0 +brotli=1.1.0=hb9d3cd8_2 +brotli-bin=1.1.0=hb9d3cd8_2 +brotli-python=1.1.0=py311hfdbb021_2 +bzip2=1.0.8=h4bc722e_7 +c-ares=1.34.2=heb4867d_0 +ca-certificates=2024.8.30=hbcca054_0 +cairo=1.18.0=hebfffa5_3 +certifi=2024.8.30=pyhd8ed1ab_0 +cffi=1.17.1=py311hf29c0ef_0 +charset-normalizer=3.4.0=pyhd8ed1ab_0 +chemicals=1.2.0=pyhd8ed1ab_0 +click=8.1.7=unix_pyh707e725_0 +cloudpickle=3.1.0=pyhd8ed1ab_1 +colorama=0.4.6=pyhd8ed1ab_0 +colorpalette=0.3.3=pypi_0 +commonmark=0.9.1=py_0 +contourpy=1.3.0=py311hd18a35c_2 +coolprop=6.6.0=py311hfdbb021_3 +cpython=3.11.10=py311hd8ed1ab_3 +cycler=0.12.1=pyhd8ed1ab_0 +cytoolz=1.0.0=py311h9ecbd09_1 +dash=2.18.1=pyhd8ed1ab_0 +dash-core-components=2.0.0=pypi_0 +dash-cytoscape=1.0.2=pypi_0 +dash-html-components=2.0.0=pypi_0 +dash-table=5.0.0=pypi_0 +dask=2024.10.0=pyhd8ed1ab_0 +dask-core=2024.10.0=pyhd8ed1ab_0 +dask-expr=1.1.16=pyhd8ed1ab_0 +dask-jobqueue=0.9.0=pyhd8ed1ab_0 +decorator=5.1.1=pypi_0 +distributed=2024.10.0=pyhd8ed1ab_0 +docutils=0.21.2=pyhd8ed1ab_0 +et-xmlfile=2.0.0=pypi_0 +exceptiongroup=1.2.2=pyhd8ed1ab_0 +executing=2.1.0=pypi_0 +flask=3.0.3=pyhd8ed1ab_0 +flexcache=0.3=pyhd8ed1ab_0 +flexparser=0.3.1=pyhd8ed1ab_0 +flexsolve=0.5.7=pypi_0 +fluids=1.0.26=pyhff2d567_0 +font-ttf-dejavu-sans-mono=2.37=hab24e00_0 +font-ttf-inconsolata=3.000=h77eed37_0 +font-ttf-source-code-pro=2.038=h77eed37_0 +font-ttf-ubuntu=0.83=h77eed37_3 +fontconfig=2.15.0=h7e30c49_1 +fonts-conda-ecosystem=1=0 +fonts-conda-forge=1=0 +fonttools=4.54.1=py311h2dc5d0c_1 +free-properties=0.3.6=pypi_0 +freetype=2.12.1=h267a509_2 +fribidi=1.0.10=h36c2ea0_0 +fsspec=2024.10.0=pyhff2d567_0 +future=1.0.0=pyhd8ed1ab_0 +fuzzywuzzy=0.18.0=pyhd8ed1ab_0 +gdk-pixbuf=2.42.12=hb9ae30d_0 +gflags=2.2.2=h5888daf_1005 +glog=0.7.1=hbabe93e_0 +gmp=6.3.0=hac33072_2 +gmpy2=2.1.5=py311h0f6cedb_2 +graphite2=1.3.13=h59595ed_1003 +graphviz=12.0.0=hba01fac_0 +gtk2=2.24.33=h6470451_5 +gts=0.7.6=h977cf35_4 +h2=4.1.0=pyhd8ed1ab_0 +harfbuzz=9.0.0=hda332d3_1 +hpack=4.0.0=pyh9f0ad1d_0 +hyperframe=6.0.1=pyhd8ed1ab_0 +icu=75.1=he02047a_0 +idna=3.10=pyhd8ed1ab_0 +imagesize=1.4.1=pyhd8ed1ab_0 +importlib-metadata=8.5.0=pyha770c72_0 +importlib_metadata=8.5.0=hd8ed1ab_0 +iniconfig=2.0.0=pyhd8ed1ab_0 +ipython=8.29.0=pypi_0 +itsdangerous=2.2.0=pyhd8ed1ab_0 +jedi=0.19.1=pypi_0 +jinja2=3.1.4=pyhd8ed1ab_0 +keyutils=1.6.1=h166bdaf_0 +kiwisolver=1.4.7=py311hd18a35c_0 +krb5=1.21.3=h659f571_0 +lcms2=2.16=hb7c19ff_0 +ld_impl_linux-64=2.43=h712a8e2_2 +lerc=4.0.0=h27087fc_0 +levenshtein=0.26.1=py311hfdbb021_0 +libabseil=20240722.0=cxx17_h5888daf_1 +libarrow=18.0.0=ha5db6c2_1_cpu +libarrow-acero=18.0.0=h5888daf_1_cpu +libarrow-dataset=18.0.0=h5888daf_1_cpu +libarrow-substrait=18.0.0=h5c8f2c3_1_cpu +libblas=3.9.0=25_linux64_openblas +libbrotlicommon=1.1.0=hb9d3cd8_2 +libbrotlidec=1.1.0=hb9d3cd8_2 +libbrotlienc=1.1.0=hb9d3cd8_2 +libcblas=3.9.0=25_linux64_openblas +libcrc32c=1.1.2=h9c3ff4c_0 +libcurl=8.10.1=hbbe4b11_0 +libdeflate=1.22=hb9d3cd8_0 +libedit=3.1.20191231=he28a2e2_2 +libev=4.33=hd590300_2 +libevent=2.1.12=hf998b51_1 +libexpat=2.6.3=h5888daf_0 +libffi=3.4.2=h7f98852_5 +libgcc=14.2.0=h77fa898_1 +libgcc-ng=14.2.0=h69a702a_1 +libgd=2.3.3=hd3e95f3_10 +libgfortran=14.2.0=h69a702a_1 +libgfortran-ng=14.2.0=h69a702a_1 +libgfortran5=14.2.0=hd5240d6_1 +libglib=2.82.2=h2ff4ddf_0 +libgomp=14.2.0=h77fa898_1 +libgoogle-cloud=2.30.0=h804f50b_1 +libgoogle-cloud-storage=2.30.0=h0121fbd_1 +libgrpc=1.67.1=hc2c308b_0 +libiconv=1.17=hd590300_2 +libjpeg-turbo=3.0.0=hd590300_1 +liblapack=3.9.0=25_linux64_openblas +libllvm14=14.0.6=hcd5def8_4 +libnghttp2=1.64.0=h161d5f1_0 +libnsl=2.0.1=hd590300_0 +libopenblas=0.3.28=pthreads_h94d23a6_0 +libparquet=18.0.0=h6bd9018_1_cpu +libpng=1.6.44=hadc24fc_0 +libprotobuf=5.28.2=h5b01275_0 +libre2-11=2024.07.02=hbbce691_1 +librsvg=2.58.4=hc0ffecb_0 +libsqlite=3.47.0=hadc24fc_1 +libssh2=1.11.0=h0841786_0 +libstdcxx=14.2.0=hc0a3c3a_1 +libstdcxx-ng=14.2.0=h4852527_1 +libthrift=0.21.0=h0e7cc3e_0 +libtiff=4.7.0=he137b08_1 +libutf8proc=2.8.0=h166bdaf_0 +libuuid=2.38.1=h0b41bf4_0 +libwebp-base=1.4.0=hd590300_0 +libxcb=1.17.0=h8a09558_0 +libxcrypt=4.4.36=hd590300_1 +libxml2=2.13.4=hb346dea_2 +libxslt=1.1.39=h76b75d6_0 +libzlib=1.3.1=hb9d3cd8_2 +llvmlite=0.43.0=py311h9c9ff8c_1 +locket=1.0.0=pyhd8ed1ab_0 +lxml=5.3.0=py311hcfaa980_2 +lz4=4.3.3=py311h2cbdf9a_1 +lz4-c=1.9.4=hcb278e6_0 +markupsafe=3.0.2=py311h2dc5d0c_0 +matplotlib-base=3.9.2=py311h2b939e6_1 +matplotlib-inline=0.1.7=pypi_0 +mpc=1.3.1=h24ddda3_1 +mpfr=4.2.1=h90cbb55_3 +mpmath=1.3.0=pyhd8ed1ab_0 +msgpack-python=1.1.0=py311hd18a35c_0 +munkres=1.1.4=pyh9f0ad1d_0 +ncurses=6.5=he02047a_1 +nest-asyncio=1.6.0=pyhd8ed1ab_0 +networkx=3.4.2=pyhd8ed1ab_1 +numba=0.60.0=py311h4bc866e_0 +numpy=1.26.4=pypi_0 +openjpeg=2.5.2=h488ebb8_0 +openpyxl=3.1.5=pypi_0 +openssl=3.3.2=hb9d3cd8_0 +opgee=4.0a0=dev_0 +orc=2.0.2=he039a57_2 +packaging=24.1=pyhd8ed1ab_0 +pandas=2.2.3=py311h7db5c69_1 +pango=1.54.0=h4c5309f_1 +parso=0.8.4=pypi_0 +partd=1.4.2=pyhd8ed1ab_0 +pcre2=10.44=hba22ea6_2 +pexpect=4.9.0=pypi_0 +pillow=11.0.0=py311h49e9ac3_0 +pint=0.24.3=pyhd8ed1ab_0 +pint-pandas=0.6.2=pyhd8ed1ab_0 +pip=24.3.1=pyh8b19718_0 +pixman=0.43.2=h59595ed_0 +plotly=5.24.1=pyhd8ed1ab_0 +pluggy=1.5.0=pyhd8ed1ab_0 +prompt-toolkit=3.0.48=pypi_0 +psutil=6.1.0=py311h9ecbd09_0 +pthread-stubs=0.4=hb9d3cd8_1002 +ptyprocess=0.7.0=pypi_0 +pure-eval=0.2.3=pypi_0 +pyarrow=18.0.0=py311hbd00459_0 +pyarrow-core=18.0.0=py311h4854187_0_cpu +pycparser=2.22=pyhd8ed1ab_0 +pydot=3.0.1=py311h38be061_1 +pyglet=2.0.18=pypi_0 +pygments=2.18.0=pyhd8ed1ab_0 +pyparsing=3.2.0=pyhd8ed1ab_1 +pysocks=1.7.1=pyha2e5f31_6 +pytest=8.3.3=pyhd8ed1ab_0 +python=3.11.10=hc5c86c4_3_cpython +python-dateutil=2.9.0=pyhd8ed1ab_0 +python-levenshtein=0.26.1=pyhff2d567_0 +python-tzdata=2024.2=pyhd8ed1ab_0 +python_abi=3.11=5_cp311 +pytz=2024.1=pyhd8ed1ab_0 +pyxsteam=0.4.9=pypi_0 +pyyaml=6.0.2=py311h9ecbd09_1 +qhull=2020.2=h434a139_5 +rapidfuzz=3.10.1=py311hfdbb021_0 +re2=2024.07.02=h77b4e00_1 +readline=8.2=h8228510_1 +requests=2.32.3=pyhd8ed1ab_0 +retrying=1.3.3=pyhd8ed1ab_3 +s2n=1.5.6=h0e56266_0 +scipy=1.14.1=py311he9a78e4_1 +setuptools=75.3.0=pyhd8ed1ab_0 +six=1.16.0=pyh6c4a22f_0 +snappy=1.2.1=ha2e4443_0 +snowballstemmer=2.2.0=pyhd8ed1ab_0 +sortedcontainers=2.4.0=pyhd8ed1ab_0 +sphinx=8.1.3=pyhd8ed1ab_0 +sphinx-argparse=0.5.2=pyhd8ed1ab_0 +sphinx_rtd_theme=3.0.1=pyha770c72_0 +sphinxcontrib-applehelp=2.0.0=pyhd8ed1ab_0 +sphinxcontrib-devhelp=2.0.0=pyhd8ed1ab_0 +sphinxcontrib-htmlhelp=2.1.0=pyhd8ed1ab_0 +sphinxcontrib-jquery=4.1=pyhd8ed1ab_0 +sphinxcontrib-jsmath=1.0.1=pyhd8ed1ab_0 +sphinxcontrib-qthelp=2.0.0=pyhd8ed1ab_0 +sphinxcontrib-serializinghtml=1.1.10=pyhd8ed1ab_0 +stack-data=0.6.3=pypi_0 +sympy=1.13.3=pyh2585a3b_104 +tblib=3.0.0=pyhd8ed1ab_0 +tenacity=9.0.0=pyhd8ed1ab_0 +thermo=0.3.0=pyhd8ed1ab_0 +thermosteam=0.45.0=pypi_0 +tk=8.6.13=noxft_h4845f30_101 +tomli=2.0.2=pyhd8ed1ab_0 +toolz=1.0.0=pyhd8ed1ab_0 +tornado=6.4.1=py311h9ecbd09_1 +traitlets=5.14.3=pypi_0 +typing-extensions=4.12.2=hd8ed1ab_0 +typing_extensions=4.12.2=pyha770c72_0 +tzdata=2024b=hc8b5060_0 +unicodedata2=15.1.0=py311h9ecbd09_1 +urllib3=2.2.3=pyhd8ed1ab_0 +wcwidth=0.2.13=pypi_0 +werkzeug=3.0.6=pypi_0 +wheel=0.44.0=pyhd8ed1ab_0 +xlrd=2.0.1=pypi_0 +xorg-libice=1.1.1=hb9d3cd8_1 +xorg-libsm=1.2.4=he73a12e_1 +xorg-libx11=1.8.10=h4f16b4b_0 +xorg-libxau=1.0.11=hb9d3cd8_1 +xorg-libxdmcp=1.1.5=hb9d3cd8_0 +xorg-libxext=1.3.6=hb9d3cd8_0 +xorg-libxrender=0.9.11=hb9d3cd8_1 +xorg-xorgproto=2024.1=hb9d3cd8_1 +xyzservices=2024.9.0=pyhd8ed1ab_0 +xz=5.2.6=h166bdaf_0 +yaml=0.2.5=h7f98852_2 +zict=3.0.0=pyhd8ed1ab_0 +zipp=3.20.2=pyhd8ed1ab_0 +zlib=1.3.1=hb9d3cd8_2 +zstandard=0.23.0=py311hbc35293_1 +zstd=1.5.6=ha6fb4c9_0 diff --git a/opgee/graph.py b/opgee/graph.py index c5d39ad7..ff6e627f 100644 --- a/opgee/graph.py +++ b/opgee/graph.py @@ -91,13 +91,15 @@ def add_tree(graph, obj, level): display_in_notebook(graph) def write_process_diagram(field, pathname): - graph = pydot.Dot('model', graph_type='graph', bgcolor='white') + graph = pydot.Dot('model', graph_type='digraph', bgcolor='white') for name, proc in field.process_dict.items(): graph.add_node(pydot.Node(name, shape='box')) for name, stream in field.stream_dict.items(): - graph.add_edge(pydot.Edge(stream.src_name, stream.dst_name, color='black')) + contents = ', '.join(stream.contents) + graph.add_edge(pydot.Edge(stream.src_name, stream.dst_name, + color='black', label=contents)) _logger.info(f"Writing {pathname}") graph.write_png(pathname) diff --git a/opgee/thermodynamics.py b/opgee/thermodynamics.py index 7f26aa02..0234764c 100644 --- a/opgee/thermodynamics.py +++ b/opgee/thermodynamics.py @@ -12,7 +12,7 @@ import numpy as np import pint from pyXSteam.XSteam import XSteam -from thermosteam import Chemical, Mixture +from thermosteam import Chemical, IdealMixture from . import ureg from .core import OpgeeObject, STP, TemperaturePressure @@ -239,7 +239,7 @@ def __init__(self, field, composition): self.field = field self.components = [name for name, fraction in self.composition] self.mol_fraction = mol_fraction = [fraction for name, fraction in self.composition] - self.mixture = mixture = Mixture.from_chemicals(self.components) + self.mixture = mixture = IdealMixture.from_chemicals(self.components) self.mol_weight = ureg.Quantity(mixture.MW(mol_fraction), "g/mol") def density(self): diff --git a/py3-opgee-linux.yml b/py3-opgee-linux.yml deleted file mode 100644 index adfd0bf3..00000000 --- a/py3-opgee-linux.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: opgee -channels: - - anaconda - - conda-forge - - defaults -dependencies: - - colour - - cython - - dash - - dask - - dask-jobqueue - - graphviz - - python-graphviz - - jinja2 - - llvm-openmp - - lxml - - networkx - - nuitka - - numba - - numpy - - pandas - - pint - - pint-pandas - - pip - - pydot - - pytest - - python>=3.9.0,<3.10.0 - - semver - - setuptools - - sphinx>=4.3.0 - - sphinx-argparse - - sphinx_rtd_theme>=0.5.1 - - sphinxcontrib-serializinghtml - - pip: - - dash-cytoscape==0.3.0 - - pyXSteam==0.4.9 - - thermosteam==0.34.0 - - fluids==1.0.24 - - chemicals==1.1.4 - - thermo==0.2.25 diff --git a/py3-opgee-macos.yml b/py3-opgee-macos.yml deleted file mode 100644 index 95692954..00000000 --- a/py3-opgee-macos.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: opgee -channels: - - anaconda - - conda-forge - - defaults -dependencies: - - colour - - dash - - dask - - dask-jobqueue - - jinja2 - - llvm-openmp - - lxml - - networkx - - numba - - numpy - - pandas - - pint - - pint-pandas - - pip - - pydot - - pytest - - python>=3.9.0,<3.10.0 - - semver - - setuptools - - sphinx - - sphinx-argparse - - sphinx_rtd_theme - - sphinxcontrib-serializinghtml - - pip: - # - nuitka # experimental; moved here because conda version is very outdated - - dash-cytoscape - - pyXSteam - - thermosteam - - fluids==1.0.24 - - chemicals==1.1.4 - - thermo==0.2.25 diff --git a/py3-opgee-win10.yml b/py3-opgee.yml similarity index 76% rename from py3-opgee-win10.yml rename to py3-opgee.yml index ea4f01e0..e3d3c680 100644 --- a/py3-opgee-win10.yml +++ b/py3-opgee.yml @@ -1,17 +1,14 @@ name: opgee channels: - - anaconda - conda-forge - defaults dependencies: - - colour + - chemicals - dash - dask - dask-jobqueue - - jinja2 - - llvm-openmp + - fluids - lxml - - llvmlite - networkx - numba - numpy @@ -21,17 +18,15 @@ dependencies: - pip - pydot - pytest - - python>=3.9.0,<3.10.0 - - semver + - python>=3.11.0,<3.12.0 - setuptools - sphinx - sphinx-argparse - sphinx_rtd_theme - sphinxcontrib-serializinghtml - thermo - - fluids - - chemicals - pip: - - thermosteam + - dash-cytoscape - pyXSteam - - dash-cytoscape \ No newline at end of file + - thermosteam + diff --git a/requirements.txt b/requirements.txt index d6d5697f..8d569658 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,27 +1,28 @@ # This file was generated by the script update-reqs.py. Manual edits may be lost. -chemicals==1.1.4 -dash==2.14.2 -dash-cytoscape==0.3.0 -dask==2024.5.0 -dask-jobqueue==0.8.2 -fluids==1.0.24 -future==0.18.3 -lxml==5.2.1 -matplotlib==3.9.2 -networkx==3.2.1 +chemicals==1.2.0 +dash==2.18.1 +dash-core-components==2.0.0 +dash-cytoscape==1.0.2 +dash-html-components==2.0.0 +dash-table==5.0.0 +dask==2024.10.0 +dask-jobqueue==0.9.0 +fluids==1.0.26 +future==1.0.0 +lxml==5.3.0 +networkx==3.4.2 numpy==1.26.4 -pandas==2.2.2 +pandas==2.2.3 pint==0.24.3 pint-pandas==0.6.2 -pydot==1.4.2 -pytest==7.4.4 -python-dateutil==2.9.0post0 +pydot==3.0.1 +pytest==8.3.3 +python-dateutil==2.9.0 pyxsteam==0.4.9 -scipy==1.13.1 -semver==3.0.2 -setuptools==75.1.0 -sphinx==7.3.7 -sphinx-argparse==0.4.0 -sphinx_rtd_theme==2.0.0 -thermo==0.2.25 -thermosteam==0.34.0 +scipy==1.14.1 +setuptools==75.3.0 +sphinx==8.1.3 +sphinx-argparse==0.5.2 +sphinx_rtd_theme==3.0.1 +thermo==0.3.0 +thermosteam==0.45.0 diff --git a/tests/test_config.py b/tests/test_config.py index 31b7af6a..be7b1740 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -29,7 +29,7 @@ def test_realpath(tmp_path): # built-in fixture returns a temporary directory bar = tmp_path / 'bar.txt' os.symlink(foo, bar) - assert pathjoin(bar, realpath=True) == str(foo) + assert pathjoin(bar, realpath=True) == unixPath(str(foo)) def test_reload(): diff --git a/update-reqs.py b/update-reqs.py index fbf6982f..4ca43637 100755 --- a/update-reqs.py +++ b/update-reqs.py @@ -8,6 +8,8 @@ REPO_DIR = os.path.dirname(__file__) +Verbose = False + def main(): reqs_in = os.path.join(REPO_DIR, "requirements.in") reqs_out = os.path.join(REPO_DIR, "requirements.txt") @@ -16,13 +18,15 @@ def main(): pkgs = [line.strip() for line in f.readlines() if not line.startswith('#')] expr = '(' + '|'.join(pkgs) + ')' - cmd = f"conda list -f '{expr}' | egrep -v '^#'" - # | egrep -i '{expr}' + cmd = f"conda list -n opgee | egrep -v '^#' | egrep '^{expr}\\s+'" + + if Verbose: + print(cmd) - # print(cmd) proc = subprocess.run(cmd, shell=True, capture_output=True, text=True) - # print(f"Lines:\n{proc.stdout}") + if Verbose: + print(f"Lines:\n{proc.stdout}") lines = proc.stdout.split('\n') with open(reqs_out, 'w') as f: @@ -30,7 +34,10 @@ def main(): for line in lines: if not line: continue - # print(f"Line is '{line}'") + + if Verbose: + print(f"Line is '{line}'") + name, version, _, _ = re.split(r'\s+', line) f.write(f"{name}=={version}\n")