Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions .github/workflows/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
- name: Install PROCESS
# Editable install to match default install
run: |
pip install -e '.[test, examples]'
pip install -r requirements_dev.txt
pip install -e '.[lint, test, examples]'
- name: Run unit tests
run: |
pytest --cov=process tests/unit -v \
Expand All @@ -44,8 +43,7 @@ jobs:
- name: Install PROCESS
# Editable install to match default install
run: |
pip install -e '.[test]'
pip install -r requirements_dev.txt
pip install -e '.[docs, test, lint]'
- name: Install poppler
run: |
sudo apt update
Expand All @@ -63,8 +61,7 @@ jobs:
- name: Install PROCESS
# Editable install to match default install
run: |
pip install -e '.[test, examples]'
pip install -r requirements_dev.txt
pip install -e '.[docs, test, lint, examples]'
- name: Install poppler
run: |
sudo apt update
Expand All @@ -91,8 +88,7 @@ jobs:
- name: Install PROCESS
# Editable install to match default install
run: |
pip install -e '.[test]'
pip install -r requirements_dev.txt
pip install -e '.[docs, test, lint]'
- name: Allow git commands to be run
run: git config --global --add safe.directory '*'
- name: Run regression tests
Expand All @@ -107,9 +103,7 @@ jobs:
with:
python-version: '3.10'
- name: Install PROCESS
run: pip install -e .
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install -e '.[lint, docs, test]'
- name: Run regression input files
run: python tracking/run_tracking_inputs.py run tests/regression/input_files
- name: Move other files
Expand All @@ -133,7 +127,7 @@ jobs:
with:
python-version: '3.10'
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install '.[lint]'
- name: Run pre-commit
run: pre-commit run --all-files

Expand All @@ -152,9 +146,7 @@ jobs:
with:
python-version: '3.10'
- name: Install PROCESS
run: pip install -e .
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install -e '.[test, docs, lint]'
- name: Setup SSH identity
uses: webfactory/[email protected]
with:
Expand Down Expand Up @@ -205,9 +197,7 @@ jobs:
with:
python-version: '3.10'
- name: Install PROCESS
run: pip install -e .
- name: Install dev dependencies
run: pip install -r requirements_dev.txt
run: pip install -e '.[test, lint, docs]'
- run: python scripts/vardes.py
- run: git config --global --add safe.directory '*'
- name: Download STF_TF.json files
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ env-fork
!tests/integration/data/large_tokamak_SIG_TF.json
*.html
!documentation/**/*.html
process/_version.py
2 changes: 1 addition & 1 deletion documentation/development/pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pre-commit -h
If pre-commit is not installed, then it can be installed by running:

```bash
pip install -r requirements_dev.txt
pip install '.[lint]'
```

in your environment, which will install all development dependencies including pre-commit.
Expand Down
2 changes: 1 addition & 1 deletion documentation/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ For a guide on contributing code to PROCESS, see `CONTRIBUTING.md`.
Running the entire test suite can be time consuming, as by default it runs on a single core.
`pytest-xdist` allows `pytest` tests to be distributed across multiple cores to speed up testing.

`pytest-xdist` should be installed already (included in `requirements.txt`), but if not it can be installed manually with:
`pytest-xdist` should be installed already (included in `test` extras; `pip install ".[test]"`), but if not it can be installed manually with:

