Skip to content

Commit ed3529c

Browse files
sbryngelsonclaude
andcommitted
Merge upstream/master and resolve docs gallery conflict
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 parents 35514ca + 9b1e64f commit ed3529c

3 files changed

Lines changed: 110 additions & 12 deletions

File tree

.github/workflows/homebrew-release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ jobs:
109109
110110
echo "Updating formula to v${VERSION}..."
111111
112-
# Update URL
113-
sed -i "s|url \"https://github.com/MFlowCode/MFC/archive/refs/tags/v[^\"]*\.tar\.gz\"|url \"https://github.com/MFlowCode/MFC/archive/refs/tags/v${VERSION}.tar.gz\"|" "$FORMULA"
112+
# Update URL (match any GitHub archive URL, not just MFlowCode/MFC,
113+
# in case the formula temporarily points at a fork during testing)
114+
sed -i "s|url \"https://github.com/[^\"]*/archive/[^\"]*\.tar\.gz\"|url \"https://github.com/MFlowCode/MFC/archive/refs/tags/v${VERSION}.tar.gz\"|" "$FORMULA"
114115
115116
# Update SHA256 (the one right after url, not bottle SHAs)
116117
# This uses awk to only update the first sha256 after the url line
117118
awk -v newsha="$SHA256" '
118-
/^ url "https:\/\/github.com\/MFlowCode\/MFC/ { found_url=1 }
119+
/^ url "https:\/\/github.com\// { found_url=1 }
119120
found_url && /^ sha256 "/ && !updated {
120121
sub(/sha256 "[^"]*"/, "sha256 \"" newsha "\"")
121122
updated=1
@@ -157,13 +158,16 @@ jobs:
157158
git config user.email "github-actions[bot]@users.noreply.github.com"
158159
159160
git add Formula/mfc.rb
160-
git commit -m "Update MFC to v${VERSION}"
161161
162-
echo "Pushing to homebrew-mfc..."
163-
git push origin main
164-
165-
echo "Successfully pushed formula update!"
166-
echo "The bottle.yml workflow in homebrew-mfc will now build bottles automatically."
162+
if git diff --cached --quiet; then
163+
echo "::notice::Formula already up to date for v${VERSION} — nothing to push."
164+
else
165+
git commit -m "Update MFC to v${VERSION}"
166+
echo "Pushing to homebrew-mfc..."
167+
git push origin main
168+
echo "Successfully pushed formula update!"
169+
echo "The bottle.yml workflow in homebrew-mfc will now build bottles automatically."
170+
fi
167171
168172
- name: Dry run summary
169173
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true' }}

toolchain/mfc/params/namelist_parser.py

