Skip to content

Commit

Permalink
Merge branch 'GEOUNED-org:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
psauvan authored Jul 13, 2024
2 parents e10c80d + f7f4279 commit 326b613
Show file tree
Hide file tree
Showing 61 changed files with 1,395 additions and 1,868 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,24 @@ jobs:
geouned_cadtocsg --help
python -c 'import geouned'
python -c 'from geouned import CadToCsg'
python -c 'from geouned.GEOReverse import reverse'
python -c 'from geouned import CsgToCad'
python -m pip install .[tests]
- name: testing package version
run: |
python -m pytest -v tests/test_version.py
- name: testing GEOUNED functionality
- name: testing GEOUNED CadToCsg functionality
run: |
python -m pytest -v tests/test_convert.py
geouned_cadtocsg -i tests/config_complete_defaults.json
geouned_cadtocsg -i tests/config_non_defaults.json
python -m pytest -v tests/test_cadtocsg.py
geouned_cadtocsg -i tests/config_cadtocsg_complete_defaults.json
geouned_cadtocsg -i tests/config_cadtocsg_non_defaults.json
- name: testing GEOUNED CsgToCad functionality
run: |
python -m pytest -v tests/test_csgtocad.py
geouned_csgtocad -i tests/config_csgtocad_complete.json
geouned_csgtocad -i tests/config_csgtocad_minimal.json
- name: install openmc
if: ${{ matrix.os == 'ubuntu-latest'}}
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/documentation_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: documentation release

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
testing:
name: Documentation
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: checkout actions
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge

- name: install dependencies
run: conda install -c conda-forge freecad -y

- name: install package
run: |
pip install --upgrade pip
pip install .[docs]
- name: Sphinx build
run: |
sphinx-build docs _build/${{ github.ref_name }}
- 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: documentation
name: documentation update dev

on:
pull_request:
Expand Down Expand Up @@ -41,12 +41,16 @@ jobs:
pip install .[docs]
- name: Sphinx build
run: |
sphinx-build docs _build
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/
force_orphan: true
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
[![CI testing](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/ci.yml)
[![Upload Python Package](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/python-publish.yml/badge.svg)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/python-publish.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![documentation](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation.yml/badge.svg)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation.yml)
[![documentation release](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation_release.yml/badge.svg)](https://github.com/GEOUNED-org/GEOUNED/actions/workflows/documentation_release.yml)
[![PyPI](https://img.shields.io/pypi/v/geouned?&label=PyPI)](https://pypi.org/project/geouned/)

[![Anaconda-Server Badge](https://anaconda.org/conda-forge/geouned/badges/version.svg)](https://anaconda.org/conda-forge/geouned)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/geouned/badges/platforms.svg)](https://anaconda.org/conda-forge/geouned)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/geouned/badges/downloads.svg)](https://anaconda.org/conda-forge/geouned)

# GEOUNED

A tool to convert from CAD to CSG & CSG to CAD for Monte Carlo transport codes (MCNP & OpenMC).
This repository contains the implementation of the algorithm presented in the paper [GEOUNED: A new conversion tool from CAD to Monte Carlo geometry](https://doi.org/10.1016/j.net.2024.01.052).

Expand Down
37 changes: 29 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import re
import sys

sys.path.insert(0, os.path.abspath("../../src"))
Expand All @@ -22,7 +23,10 @@
author = "Juan-Pablo Catalan and Patrick Sauvan"

# The full version, including alpha/beta/rc tags
release = "1.0.1"
import geouned

version = geouned.__version__
release = geouned.__version__


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -51,17 +55,34 @@

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# The theme to use for HTML and HTML Help pages.
# this theme supports versions https://github.com/pydata/pydata-sphinx-theme
html_theme = "pydata_sphinx_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

html_context = {
"display_github": True,
}
# TODO add logo
# html_favicon = "favicon.ico"

# Version match must match the 'version' key in version_switcher.json
pattern = re.compile(r"^[0-9]+\.[0-9]+")
version_match = pattern.search(version)
if version_match:
version_match = version_match.group()
elif "dev" in version:
version_match = "dev"
else:
version_match = version

html_theme_options = {
"github_url": "https://github.com/GEOUNED-org/GEOUNED",
"switcher": {
"json_url": "https://raw.githubusercontent.com/GEOUNED-org/GEOUNED/dev/docs/version_switcher.json",
"version_match": version_match,
},
"nav_title": "Geouned",
"navbar_start": ["version-switcher", "navbar-icon-links"],
}
Loading

0 comments on commit 326b613

Please sign in to comment.