RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
Variables
score_six_targets Namespace Reference

Variables

 encoding
 
 errors
 
 HERE = Path(__file__).resolve().parent
 
 TGT = json.load(open(HERE / 'targets_330C_15dpa.json'))
 
 OBS = TGT['observables']
 
list ORDER = ['N_loops_100', 'd_100_nm', 'N_loops_111', 'd_111_nm', 'N_voids', 'd_cavity_nm']
 
dict SHORT
 
int res = Path(sys.argv[1]) if len(sys.argv) > 1 else HERE / 'results/S8_15dpa.jsonl'
 
int labf = Path(sys.argv[2]) if len(sys.argv) > 2 else res.parent.parent / 'design/S8_labels.json'
 
int labels = json.load(open(labf)) if labf.exists() else {}
 
 rows = sorted((json.loads(l) for l in open(res)), key=lambda r: r['row_id'])
 
str hdr = '%-20s %6s' % ('row', 'dose') + ''.join('%12s' % SHORT[k] for k in ORDER) + '%7s %8s %6s' % ('in-rng', 'f_100', 'flags')
 
int lab = labels.get(str(r['row_id']), str(r['row_id']))
 
 cells
 
 n_ok
 
 v = r.get(k)
 
 o = OBS[k]
 
 ok = o['hi']
 
 rat = v / o['target'] if o['target'] else float('nan')
 
tuple s = 1e4 else ('%.2f' % v)
 
 N1
 
 N0
 
 f100 = N0 / (N0 + N1) if (N0 and N1) else float('nan')
 
list flags = []
 
list out = []
 
 t
 

Detailed Description

Score a results .jsonl against the six-observable target set.

Usage:  python score_six_targets.py results/S8_15dpa.jsonl [design/S8_labels.json]

The six are N_100, d_100, N_111, d_111, N_voids, d_cavity at EUROFER97
330 C / 15 dpa (targets_330C_15dpa.json).  f_100 is NOT scored as an
independent observable -- it is N_100/(N_100+N_111), so it is reported as a
derived check only.

A row "passes" an observable when the model value lies inside [lo, hi].  The
headline number is how many of the six are in range; ratio-to-target is shown
so a near-miss is distinguishable from a three-order-of-magnitude miss.

Rows that did not reach the target dose, or that piled at the grid ceiling,
are marked -- their size readouts are not measurements and must not be scored
as if they were.

Variable Documentation

◆ cells

score_six_targets.cells

Definition at line 43 of file score_six_targets.py.

◆ encoding

score_six_targets.encoding

Definition at line 20 of file score_six_targets.py.

◆ errors

score_six_targets.errors

Definition at line 20 of file score_six_targets.py.

◆ f100

score_six_targets.f100 = N0 / (N0 + N1) if (N0 and N1) else float('nan')

Definition at line 55 of file score_six_targets.py.

◆ flags

list score_six_targets.flags = []

Definition at line 56 of file score_six_targets.py.

◆ hdr

str score_six_targets.hdr = '%-20s %6s' % ('row', 'dose') + ''.join('%12s' % SHORT[k] for k in ORDER) + '%7s %8s %6s' % ('in-rng', 'f_100', 'flags')

Definition at line 38 of file score_six_targets.py.

◆ HERE

score_six_targets.HERE = Path(__file__).resolve().parent

Definition at line 22 of file score_six_targets.py.

◆ lab

int score_six_targets.lab = labels.get(str(r['row_id']), str(r['row_id']))

Definition at line 42 of file score_six_targets.py.

◆ labels

int score_six_targets.labels = json.load(open(labf)) if labf.exists() else {}

Definition at line 31 of file score_six_targets.py.

◆ labf

int score_six_targets.labf = Path(sys.argv[2]) if len(sys.argv) > 2 else res.parent.parent / 'design/S8_labels.json'

Definition at line 30 of file score_six_targets.py.

◆ N0

score_six_targets.N0

Definition at line 54 of file score_six_targets.py.

◆ N1

score_six_targets.N1

Definition at line 54 of file score_six_targets.py.

◆ n_ok

score_six_targets.n_ok

Definition at line 43 of file score_six_targets.py.

◆ o

score_six_targets.o = OBS[k]

Definition at line 46 of file score_six_targets.py.

◆ OBS

score_six_targets.OBS = TGT['observables']

Definition at line 24 of file score_six_targets.py.

◆ ok

score_six_targets.ok = o['hi']

Definition at line 49 of file score_six_targets.py.

◆ ORDER

list score_six_targets.ORDER = ['N_loops_100', 'd_100_nm', 'N_loops_111', 'd_111_nm', 'N_voids', 'd_cavity_nm']

Definition at line 25 of file score_six_targets.py.

◆ out

list score_six_targets.out = []

Definition at line 74 of file score_six_targets.py.

◆ rat

score_six_targets.rat = v / o['target'] if o['target'] else float('nan')

Definition at line 51 of file score_six_targets.py.

◆ res

int score_six_targets.res = Path(sys.argv[1]) if len(sys.argv) > 1 else HERE / 'results/S8_15dpa.jsonl'

Definition at line 29 of file score_six_targets.py.

◆ rows

score_six_targets.rows = sorted((json.loads(l) for l in open(res)), key=lambda r: r['row_id'])

Definition at line 32 of file score_six_targets.py.

◆ s

tuple score_six_targets.s = 1e4 else ('%.2f' % v)

Definition at line 52 of file score_six_targets.py.

◆ SHORT

dict score_six_targets.SHORT
Initial value:
1= {'N_loops_100': 'N_100', 'd_100_nm': 'd_100', 'N_loops_111': 'N_111',
2 'd_111_nm': 'd_111', 'N_voids': 'N_void', 'd_cavity_nm': 'd_void'}

Definition at line 26 of file score_six_targets.py.

◆ t

score_six_targets.t

Definition at line 76 of file score_six_targets.py.

◆ TGT

score_six_targets.TGT = json.load(open(HERE / 'targets_330C_15dpa.json'))

Definition at line 23 of file score_six_targets.py.

◆ v

score_six_targets.v = r.get(k)

Definition at line 45 of file score_six_targets.py.