Lines changed: 97 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,105 @@
44
This module reads the Fortran source files and extracts the parameter names
55
from each target's namelist definition. This ensures the Python toolchain
66
stays in sync with what the Fortran code actually accepts.
7+
8+
When Fortran sources are unavailable (e.g. Homebrew installs), a built-in
9+
fallback parameter set is used instead.
710
"""
811

912
import re
1013
from pathlib import Path
1114
from typing import Dict, Set
1215

1316

17+
# Fallback parameters for when Fortran source files are not available.
18+
# Generated from the namelist definitions in src/*/m_start_up.fpp.
19+
# To regenerate: python3 toolchain/mfc/params/namelist_parser.py
20+
_FALLBACK_PARAMS = {
21+
'pre_process': {
22+
'Bx0', 'Ca', 'R0ref', 'Re_inv', 'Web',
23+
'a_x', 'a_y', 'a_z', 'adv_n', 'bc_x',
24+
'bc_y', 'bc_z', 'bub_pp', 'bubbles_euler', 'bubbles_lagrange',
25+
'case_dir', 'cfl_adap_dt', 'cfl_const_dt', 'cont_damage', 'cyl_coord',
26+
'dist_type', 'down_sample', 'elliptic_smoothing', 'elliptic_smoothing_iters', 'fft_wrt',
27+
'file_per_process', 'fluid_pp', 'fluid_rho', 'hyper_cleaning', 'hyperelasticity',
28+
'hypoelasticity', 'ib', 'igr', 'igr_order', 'loops_x',
29+
'loops_y', 'loops_z', 'm', 'mhd', 'mixlayer_perturb',
30+
'mixlayer_perturb_k0', 'mixlayer_perturb_nk', 'mixlayer_vel_coef', 'mixlayer_vel_profile', 'model_eqns',
31+
'mpp_lim', 'muscl_order', 'n', 'n_start', 'n_start_old',
32+
'nb', 'num_bc_patches', 'num_fluids', 'num_ibs', 'num_patches',
33+
'old_grid', 'old_ic', 'p', 'palpha_eps', 'parallel_io',
34+
'patch_bc', 'patch_ib', 'patch_icpp', 'perturb_flow', 'perturb_flow_fluid',
35+
'perturb_flow_mag', 'perturb_sph', 'perturb_sph_fluid', 'pi_fac', 'poly_sigma',
36+
'polydisperse', 'polytropic', 'pre_stress', 'precision', 'pref',
37+
'ptgalpha_eps', 'qbmm', 'recon_type', 'relativity', 'relax',
38+
'relax_model', 'rhoRV', 'rhoref', 'sigR', 'sigV',
39+
'sigma', 'simplex_params', 'simplex_perturb', 'stretch_x', 'stretch_y',
40+
'stretch_z', 'surface_tension', 't_step_old', 't_step_start', 'thermal',
41+
'viscous', 'weno_order', 'x_a', 'x_b', 'x_domain',
42+
'y_a', 'y_b', 'y_domain', 'z_a', 'z_b',
43+
'z_domain',
44+
},
45+
'simulation': {
46+
'Bx0', 'Ca', 'R0ref', 'Re_inv', 'Web',
47+
'acoustic', 'acoustic_source', 'adap_dt', 'adap_dt_max_iters', 'adap_dt_tol',
48+
'adv_n', 'alf_factor', 'alpha_bar', 'alt_soundspeed', 'avg_state',
49+
'bc_x', 'bc_y', 'bc_z', 'bf_x', 'bf_y',
50+
'bf_z', 'bub_pp', 'bubble_model', 'bubbles_euler', 'bubbles_lagrange',
51+
'case_dir', 'cfl_adap_dt', 'cfl_const_dt', 'cfl_target', 'chem_params',
52+
'cont_damage', 'cont_damage_s', 'cyl_coord', 'down_sample', 'dt',
53+
'fd_order', 'fft_wrt', 'file_per_process', 'fluid_pp', 'g_x',
54+
'g_y', 'g_z', 'hyper_cleaning', 'hyper_cleaning_speed', 'hyper_cleaning_tau',
55+
'hyperelasticity', 'hypoelasticity', 'ib', 'ic_beta', 'ic_eps',
56+
'igr', 'igr_iter_solver', 'igr_order', 'igr_pres_lim', 'int_comp',
57+
'integral', 'integral_wrt', 'k_x', 'k_y', 'k_z',
58+
'lag_params', 'low_Mach', 'm', 'mapped_weno', 'mhd',
59+
'mixture_err', 'model_eqns', 'mp_weno', 'mpp_lim', 'muscl_lim',
60+
'muscl_order', 'n', 'n_start', 'nb', 'null_weights',
61+
'num_bc_patches', 'num_fluids', 'num_ibs', 'num_igr_iters', 'num_igr_warm_start_iters',
62+
'num_integrals', 'num_probes', 'num_source', 'nv_uvm_igr_temps_on_gpu', 'nv_uvm_out_of_core',
63+
'nv_uvm_pref_gpu', 'p', 'p_x', 'p_y', 'p_z',
64+
'palpha_eps', 'parallel_io', 'patch_ib', 'pi_fac', 'poly_sigma',
65+
'polydisperse', 'polytropic', 'precision', 'pref', 'prim_vars_wrt',
66+
'probe', 'probe_wrt', 'ptgalpha_eps', 'qbmm', 'rdma_mpi',
67+
'recon_type', 'relativity', 'relax', 'relax_model', 'rhoref',
68+
'riemann_solver', 'run_time_info', 'sigma', 'surface_tension', 't_save',
69+
't_step_old', 't_step_print', 't_step_save', 't_step_start', 't_step_stop',
70+
't_stop', 'tau_star', 'teno', 'teno_CT', 'thermal',
71+
'time_stepper', 'viscous', 'w_x', 'w_y', 'w_z',
72+
'wave_speeds', 'weno_Re_flux', 'weno_avg', 'weno_eps', 'weno_order',
73+
'wenoz', 'wenoz_q', 'x_a', 'x_b', 'x_domain',
74+
'y_a', 'y_b', 'y_domain', 'z_a', 'z_b',
75+
'z_domain',
76+
},
77+
'post_process': {
78+
'Bx0', 'Ca', 'E_wrt', 'G', 'R0ref',
79+
'Re_inv', 'Web', 'adv_n', 'alpha_rho_e_wrt', 'alpha_rho_wrt',
80+
'alpha_wrt', 'alt_soundspeed', 'avg_state', 'bc_x', 'bc_y',
81+
'bc_z', 'bub_pp', 'bubbles_euler', 'bubbles_lagrange', 'c_wrt',
82+
'case_dir', 'cf_wrt', 'cfl_adap_dt', 'cfl_const_dt', 'cfl_target',
83+
'chem_wrt_T', 'chem_wrt_Y', 'cons_vars_wrt', 'cont_damage', 'cyl_coord',
84+
'down_sample', 'fd_order', 'fft_wrt', 'file_per_process', 'fluid_pp',
85+
'flux_lim', 'flux_wrt', 'format', 'gamma_wrt', 'heat_ratio_wrt',
86+
'hyper_cleaning', 'hyperelasticity', 'hypoelasticity', 'ib', 'igr',
87+
'igr_order', 'lag_betaC_wrt', 'lag_betaT_wrt', 'lag_db_wrt', 'lag_dphidt_wrt',
88+
'lag_header', 'lag_id_wrt', 'lag_mg_wrt', 'lag_mv_wrt', 'lag_pos_prev_wrt',
89+
'lag_pos_wrt', 'lag_pres_wrt', 'lag_r0_wrt', 'lag_rad_wrt', 'lag_rmax_wrt',
90+
'lag_rmin_wrt', 'lag_rvel_wrt', 'lag_txt_wrt', 'lag_vel_wrt', 'liutex_wrt',
91+
'm', 'mhd', 'mixture_err', 'model_eqns', 'mom_wrt',
92+
'mpp_lim', 'muscl_order', 'n', 'n_start', 'nb',
93+
'num_bc_patches', 'num_fluids', 'num_ibs', 'omega_wrt', 'output_partial_domain',
94+
'p', 'parallel_io', 'pi_inf_wrt', 'poly_sigma', 'polydisperse',
95+
'polytropic', 'precision', 'pref', 'pres_inf_wrt', 'pres_wrt',
96+
'prim_vars_wrt', 'qbmm', 'qm_wrt', 'recon_type', 'relativity',
97+
'relax', 'relax_model', 'rho_wrt', 'rhoref', 'schlieren_alpha',
98+
'schlieren_wrt', 'sigR', 'sigma', 'sim_data', 'surface_tension',
99+
't_save', 't_step_save', 't_step_start', 't_step_stop', 't_stop',
100+
'thermal', 'vel_wrt', 'weno_order', 'x_output', 'y_output',
101+
'z_output',
102+
},
103+
}
104+
105+
14106
def parse_namelist_from_file(filepath: Path) -> Set[str]:
15107
"""
16108
Parse a Fortran file and extract parameter names from the namelist definition.
@@ -65,7 +157,8 @@ def parse_all_namelists(mfc_root: Path) -> Dict[str, Set[str]]:
65157
mfc_root: Path to MFC root directory
66158
67159
Returns:
68-
Dict mapping target name to set of valid parameter names
160+
Dict mapping target name to set of valid parameter names.
161+
Falls back to built-in parameter sets when sources are unavailable.
69162
"""
70163
targets = {
71164
'pre_process': mfc_root / 'src' / 'pre_process' / 'm_start_up.fpp',
@@ -76,7 +169,9 @@ def parse_all_namelists(mfc_root: Path) -> Dict[str, Set[str]]:
76169
result = {}
77170
for target_name, filepath in targets.items():
78171
if not filepath.exists():
79-
raise FileNotFoundError(f"Fortran source not found: {filepath}")
172+
# Source files not available (e.g. Homebrew install).
173+
# Use built-in fallback parameters.
174+
return dict(_FALLBACK_PARAMS)
80175
result[target_name] = parse_namelist_from_file(filepath)
81176

82177
return result

toolchain/mfc/run/case_dicts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def _is_param_valid_for_target(param_name: str, target_name: str) -> bool:
6666
6767
Uses the Fortran namelist definitions as the source of truth.
6868
Handles indexed params like "patch_icpp(1)%geometry" by checking base name.
69-
7069
Args:
7170
param_name: The parameter name (may include indices)
7271
target_name: One of 'pre_process', 'simulation', 'post_process'

0 commit comments

Comments
 (0)