Skip to content

Commit

Permalink
Merge branch 'main' into releases_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
RemDelaporteMathurin committed Nov 21, 2024
2 parents d030bbf + b58babb commit c46ab6a
Show file tree
Hide file tree
Showing 65 changed files with 2,222 additions and 410 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bib linguist-vendored
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,30 @@ jobs:
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }}
check_unused_variables:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x # Choose your desired Python version

- name: Install vulture
run: pip install vulture

- name: Check for unused variables
continue-on-error: true
run: vulture h_transport_materials/property_database

- name: Check vulture output
run: |
vulture_output=$(vulture h_transport_materials/property_database) || true
if [[ $vulture_output == *"unused variable"* ]]; then
echo "Error: Unused variables found."
exit 1
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# macOS stuff
.DS_Store
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ python:
- requirements: docs/requirements.txt
- method: pip
path: .
system_packages: false
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx==6.2.1
sphinx-design==0.4.1
sphinx_book_theme==1.0.1
matplotlib==3.7.1
matplotlib==3.7.1
numpy<2
4 changes: 2 additions & 2 deletions docs/user/groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ It is also possible to export some of the data to a latex table with:
\begin{tabular}{ c c c c}

Material & pre-exp. factor & Act. energy & Reference \\
& $1.00\times 10^{0}\ \frac{\mathrm{m}^{2}}{\mathrm{s}}$ & 0.10 eV/particle & \cite{} \\
& $2.00\times 10^{0}\ \frac{\mathrm{particle}}{\left(\mathrm{Pa} \cdot \mathrm{m}^{3}\right)}$ & 0.20 eV/particle & \cite{} \\
& $1.00\times 10^{0}\ \frac{\mathrm{m}^{2}}{\mathrm{s}}$ & 0.10 eV/particle & \cite{} \\
& $2.00\times 10^{0}\ \frac{\mathrm{particle}}{\left(\mathrm{m}^{3} \cdot \mathrm{Pa}\right)}$ & 0.20 eV/particle & \cite{} \\
\end{tabular}
\end{center}

Expand Down
16 changes: 15 additions & 1 deletion h_transport_materials/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,15 @@ def __init__(self):
class MoltenSalt(Material):
family = "molten salt"


class FeCrAl(Steel):
family = "fecral"


class PalladiumAlloy(Alloy):
family = "palladium alloy"


TUNGSTEN = Tungsten()
BERYLLIUM = Beryllium()
CARBON = Carbon()
Expand Down Expand Up @@ -144,8 +150,10 @@ class FeCrAl(Steel):
FLINAK = MoltenSalt("flinak")
LIPB = Alloy("lipb")
LITHIUM = PureMetal("lithium", "Li")
PDAG = Alloy("pdag")
PDAG = PalladiumAlloy("pdag")
ZIRCONIUM = PureMetal("zirconium", "Zr")
YTTRIUM = PureMetal("yttrium", "Y")
CHROMIUM = PureMetal("chromium", "Cr")

ALUMINA = Compound("alumina")
EUROFER = Steel("eurofer_97")
Expand All @@ -157,3 +165,9 @@ class FeCrAl(Steel):
THERMACORE_OXIDIZED = FeCrAl("thermacore_oxidized")
FE22CR5AL = FeCrAl("fe22cr5al")
OXIDIZED_1605 = FeCrAl("oxidized_1605")

TZM = Alloy("tzm")

PD60CU40 = PalladiumAlloy("60pd40cu")
PD52CU = PalladiumAlloy("pd52cu")
SIC = Compound("sic")
2 changes: 2 additions & 0 deletions h_transport_materials/properties_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

from h_transport_materials import ureg, ArrheniusProperty, __version__

warnings.filterwarnings("always", message="No property matching the requirements")


class PropertiesGroup(list):
@property
Expand Down
12 changes: 3 additions & 9 deletions h_transport_materials/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,8 @@ def data_y(self, value):
self._data_y = value

def set_law_from_quantity(self, quantity):
sievert_units = (
ureg.particle * ureg.meter**-1 * ureg.second**-1 * ureg.Pa**-0.5
)
henry_units = (
ureg.particle * ureg.meter**-1 * ureg.second**-1 * ureg.Pa**-1
)
sievert_units = ureg.particle * ureg.meter**-1 * ureg.second**-1 * ureg.Pa**-0.5
henry_units = ureg.particle * ureg.meter**-1 * ureg.second**-1 * ureg.Pa**-1
if quantity.check(sievert_units):
self.law = "sievert"
elif quantity.check(henry_units):
Expand All @@ -637,9 +633,7 @@ def set_law_from_quantity(self, quantity):
@property
def units(self):
if self.law == "sievert":
return (
ureg.particle * ureg.meter**-1 * ureg.second**-1 * ureg.Pa**-0.5
)
return ureg.particle * ureg.meter**-1 * ureg.second**-1 * ureg.Pa**-0.5
elif self.law == "henry":
return ureg.particle * ureg.meter**-1 * ureg.second**-1 * ureg.Pa**-1

Expand Down
1 change: 0 additions & 1 deletion h_transport_materials/property_database/FeCrAl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
from . import t54y
from . import thermacore
from . import thermacore_oxidized

6 changes: 3 additions & 3 deletions h_transport_materials/property_database/FeCrAl/apmt/apmt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h_transport_materials as htm
from h_transport_materials import (
Permeability,
)
)
import numpy as np

u = htm.ureg
Expand All @@ -12,8 +12,8 @@
)