```bash
pip install pytest-xdist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
12 changes: 2 additions & 10 deletions documentation/scripts/plotting_scripts/d_shaped_fw_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,8 @@
"y": [
-(kappa.value * a.value + plasma_divertor_gap.value),
-(kappa.value * a.value + plasma_divertor_gap.value),
-(
kappa.value * a.value
+ plasma_divertor_gap.value
+ divertor_height.value
),
-(
kappa.value * a.value
+ plasma_divertor_gap.value
+ divertor_height.value
),
-(kappa.value * a.value + plasma_divertor_gap.value + divertor_height.value),
-(kappa.value * a.value + plasma_divertor_gap.value + divertor_height.value),
],
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
from bokeh.plotting import figure, output_file, save

T0 = Slider(start=0.1, end=10, value=10.0, step=0.1, title="Plasma centre value | T0")
alpha = Slider(
start=0.01, end=10, value=2.0, step=0.01, title="Profile Index | alphan"
)
alpha = Slider(start=0.01, end=10, value=2.0, step=0.01, title="Profile Index | alphan")
Trho = Slider(start=0.1, end=1, value=0.9, step=0.01, title="Pedestal position | Trho")
Tped = Slider(start=0.01, end=10, value=2.0, step=0.01, title="Pedestal value | Tped")
Tsep = Slider(start=0.1, end=10, value=0.5, step=0.1, title="Separatrix value | Tsep")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@

# Convert the data to a format suitable for Plotly
fig_plotly = go.Figure(
data=[
go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")
]
data=[go.Surface(z=j_scaling, x=temp_conductor, y=b_conductor, colorscale="Viridis")]
)

# Update layout for better visualization
Expand Down
4 changes: 1 addition & 3 deletions process/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,9 +1356,7 @@ def cp_lifetime():
# Rem : only the TF maximum fluence is considered for now
if tfv.i_tf_sup == 1:
cplife = min(
(
ctv.nflutfmax / (np.asarray(fwbsv.neut_flux_cp) * YEAR_SECONDS)
).item(),
(ctv.nflutfmax / (np.asarray(fwbsv.neut_flux_cp) * YEAR_SECONDS)).item(),
cv.life_plant,
)

Expand Down
76 changes: 32 additions & 44 deletions process/blanket_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ def component_half_height(self, icomponent: int):
- build_variables.dz_vv_lower
)
else:
raise ProcessValueError(
f"{icomponent=} is invalid, it must be either 0,1,2"
)
raise ProcessValueError(f"{icomponent=} is invalid, it must be either 0,1,2")

# Calculate component internal upper half-height (m)
# If a double null machine then symmetric
Expand Down Expand Up @@ -256,9 +254,7 @@ def elliptical_component(self, icomponent: int):
r3 = r3 - build_variables.dr_shld_outboard
# ... blanket (m)
if icomponent == 0:
r3 = (
r3 - build_variables.dr_shld_outboard - build_variables.dr_blkt_outboard
)
r3 = r3 - build_variables.dr_shld_outboard - build_variables.dr_blkt_outboard

# Calculate surface area, assuming 100% coverage
if icomponent == 0:
Expand Down Expand Up @@ -1782,8 +1778,8 @@ def thermo_hydraulic_model(self, output: bool):
)
(
blanket_library.temp_fw_outboard_peak,
cf,
rhof,
_cf,
_rhof,
blanket_library.mflow_fw_outboard_coolant_channel,
) = self.fw.fw_temp(
output,
Expand Down Expand Up @@ -2013,21 +2009,19 @@ def thermo_hydraulic_model(self, output: bool):
)

# Mechanical pumping power for the blanket (MW)
heat_transport_variables.p_blkt_coolant_pump_mw = (
self.coolant_pumping_power(
output=output,
i_liquid_breeder=1,
temp_coolant_pump_outlet=fwbs_variables.temp_blkt_coolant_in,
temp_coolant_pump_inlet=fwbs_variables.temp_blkt_coolant_out,
pres_coolant_pump_inlet=fwbs_variables.pres_blkt_coolant,
dpres_coolant=deltap_blkt,
mflow_coolant_total=blanket_library.mflow_blkt_coolant_total,
primary_coolant_switch=(
"Helium" if fwbs_variables.i_blkt_coolant_type == 1 else "Water"
),
den_coolant=fwbs_variables.den_blkt_coolant,
label="Blanket",
)
heat_transport_variables.p_blkt_coolant_pump_mw = self.coolant_pumping_power(
output=output,
i_liquid_breeder=1,
temp_coolant_pump_outlet=fwbs_variables.temp_blkt_coolant_in,
temp_coolant_pump_inlet=fwbs_variables.temp_blkt_coolant_out,
pres_coolant_pump_inlet=fwbs_variables.pres_blkt_coolant,
dpres_coolant=deltap_blkt,
mflow_coolant_total=blanket_library.mflow_blkt_coolant_total,
primary_coolant_switch=(
"Helium" if fwbs_variables.i_blkt_coolant_type == 1 else "Water"
),
den_coolant=fwbs_variables.den_blkt_coolant,
label="Blanket",
)

# Total mechanical pumping power (MW)
Expand All @@ -2052,21 +2046,19 @@ def thermo_hydraulic_model(self, output: bool):
)

# Mechanical pumping power for the blanket (MW)
heat_transport_variables.p_blkt_breeder_pump_mw = (
self.coolant_pumping_power(
output=output,
i_liquid_breeder=2,
temp_coolant_pump_outlet=fwbs_variables.inlet_temp_liq,
temp_coolant_pump_inlet=fwbs_variables.outlet_temp_liq,
pres_coolant_pump_inlet=fwbs_variables.blpressure_liq,
dpres_coolant=deltap_bl_liq,
mflow_coolant_total=blanket_library.mfblkt_liq,
primary_coolant_switch=(
"Helium" if fwbs_variables.i_blkt_coolant_type == 1 else "Water"
),
den_coolant=fwbs_variables.den_liq,
label="Liquid Metal Breeder/Coolant",
)
heat_transport_variables.p_blkt_breeder_pump_mw = self.coolant_pumping_power(
output=output,
i_liquid_breeder=2,
temp_coolant_pump_outlet=fwbs_variables.inlet_temp_liq,
temp_coolant_pump_inlet=fwbs_variables.outlet_temp_liq,
pres_coolant_pump_inlet=fwbs_variables.blpressure_liq,
dpres_coolant=deltap_bl_liq,
mflow_coolant_total=blanket_library.mfblkt_liq,
primary_coolant_switch=(
"Helium" if fwbs_variables.i_blkt_coolant_type == 1 else "Water"
),
den_coolant=fwbs_variables.den_liq,
label="Liquid Metal Breeder/Coolant",
)

heat_transport_variables.htpmw_blkt_tot = (
Expand All @@ -2075,9 +2067,7 @@ def thermo_hydraulic_model(self, output: bool):
)

if output:
po.oheadr(
self.outfile, "Summary of first wall and blanket thermohydraulics"
)
po.oheadr(self.outfile, "Summary of first wall and blanket thermohydraulics")

# FW
po.osubhd(self.outfile, "First wall: ")
Expand Down Expand Up @@ -2214,9 +2204,7 @@ def thermo_hydraulic_model(self, output: bool):
fwbs_variables.i_blkt_liquid_breeder_type,
)
if fwbs_variables.i_blkt_dual_coolant == 2:
po.ocmmnt(
self.outfile, "Dual-coolant BB, i.e. self-cooled breeder."
)
po.ocmmnt(self.outfile, "Dual-coolant BB, i.e. self-cooled breeder.")
po.ovarrf(
self.outfile,
"Inlet temperature of blanket liquid breeder (K)",
Expand Down
Loading
Loading