Skip to content

Commit

Permalink
code inspector comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Oct 11, 2021
1 parent 70162bf commit c2a595c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 89 deletions.
49 changes: 5 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,72 +22,33 @@ jobs:

- run:
name: run shape tests
command:
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 Reactor tests
command:
command:
pytest tests/test_reactor.py -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml

- run:
name: run parametric_shapes tests
command:
command:
pytest tests/test_parametric_shapes/ -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml

- run:
name: run parametric_components tests
command:
command:
pytest tests/test_parametric_components/ -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml

- run:
name: run parametric_reactors tests
command:
command:
pytest tests/test_parametric_reactors/ -v --cov=paramak --cov-append --cov-report term --cov-report xml --junitxml=test-reports/junit.xml

- store_test_results:
path: test-reports

- run: bash <(curl -s https://codecov.io/bash)
# @pullrequest we can't find a way of getting this next part to work, any hints appreciated
# the following jobs fail on the publish to Dockerhub step. This may be due to a bad authentification
# build-deploy-master:
# environment:
# IMAGE_NAME: openmcworkshop/paramak
# docker:
# - image: circleci/buildpack-deps:stretch
# auth:
# username: $DOCKERHUB_USERNAME
# password: $DOCKERHUB_TOKEN
# steps:
# - checkout
# - setup_remote_docker
# - run:
# name: Build Docker image
# command: docker build -t $IMAGE_NAME .
# - run:
# name: Publish Docker Image to Docker Hub
# command: |
# docker login
# docker push $IMAGE_NAME
# build-deploy-dev:
# environment:
# IMAGE_NAME: openmcworkshop/paramak
# docker:
# - image: circleci/buildpack-deps:stretch
# auth:
# username: $DOCKERHUB_USERNAME
# password: $DOCKERHUB_TOKEN
# steps:
# - checkout
# - setup_remote_docker
# - run:
# name: Build Docker image
# command: docker build -t $IMAGE_NAME:dev .
# - run:
# name: Publish Docker Image to Docker Hub
# command: |
# docker push $IMAGE_NAME:dev

workflows:
version: 2
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@

# This CI will lauch a Docker image that contains all the dependencies required
# within that image the pytest test suite is run


name: CI with install

on:
pull_request:
pull_request:
branches:
- develop
- main
- develop
- main
paths-ignore:
- 'docs/**'
- '.gitignore'
- '*.md'
- 'CITATION.cff'
- 'LICENSE.txt'
- 'readthedocs.yml'

jobs:
testing:
runs-on: ubuntu-latest
Expand All @@ -26,7 +24,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: install package
run: |
python setup.py install
Expand Down
12 changes: 6 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ dependencies:
- matplotlib
- pillow
- pip:
- sympy
- plasmaboundaries
- sphinx-autodoc-typehints
- sphinxcadquery
- defusedxml
- jupyter-cadquery
- sympy
- plasmaboundaries
- sphinx-autodoc-typehints
- sphinxcadquery
- defusedxml
- jupyter-cadquery
64 changes: 32 additions & 32 deletions paramak/parametric_components/divertor_ITER.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ def __init__(
**kwargs
)

self.IVT_anchor, self.OVT_anchor = anchors
self.IVT_coverage, self.OVT_coverage = coverages
self.IVT_radius, self.OVT_radius = radii
self.IVT_length, self.OVT_length = lengths
self.IVT_tilt, self.OVT_tilt = tilts
self.ivt_anchor, self.ovt_anchor = anchors
self.ivt_coverage, self.ovt_coverage = coverages
self.ivt_radius, self.ovt_radius = radii
self.ivt_length, self.ovt_length = lengths
self.ivt_tilt, self.ovt_tilt = tilts
self.dome = dome
self.dome_length = dome_length
self.dome_height = dome_height
Expand Down Expand Up @@ -196,41 +196,41 @@ def find_points(self):
describe the 2D profile of the ITER-like divertor
"""

# IVT points
IVT_points = self._create_vertical_target_points(
self.IVT_anchor,
math.radians(self.IVT_coverage),
math.radians(self.IVT_tilt),
-self.IVT_radius,
self.IVT_length,
# ivt points
ivt_points = self._create_vertical_target_points(
self.ivt_anchor,
math.radians(self.ivt_coverage),
math.radians(self.ivt_tilt),
-self.ivt_radius,
self.ivt_length,
)
# add connections
connections = ["circle"] * 2 + ["straight"] * 2
for i, connection in enumerate(connections):
IVT_points[i].append(connection)

# OVT points
OVT_points = self._create_vertical_target_points(
self.OVT_anchor,
-math.radians(self.OVT_coverage),
math.radians(self.OVT_tilt),
self.OVT_radius,
self.OVT_length,
ivt_points[i].append(connection)

# ovt points
ovt_points = self._create_vertical_target_points(
self.ovt_anchor,
-math.radians(self.ovt_coverage),
math.radians(self.ovt_tilt),
self.ovt_radius,
self.ovt_length,
)
# add connections
connections = ["straight"] + ["circle"] * 2 + ["straight"]
for i, connection in enumerate(connections):
OVT_points[i].append(connection)
# OVT_points need to be fliped for correct connections
OVT_points = [[float(e[0]), float(e[1]), e[2]]
for e in np.flipud(OVT_points)]
ovt_points[i].append(connection)
# ovt_points need to be fliped for correct connections
ovt_points = [[float(e[0]), float(e[1]), e[2]]
for e in np.flipud(ovt_points)]

# Dome points
dome_points = []
if self.dome:
dome_points = self._create_dome_points(
IVT_points[-1][:2],
OVT_points[0][:2],
ivt_points[-1][:2],
ovt_points[0][:2],
self.dome_length,
self.dome_height,
self.dome_thickness,
Expand All @@ -239,12 +239,12 @@ def find_points(self):

# casing points
self.casing_points = self._create_casing_points(
anchors=(self.IVT_anchor, self.OVT_anchor),
c_coord=IVT_points[-1][:2],
F=OVT_points[0][:2],
targets_lengths=(self.IVT_length, self.OVT_length),
anchors=(self.ivt_anchor, self.ovt_anchor),
c_coord=ivt_points[-1][:2],
F=ovt_points[0][:2],
targets_lengths=(self.ivt_length, self.ovt_length),
)

# append all points
points = IVT_points + dome_points + OVT_points + self.casing_points
points = ivt_points + dome_points + ovt_points + self.casing_points
self.points = points

0 comments on commit c2a595c

Please sign in to comment.