Hu_perm = Permeability(
data_T=(1000 / data[:,0]) * u.K,
data_y=data[:,1] * u.mol * u.m**(-1) * u.s**(-1) * u.MPa**(-0.5),
data_T=(1000 / data[:, 0]) * u.K,
data_y=data[:, 1] * u.mol * u.m ** (-1) * u.s ** (-1) * u.MPa ** (-0.5),
source="hu_hydrogen_2015",
isotope="H",
note="Figure 6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import fe22cr5al

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h_transport_materials as htm
from h_transport_materials import (
Permeability,
)
)
import numpy as np

u = htm.ureg
Expand All @@ -12,8 +12,8 @@
)

xu_perm = Permeability(
data_T=(1000 / data[:,0]) * u.K,
data_y=data[:,1] * u.mol * u.m**(-1) * u.s**(-1) * u.Pa**(-.5),
data_T=(1000 / data[:, 0]) * u.K,
data_y=data[:, 1] * u.mol * u.m ** (-1) * u.s ** (-1) * u.Pa ** (-0.5),
source="xu_studies_2016",
isotope="D",
note="Figure 1, oxidised",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import oxidized_1605

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h_transport_materials as htm
from h_transport_materials import (
Permeability,
)
)
import numpy as np

u = htm.ureg
Expand All @@ -12,8 +12,8 @@
)

ash_perm = Permeability(
data_T=(1000 / data[:,0]) * u.K,
data_y=data[:,1] * u.micromol * u.m**(-1) * u.s**(-1) * u.kPa**(-.5),
data_T=(1000 / data[:, 0]) * u.K,
data_y=data[:, 1] * u.micromol * u.m ** (-1) * u.s ** (-1) * u.kPa ** (-0.5),
source="ashdown_alloy_1980",
isotope="H",
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import t35y

6 changes: 3 additions & 3 deletions h_transport_materials/property_database/FeCrAl/t35y/t35y.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h_transport_materials as htm
from h_transport_materials import (
Permeability,
)
)
import numpy as np

u = htm.ureg
Expand All @@ -12,8 +12,8 @@
)

Hu_perm = Permeability(
data_T=(1000 / data[:,0]) * u.K,
data_y=data[:,1] * u.mol * u.m**(-1) * u.s**(-1) * u.MPa**(-.5),
data_T=(1000 / data[:, 0]) * u.K,
data_y=data[:, 1] * u.mol * u.m ** (-1) * u.s ** (-1) * u.MPa ** (-0.5),
source="hu_hydrogen_2015",
isotope="H",
note="Figure 6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import t54y

6 changes: 3 additions & 3 deletions h_transport_materials/property_database/FeCrAl/t54y/t54y.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h_transport_materials as htm
from h_transport_materials import (
Permeability,
)
)
import numpy as np

u = htm.ureg
Expand All @@ -12,8 +12,8 @@
)

Hu_perm = Permeability(
data_T=(1000 / data[:,0]) * u.K,
data_y=data[:,1] * u.mol * u.m**(-1) * u.s**(-1) * u.MPa**(-.5),
data_T=(1000 / data[:, 0]) * u.K,
data_y=data[:, 1] * u.mol * u.m ** (-1) * u.s ** (-1) * u.MPa ** (-0.5),
source="hu_hydrogen_2015",
isotope="H",
note="Figure 6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import thermacore

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h_transport_materials as htm
from h_transport_materials import (
Permeability,
)
)
import numpy as np

u = htm.ureg
Expand All @@ -12,8 +12,8 @@
)

van_perm = Permeability(
data_T=(1000 / data[:,0]) * u.K,
data_y=data[:,1] * u.micromol * u.m**(-1) * u.s**(-1) * u.kPa**(-.5),
data_T=(1000 / data[:, 0]) * u.K,
data_y=data[:, 1] * u.micromol * u.m ** (-1) * u.s ** (-1) * u.kPa ** (-0.5),
source="vandeventer_hydrogen_1980",
isotope="H",
note="Figure 2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import thermacore_oxidized

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import h_transport_materials as htm
from h_transport_materials import (
Permeability,
)
)
import numpy as np

u = htm.ureg
Expand All @@ -12,8 +12,8 @@
)

van_perm = Permeability(
data_T=(1000 / data[:,0]) * u.K,
data_y=data[:,1] * u.micromol * u.m**(-1) * u.s**(-1) * u.kPa**(-.5),
data_T=(1000 / data[:, 0]) * u.K,
data_y=data[:, 1] * u.micromol * u.m ** (-1) * u.s ** (-1) * u.kPa ** (-0.5),
source="vandeventer_hydrogen_1980",
isotope="H",
note="Figure 2",
Expand Down
10 changes: 10 additions & 0 deletions h_transport_materials/property_database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,13 @@
from . import vanadium_alloy

from . import FeCrAl

from . import yttrium

from . import tzm

from . import palladium_copper

from . import sic

from . import chromium
1 change: 0 additions & 1 deletion h_transport_materials/property_database/alumina/alumina.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Solubility,
Permeability,
)
from pathlib import Path
import numpy as np

u = htm.ureg
Expand Down
2 changes: 2 additions & 0 deletions h_transport_materials/property_database/beryllium.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
dolan_recombination = RecombinationCoeff(
pre_exp=1.46e-29 * u.m**4 * u.s**-1 * u.particle**-1,
act_energy=0.214 * u.eV * u.particle**-1,
range=(333 * u.K, 800 * u.K),
source="dolan_assessment_1994",
isotope="H",
note="Comes from a review (p. 14). The data from Hsu 1990 https://doi.org/10.1016/0022-3115(90)90049-S (range taking from them) seems to have been used by the PERI code to extract D/2kr then using D from another source Dolan obtained Kr.",
)


Expand Down
Loading

0 comments on commit c46ab6a

Please sign in to comment.