From 885582ee2fb182f7a5484834bd0dc9b992b65a19 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 10 Jul 2024 10:44:41 -0500 Subject: [PATCH 1/6] Assume pystell is installed properly in Python environment --- Dockerfile | 6 +++--- README.md | 6 ++---- parastell/invessel_build.py | 2 +- parastell/nwl_utils.py | 4 ++-- parastell/parastell.py | 2 +- parastell/source_mesh.py | 2 +- tests/test_invessel_build.py | 2 +- tests/test_source_mesh.py | 2 +- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9dbf4cb8..91aa3865 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,8 +48,8 @@ RUN echo "conda activate parastell_env" >> /opt/etc/bashrc WORKDIR /opt -# Install PyStell-UW -RUN git clone https://github.com/aaroncbader/pystell_uw.git -ENV PYTHONPATH=$PYTHONPATH:/opt/pystell_uw +# Install PyStell-UW into conda environment +RUN conda activate parastell_env +RUN python -m pip install git+https://github.com/aaroncbader/pystell_uw.git WORKDIR / diff --git a/README.md b/README.md index 1093eb93..77603d34 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,12 @@ While it is possible to use ParaStell with older versions of Cubit, additional s If you do not have a Coreform Cubit license, you may be able to get one through [Cubit Learn](https://coreform.com/products/coreform-cubit/free-meshing-software/) at no cost. ### Install PyStell-UW -Download and extract the PyStell-UW repository: +To install the PyStell-UW package, run: ```bash -git clone https://github.com/aaroncbader/pystell_uw.git +python -m pip install git+https://github.com/aaroncbader/pystell_uw.git ``` -or download the and extract the ZIP file from [PyStell-UW](https://github.com/aaroncbader/pystell_uw). Once extracted, add the repository directory to your `PYTHONPATH`. - ## Install ParaStell Download and extract the ParaStell repository: diff --git a/parastell/invessel_build.py b/parastell/invessel_build.py index 54afd90b..30737191 100644 --- a/parastell/invessel_build.py +++ b/parastell/invessel_build.py @@ -7,7 +7,7 @@ import cubit import cadquery as cq import cad_to_dagmc -import src.pystell.read_vmec as read_vmec +import pystell.read_vmec as read_vmec from . import log from .utils import ( diff --git a/parastell/nwl_utils.py b/parastell/nwl_utils.py index 74563eb3..2eba5fff 100644 --- a/parastell/nwl_utils.py +++ b/parastell/nwl_utils.py @@ -2,7 +2,7 @@ import numpy as np from scipy.optimize import direct import openmc -import src.pystell.read_vmec as read_vmec +import pystell.read_vmec as read_vmec import matplotlib.pyplot as plt @@ -349,4 +349,4 @@ def nwl_plot( nwl_mat = nwl_mat/area_array plot(nwl_mat, phi_pts, theta_pts, num_levels) - return nwl_mat, phi_pts, theta_pts, area_array \ No newline at end of file + return nwl_mat, phi_pts, theta_pts, area_array diff --git a/parastell/parastell.py b/parastell/parastell.py index 6d62f7e5..7bf33866 100644 --- a/parastell/parastell.py +++ b/parastell/parastell.py @@ -4,7 +4,7 @@ import cubit import numpy as np -import src.pystell.read_vmec as read_vmec +import pystell.read_vmec as read_vmec from . import log diff --git a/parastell/source_mesh.py b/parastell/source_mesh.py index 0c94ad1f..fcfbd6fa 100644 --- a/parastell/source_mesh.py +++ b/parastell/source_mesh.py @@ -3,7 +3,7 @@ import numpy as np from pymoab import core, types -import src.pystell.read_vmec as read_vmec +import pystell.read_vmec as read_vmec from . import log as log from .utils import read_yaml_config, filter_kwargs, m2cm diff --git a/tests/test_invessel_build.py b/tests/test_invessel_build.py index 9796fcd5..7faf510e 100644 --- a/tests/test_invessel_build.py +++ b/tests/test_invessel_build.py @@ -7,7 +7,7 @@ # dependencies correctly import parastell.invessel_build as ivb -import src.pystell.read_vmec as read_vmec +import pystell.read_vmec as read_vmec def remove_files(): diff --git a/tests/test_source_mesh.py b/tests/test_source_mesh.py index c3b1ea70..5851d4d6 100644 --- a/tests/test_source_mesh.py +++ b/tests/test_source_mesh.py @@ -2,7 +2,7 @@ import numpy as np import pytest -import src.pystell.read_vmec as read_vmec +import pystell.read_vmec as read_vmec import parastell.source_mesh as sm From ce99dc65b2966e1b9a4cd8d0321fcf84d660c974 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 10 Jul 2024 12:05:33 -0500 Subject: [PATCH 2/6] Temporarily use PYTHONPATH for pystell in Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91aa3865..a3e4f52a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,8 +48,8 @@ RUN echo "conda activate parastell_env" >> /opt/etc/bashrc WORKDIR /opt -# Install PyStell-UW into conda environment -RUN conda activate parastell_env -RUN python -m pip install git+https://github.com/aaroncbader/pystell_uw.git +# Install PyStell-UW +RUN git clone https://github.com/aaroncbader/pystell_uw.git +ENV PYTHONPATH=$PYTHONPATH:/opt/pystell_uw/src WORKDIR / From 44de981346c5c4da90e681a9f864b513cb962bdd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 10 Jul 2024 14:21:16 -0500 Subject: [PATCH 3/6] Modify PYTHONPATH in ci.yml --- .github/workflows/ci.yml | 2 +- Dockerfile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5b6c236..64bf57bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: run: | . /opt/etc/bashrc sed -e "s/@SERVER@/${rlmSERVER}/" -e "s/@PASSWORD@/${rlmPASSWD}/" /opt/Coreform-Cubit-2023.11/bin/licenses/rlmcloud.in > /opt/Coreform-Cubit-2023.11/bin/licenses/rlmcloud.lic - export PYTHONPATH=${PYTHONPATH}:`pwd` + export PYTHONPATH=${PYTHONPATH}:`pwd`:/opt/pystell_uw/src cd tests pytest -v . env: diff --git a/Dockerfile b/Dockerfile index a3e4f52a..91aa3865 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,8 +48,8 @@ RUN echo "conda activate parastell_env" >> /opt/etc/bashrc WORKDIR /opt -# Install PyStell-UW -RUN git clone https://github.com/aaroncbader/pystell_uw.git -ENV PYTHONPATH=$PYTHONPATH:/opt/pystell_uw/src +# Install PyStell-UW into conda environment +RUN conda activate parastell_env +RUN python -m pip install git+https://github.com/aaroncbader/pystell_uw.git WORKDIR / From b1dd42d25eb389e4f1139a57768733c9fd457ee9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 11 Jul 2024 08:41:31 -0500 Subject: [PATCH 4/6] Fix Dinstall of pystell in Dockerfile --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91aa3865..151d53ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM continuumio/miniconda3 as parastell-deps +FROM continuumio/miniconda3 AS parastell-deps ENV TZ=America/Chicago RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -49,7 +49,6 @@ RUN echo "conda activate parastell_env" >> /opt/etc/bashrc WORKDIR /opt # Install PyStell-UW into conda environment -RUN conda activate parastell_env -RUN python -m pip install git+https://github.com/aaroncbader/pystell_uw.git +RUN . /opt/etc/bashrc && python -m pip install git+https://github.com/aaroncbader/pystell_uw.git WORKDIR / From d6c414457f07fc7edc986e1b58c24c04b7eb4439 Mon Sep 17 00:00:00 2001 From: Edgar Date: Fri, 12 Jul 2024 14:32:47 -0500 Subject: [PATCH 5/6] add pystell to pip dependencies in environment.yml --- .github/workflows/ci.yml | 2 +- Dockerfile | 5 ----- environment.yml | 3 ++- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64bf57bc..e5b6c236 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: run: | . /opt/etc/bashrc sed -e "s/@SERVER@/${rlmSERVER}/" -e "s/@PASSWORD@/${rlmPASSWD}/" /opt/Coreform-Cubit-2023.11/bin/licenses/rlmcloud.in > /opt/Coreform-Cubit-2023.11/bin/licenses/rlmcloud.lic - export PYTHONPATH=${PYTHONPATH}:`pwd`:/opt/pystell_uw/src + export PYTHONPATH=${PYTHONPATH}:`pwd` cd tests pytest -v . env: diff --git a/Dockerfile b/Dockerfile index 151d53ed..0542158f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,9 +46,4 @@ COPY ./environment.yml /environment.yml RUN conda env create -f environment.yml RUN echo "conda activate parastell_env" >> /opt/etc/bashrc -WORKDIR /opt - -# Install PyStell-UW into conda environment -RUN . /opt/etc/bashrc && python -m pip install git+https://github.com/aaroncbader/pystell_uw.git - WORKDIR / diff --git a/environment.yml b/environment.yml index b482a26d..b3d66177 100644 --- a/environment.yml +++ b/environment.yml @@ -17,4 +17,5 @@ dependencies: - pip: - netcdf4 - pyyaml - - pytest \ No newline at end of file + - pytest + - git+https://github.com/aaroncbader/pystell_uw.git \ No newline at end of file From 1ddc6481ac2ca5d50200cbbeb528ce5574012ac3 Mon Sep 17 00:00:00 2001 From: Edgar Date: Fri, 12 Jul 2024 14:35:51 -0500 Subject: [PATCH 6/6] update readme to reflect that pystell is in environment.yml --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 77603d34..8b77f676 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,6 @@ While it is possible to use ParaStell with older versions of Cubit, additional s If you do not have a Coreform Cubit license, you may be able to get one through [Cubit Learn](https://coreform.com/products/coreform-cubit/free-meshing-software/) at no cost. -### Install PyStell-UW -To install the PyStell-UW package, run: - -```bash -python -m pip install git+https://github.com/aaroncbader/pystell_uw.git -``` - ## Install ParaStell Download and extract the ParaStell repository: