Skip to content

Commit

Permalink
Merge pull request #109 from ukaea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
shimwell authored Feb 7, 2021
2 parents 4e654ff + 6ad71ca commit 4ec3fcb
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2.1
jobs:
build:
docker:
- image: openmcworkshop/openmc_workshop_dependencies:openmc_nndc
- image: openmc/openmc:develop

working_directory: ~/repo

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autopep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
git config --global user.name 'autopep8'
git config --global user.email '[email protected]'
git commit -am "Automated autopep8 fixes"
git push
git push
32 changes: 32 additions & 0 deletions .github/workflows/python-publish-testpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
push:
branches:
- develop

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository testpypi dist/*
32 changes: 16 additions & 16 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
48 changes: 24 additions & 24 deletions neutronics_material_maker/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import re
import warnings
from json import JSONEncoder

from typing import Optional, Dict
import asteval
from CoolProp.CoolProp import PropsSI

Expand Down Expand Up @@ -140,29 +140,29 @@ class Material:

def __init__(
self,
material_name=None,
packing_fraction=1.0,
material_tag=None,
enrichment=None,
enrichment_target=None,
temperature_in_C=None,
temperature_in_K=None,
pressure_in_Pa=None,
elements=None,
chemical_equation=None,
isotopes=None,
percent_type=None,
density=None,
density_unit=None,
density_equation=None,
atoms_per_unit_cell=None,
volume_of_unit_cell_cm3=None,
enrichment_type=None,
reference=None,
zaid_suffix=None,
material_id=None,
decimal_places=8,
volume_in_cm3=None,
material_name: Optional[str] = None,
packing_fraction: Optional[float] = 1.0,
material_tag: Optional[str] = None,
enrichment: Optional[float] = None,
enrichment_target: Optional[str] = None,
temperature_in_C: Optional[float] = None,
temperature_in_K: Optional[float] = None,
pressure_in_Pa: Optional[float] = None,
elements: Optional[Dict[str, float]] = None,
chemical_equation: Optional[str] = None,
isotopes: Optional[Dict[str, float]] = None,
percent_type: Optional[str] = None,
density: Optional[float] = None,
density_unit: Optional[str] = None,
density_equation: Optional[str] = None,
atoms_per_unit_cell: Optional[int] = None,
volume_of_unit_cell_cm3: Optional[float] = None,
enrichment_type: Optional[str] = None,
reference: Optional[str] = None,
zaid_suffix: Optional[str] = None,
material_id: Optional[int] = None,
decimal_places: Optional[int] = 8,
volume_in_cm3: Optional[float] = None,
):

self.material_name = material_name
Expand Down
36 changes: 18 additions & 18 deletions neutronics_material_maker/mutlimaterial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

__author__ = "neutronics material maker development team"

from neutronics_material_maker import (
make_fispact_material,
make_serpent_material,
make_mcnp_material,
)
import neutronics_material_maker as nmm
from json import JSONEncoder
import warnings
from json import JSONEncoder
from typing import List, Optional

import neutronics_material_maker as nmm
from neutronics_material_maker import (make_fispact_material,
make_mcnp_material,
make_serpent_material)

OPENMC_AVAILABLE = True
try:
Expand Down Expand Up @@ -79,17 +79,17 @@ class MultiMaterial:

def __init__(
self,
material_tag=None,
materials=[],
fracs=[],
percent_type="vo",
packing_fraction=1.0,
zaid_suffix=None,
material_id=None,
decimal_places=8,
volume_in_cm3=None,
temperature_in_C=None,
temperature_in_K=None
material_tag: Optional[str] = None,
materials: list = [],
fracs: List[float] = [],
percent_type: str = "vo",
packing_fraction: float = 1.0,
zaid_suffix: str = None,
material_id: int = None,
decimal_places: int = 8,
volume_in_cm3: float = None,
temperature_in_C: float = None,
temperature_in_K: float = None
):
self.material_tag = material_tag
self.materials = materials
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="neutronics_material_maker",
version="0.1.11",
version="0.1.12",
summary="Package for making material cards for neutronics codes",
author="neutronics_material_maker development team",
author_email="[email protected]",
Expand Down

0 comments on commit 4ec3fcb

Please sign in to comment.