Skip to content

Commit

Permalink
complete project rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-proximafusion committed Sep 26, 2024
0 parents commit 3181d7e
Show file tree
Hide file tree
Showing 60 changed files with 5,847 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI testing

on:
pull_request:
branches:
- develop
- main
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]

steps:
- name: Install system packages
run: |
sudo apt-get update -y
sudo apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
- name: checkout actions
uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.8-0' # any version from https://github.com/mamba-org/micromamba-releases
environment-file: environment_dev.yml
init-shell: bash
cache-environment: true
post-cleanup: 'all'

- name: install dependencies run tests
shell: bash -el {0}
run: |
python -m pip install .[tests]
- name: Test with pytest
shell: bash -el {0}
run: |
pytest -v
python examples/plasma.py
python examples/spherical_tokamak_from_plasma_minimal.py
python examples/spherical_tokamak_from_plasma_with_divertor.py
python examples/spherical_tokamak_from_plasma_with_pf_magnets_and_divertors.py
python examples/spherical_tokamak_from_plasma_with_pf_magnets.py
python examples/spherical_tokamak_from_plasma_with_tf_magnets.py
python examples/spherical_tokamak_minimal.py
python examples/tokamak_from_plasma_minimal.py
python examples/tokamak_minimal.py
python examples/tokamak_from_plasma_with_divertor.py
63 changes: 63 additions & 0 deletions .github/workflows/documentation_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: documentation release

on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '*'


permissions:
contents: write

jobs:
testing:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: checkout actions
uses: actions/checkout@v4

- name: Install system packages
run: |
sudo apt-get update -y
sudo apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.8-0' # any version from https://github.com/mamba-org/micromamba-releases
environment-file: environment_dev.yml
init-shell: bash
cache-environment: true
post-cleanup: 'all'

- name: install package
run: |
pip install --upgrade pip
pip install .[docs]
- name: Sphinx build tagged version
if: startsWith(github.ref, 'refs/tags/')
run: |
sphinx-build docs _build/${{ github.ref_name }}
sphinx-build docs _build
- name: Sphinx build dev version
if: (github.event_name == 'push' || github.event_name == 'pull_request') && !startsWith(github.ref, 'refs/tags/')
run: |
sphinx-build docs _build/dev
- name: Deploy to GitHub Pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build
# with next rlease of actions-gh-pages
# issue to allow force_orphan will be fixed
# https://github.com/peaceiris/actions-gh-pages/issues/455
# force_orphan: true
keep_files: true
177 changes: 177 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

src/_version.py

# openmc files
*.h5
*.out
*.xml
*.h5m
*.h5

# cad files
*.step
*.stp
*.sql
*.html
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

[![N|Python](https://www.python.org/static/community_logos/python-powered-w-100x40.png)](https://www.python.org)

[![CI testing](https://github.com/fusion-energy/paramak2/actions/workflows/ci.yml/badge.svg)](https://github.com/fusion-energy/paramak2/actions/workflows/ci.yml)

[![documentation release](https://github.com/fusion-energy/paramak2/actions/workflows/documentation_update.yml/badge.svg)](https://github.com/fusion-energy/paramak2/actions/workflows/documentation_update.yml)


# Paramak

Paramak python package allows rapid production of 3D CAD models and neutronics
models of fusion reactors. The purpose of Paramak is to provide geometry for
parametric studies. Paramak can create geometry in standard CAD formats such as
STP, STL, BRep, HTML and DAGMC h5m.

:point_right: Please see the [Documentation](https://paramak.readthedocs.io) for installation, usage and API documentation.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Documentation section

To build the documentation locally

```
sphinx-build docs _build
```
or
```
make html
```
Loading

0 comments on commit 3181d7e

Please sign in to comment.