Background
Reviewer feedback on the JOSS paper (Arnaud Delorme) asked whether pyAMICA and the
reference Fortran binary can be driven from the same configuration file. Right now
the answer is: partially.
AMICA.from_params_file (pyAMICA/amica.py) reads a JSON file
(sample_data/sample_params.json), whose keys mostly reuse Fortran input.param
names (lrate, do_newton, rho0, block_size, max_iter, num_models, ...),
but:
- not all keys match one-to-one -- e.g.
num_mix (JSON) vs num_mix_comps
(Fortran input.param)
- pyAMICA has no reader for the literal Fortran
.param text format at all, so a
Fortran input.param file cannot currently be handed to pyAMICA directly
Proposal (revised: translator, not a second parser)
We already have a working JSON-parameter code path (from_params_file ->
constructor kwargs). Rather than teaching that path to also parse Fortran syntax,
add a small translator: parse the plain-text key value lines of a Fortran
input.param file into a dict, rename the handful of mismatched keys
(num_mix_comps -> num_mix, etc. -- full mapping TBD by diffing
sample_params.json against input.param), and hand the result to the exact same
construction path from_params_file already uses. No new parameter-handling logic,
just an input-format adapter in front of the existing one.
Document the key-mapping table alongside docs/guides/validation.md#parameter-files.
Why
So a single parameter file can drive both the Fortran binary and pyAMICA for a
parity run, instead of maintaining a hand-translated JSON copy.
Not required for the current JOSS submission; tracked here as anticipated follow-up
work per reviewer feedback.
Background
Reviewer feedback on the JOSS paper (Arnaud Delorme) asked whether pyAMICA and the
reference Fortran binary can be driven from the same configuration file. Right now
the answer is: partially.
AMICA.from_params_file(pyAMICA/amica.py) reads a JSON file(
sample_data/sample_params.json), whose keys mostly reuse Fortraninput.paramnames (
lrate,do_newton,rho0,block_size,max_iter,num_models, ...),but:
num_mix(JSON) vsnum_mix_comps(Fortran
input.param).paramtext format at all, so aFortran
input.paramfile cannot currently be handed to pyAMICA directlyProposal (revised: translator, not a second parser)
We already have a working JSON-parameter code path (
from_params_file->constructor kwargs). Rather than teaching that path to also parse Fortran syntax,
add a small translator: parse the plain-text
key valuelines of a Fortraninput.paramfile into a dict, rename the handful of mismatched keys(
num_mix_comps->num_mix, etc. -- full mapping TBD by diffingsample_params.jsonagainstinput.param), and hand the result to the exact sameconstruction path
from_params_filealready uses. No new parameter-handling logic,just an input-format adapter in front of the existing one.
Document the key-mapping table alongside
docs/guides/validation.md#parameter-files.Why
So a single parameter file can drive both the Fortran binary and pyAMICA for a
parity run, instead of maintaining a hand-translated JSON copy.
Not required for the current JOSS submission; tracked here as anticipated follow-up
work per reviewer feedback.