Skip to content

Claude/optimpv fork review ml y5ax7o - #4

Open
Juavamp wants to merge 2 commits into
openPV-lab:mainfrom
Juavamp:claude/optimpv-fork-review-ml-y5ax7o
Open

Claude/optimpv fork review ml y5ax7o#4
Juavamp wants to merge 2 commits into
openPV-lab:mainfrom
Juavamp:claude/optimpv-fork-review-ml-y5ax7o

Conversation

@Juavamp

@Juavamp Juavamp commented Aug 6, 2026

Copy link
Copy Markdown

No description provided.

claude added 2 commits August 6, 2026 07:01
…e ML pipeline

Adds three device-stack layer parameter sets for SnO2/AZO-style sputtered
TCO/ETL/HTL layers (n-i-p glass/ITO or FTO/SnO2/perovskite/Spiro-OMeTAD/Au,
and p-i-n glass/FTO/SAM/perovskite/C60/BCP/Ag), ready for DDfits (SIMsalabim)
fitting against combinatorial-sputtering J-V data.

Also adds a 3-stage pipeline built on top of the existing DDfits/axBOtorch
machinery:
- Stage 1 (scripts/fit_combinatorial_devices.py): per-device drift-diffusion
  fitting of the sputtered layer's physical parameters against measured J-V.
- Stage 2 (optimpv/ml/process_correlation.py): a classical ML regressor
  (Random Forest/GBR/GP) correlating process conditions with the fitted
  physical parameters and device performance, with feature importance and
  partial dependence for interpretability.
- Stage 3 (optimpv/ml/surrogate_agent.py, scripts/optimize_process_conditions.py):
  wraps the Stage 2 model as an optimpv Agent so axBOtorchOptimizer can search
  process-condition/thickness space for the conditions predicted to maximize
  device performance.

optimpv/general/combinatorial_data.py provides the raw-J-V-curve-files +
conditions-log loading/merging used by Stage 1, including a sign-convention-
agnostic Voc/Jsc/FF/PCE extractor. combinatorial_data.py and the Stage 2/3 ML
modules were tested against synthetic data; Stage 1 and the BO portion of
Stage 3 could not be run end-to-end (no SIMsalabim binary or Ax/BoTorch/PyTorch
in this environment) -- see docs/combinatorial_TCO_ML_workflow.md for details
and known limitations.
Adds gui/app.py, a browser-based GUI covering Stage 2 (process correlation)
and Stage 3 (condition search) of the combinatorial pipeline, launched via
run_gui.sh/run_gui.bat. Deliberately does not integrate SIMsalabim/DDfits
(Stage 1 stays a separate script, scripts/fit_combinatorial_devices.py) --
the GUI only needs scikit-learn plus ax-platform/torch for the search, and
takes any table of process conditions + performance (optionally including
Stage 1 fitted physical parameters) as input.

Refactored scripts/optimize_process_conditions.py to expose a reusable
run_search() function so the GUI and CLI share the same code path instead
of duplicating logic.

Verified: gui/app.py boots cleanly under `streamlit run` and passes
streamlit.testing.v1.AppTest with no exceptions in this environment
(scikit-learn installed; ax-platform/torch not installed here, so the
Stage 3 search itself could not be exercised end-to-end -- the GUI detects
and reports missing dependencies rather than crashing).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants