Skip to content

Commit

Permalink
Merge pull request #72 from fusion-energy/fixing_gh_action_to_permit_…
Browse files Browse the repository at this point in the history
…fails

using pytest command instead of bash
  • Loading branch information
shimwell committed Aug 26, 2021
2 parents e505d43 + 746863f commit 60a0af4
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 1,446 deletions.
5 changes: 0 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ jobs:
command:
pytest tests/test_shape.py -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml

- run:
name: run h5m export (pymoab) tests
command:
pytest tests/test_h5m_export.py -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml

- run:
name: run Reactor tests
command:
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,29 @@ jobs:
- name: install package
run: |
python setup.py install
- name: run tests
- name: Run test_utils
run: |
pytest tests/test_utils.py -v --cov=paramak --cov-append --cov-report term --cov-report xml
- name: Run test_shape
run: |
pytest tests/test_shape.py -v --cov=paramak --cov-append --cov-report term --cov-report xml
- name: Run test_reactor
run: |
pytest tests/test_reactor.py -v --cov=paramak --cov-append --cov-report term --cov-report xml
- name: Run test_parametric_shapes
run: |
pytest tests/test_parametric_shapes/ -v --cov=paramak --cov-append --cov-report term --cov-report xml
- name: Run test_parametric_components
run: |
pytest tests/test_parametric_components/ -v --cov=paramak --cov-append --cov-report term --cov-report xml
- name: Run test_parametric_reactors
run: |
bash run_tests.sh
pytest tests/test_parametric_reactors/ -v --cov=paramak --cov-append --cov-report term --cov-report xml
- name: Upload to codecov
uses: codecov/codecov-action@v2
37 changes: 0 additions & 37 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ ARG cq_version=2.1


ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 \
PATH=/opt/openmc/bin:/opt/NJOY2016/build:$PATH \
LD_LIBRARY_PATH=/opt/openmc/lib:$LD_LIBRARY_PATH \
CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \
DEBIAN_FRONTEND=noninteractive

RUN apt-get --allow-releaseinfo-change update
Expand All @@ -56,40 +53,6 @@ RUN echo installing CadQuery version $cq_version && \
pip install jupyter-cadquery==2.2.0 && \
conda clean -afy

# Download Cubit
RUN wget -O coreform-cubit-2021.5.deb https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases/Linux/Coreform-Cubit-2021.5%2B15962_5043ef39-Lin64.deb

# install Cubit dependencies
RUN apt-get install -y libx11-6
RUN apt-get install -y libxt6
RUN apt-get install -y libgl1
RUN apt-get install -y libglu1-mesa
RUN apt-get install -y libgl1-mesa-glx
RUN apt-get install -y libxcb-icccm4
RUN apt-get install -y libxcb-image0
RUN apt-get install -y libxcb-keysyms1
RUN apt-get install -y libxcb-render-util0
RUN apt-get install -y libxkbcommon-x11-0
RUN apt-get install -y libxcb-randr0
RUN apt-get install -y libxcb-xinerama0

# Install cubit
RUN dpkg -i coreform-cubit-2021.5.deb

# installs svalinn plugin for cubit
RUN wget https://github.com/svalinn/Cubit-plugin/releases/download/0.2.1/svalinn-plugin_debian-10.10_cubit_2021.5.tgz
RUN tar -xzvf svalinn-plugin_debian-10.10_cubit_2021.5.tgz -C /opt/Coreform-Cubit-2021.5

# writes a non commercial license file
RUN mkdir -p /root/.config/Coreform/licenses
RUN printf 'Fri May 28 2021' >> /root/.config/Coreform/licenses/cubit-learn.lic

# helps to identify Cubit related errrors
ENV CUBIT_VERBOSE=5

# dagmc is needed as it includes the make_watertight command and moab
RUN conda install -c conda-forge dagmc && \
conda clean -afy

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions conda_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ rm -rf /tmp/conda-build


# VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
VERSION=0.3.2
VERSION=0.4.1
PLACEHOLDER='version="develop"'
VERSION_FILE='setup.py'
# Grep checks that the placeholder is in the file. If grep doesn't find
# the placeholder then it exits with exit code 1 and github actions fails.
grep "$PLACEHOLDER" "$VERSION_FILE"
sed -i "s/$PLACEHOLDER/version=\"${VERSION}\"/g" "$VERSION_FILE"
sed -i "s@$PLACEHOLDER@version=\"${VERSION}\"@g" "$VERSION_FILE"

conda-build conda/ -c cadquery -c conda-forge --croot /tmp/conda-build

Expand All @@ -37,4 +37,4 @@ conda-build conda/ -c cadquery -c conda-forge --croot /tmp/conda-build

anaconda upload -f /tmp/conda-build/*/*.tar.bz2

sed -i "s/version=\"${VERSION}\"/$PLACEHOLDER/g" "$VERSION_FILE"
sed -i "s@version=\"${VERSION}\"@$PLACEHOLDER@g" "$VERSION_FILE"
3 changes: 0 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ dependencies:
- numpy
- matplotlib
- pillow
- moab=5.3.0
- remove_dagmc_tags
- pip:
- sympy
- plasmaboundaries
- sphinx-autodoc-typehints
- sphinxcadquery
- defusedxml
- jupyter-cadquery
- cad_to_h5m
1 change: 0 additions & 1 deletion paramak/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from .shape import Shape
from .reactor import Reactor
from .utils import define_moab_core_and_tags, add_stl_to_moab_core, export_vtk
from .utils import rotate, extend, distance_between_two_points, diff_between_angles
from .utils import EdgeLengthSelector, FaceAreaSelector

Expand Down
2 changes: 0 additions & 2 deletions paramak/parametric_reactors/ball_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ def __init__(

super().__init__([])

self.method = 'cubit'

self.inner_bore_radial_thickness = inner_bore_radial_thickness
self.inboard_tf_leg_radial_thickness = inboard_tf_leg_radial_thickness
self.center_column_shield_radial_thickness = \
Expand Down
2 changes: 0 additions & 2 deletions paramak/parametric_reactors/center_column_study_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ def __init__(

super().__init__([])

self.method = 'cubit'

self.inner_bore_radial_thickness = inner_bore_radial_thickness
self.inboard_tf_leg_radial_thickness = inboard_tf_leg_radial_thickness
self.center_column_shield_radial_thickness_mid = \
Expand Down
2 changes: 0 additions & 2 deletions paramak/parametric_reactors/eu_demo_2015_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def __init__(

super().__init__([])

self.method = 'cubit'

self.rotation_angle = rotation_angle
self.number_of_tf_coils = number_of_tf_coils

Expand Down
2 changes: 0 additions & 2 deletions paramak/parametric_reactors/submersion_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ def __init__(

super().__init__([])

self.method = 'cubit'

self.inner_bore_radial_thickness = inner_bore_radial_thickness
self.inboard_tf_leg_radial_thickness = inboard_tf_leg_radial_thickness
self.center_column_shield_radial_thickness = (
Expand Down
Loading

0 comments on commit 60a0af4

Please sign in to comment.