Skip to content

Commit a123ce4

Browse files
committed
Merge remote-tracking branch 'remotes/origin/main'
2 parents e775d3d + 16cd203 commit a123ce4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

GSASII/GSASIIscriptable.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,13 +3213,17 @@ def get_Covariance(self,varList):
32133213
covArray = np.divide(np.divide(covMatrix,xvar),xvar.T)
32143214
32153215
'''
3216+
for i in ('covMatrix','varyList','variables'):
3217+
if i not in self['Covariance']['data']:
3218+
raise G2ScriptException(f'No {i} found in project, has a refinement been run?')
32163219
missing = [i for i in varList if i not in self['Covariance']['data']['varyList']]
32173220
if missing:
32183221
G2fil.G2Print('Warning: Variable(s) {} were not found in the varyList'.format(missing))
32193222
return None
3220-
if 'parmDict' not in self['Covariance']['data']:
3221-
raise G2ScriptException('No parameters found in project, has a refinement been run?')
3222-
vals = [self['Covariance']['data']['parmDict'][i] for i in varList]
3223+
parmDict = dict(zip(
3224+
self['Covariance']['data']['varyList'],
3225+
self['Covariance']['data']['variables']))
3226+
vals = [parmDict[i] for i in varList]
32233227
cov = G2mth.getVCov(varList,
32243228
self['Covariance']['data']['varyList'],
32253229
self['Covariance']['data']['covMatrix'])

0 commit comments

Comments
 (0)