Skip to content

Commit 6e2419b

Browse files
committed
add more git info; remove depricated np.NaN
1 parent 3e41e00 commit 6e2419b

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

GSASII/GSASIIpath.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,17 @@ def GetVersionNumber():
294294
else:
295295
return "unknown"
296296

297+
def getG2Branch():
298+
'''Get name of current branch, as named on local computer
299+
'''
300+
if HowIsG2Installed().startswith('git'):
301+
g2repo = openGitRepo(path2GSAS2)
302+
return g2repo.active_branch.name
303+
297304
def getG2VersionInfo():
305+
'''Get the git version information. This can be a bit slow, so reading
306+
.../GSASII/saved_version.py may be faster (in main but not master branch)
307+
'''
298308
if HowIsG2Installed().startswith('git'):
299309
g2repo = openGitRepo(path2GSAS2)
300310
commit = g2repo.head.commit
@@ -2265,7 +2275,7 @@ def condaInstall(packageList):
22652275
'\nConsider using the "conda install conda" command')
22662276
return None
22672277
try:
2268-
print(f'preparing to install {packageList}'+
2278+
print(f'Preparing to install package(s): {" ,".join(packageList)}'+
22692279
'\nThis can take a while')
22702280
# the next line works, but the subsequent cli is considered more stable
22712281
#conda.cli.main('install', '-y', *packageList)

GSASII/GSASIIseqGUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def GetSampleParms():
8686
else: # item missing from tree! stick in NaN's!
8787
sampleData = {}
8888
for item in sampleParmDict:
89-
sampleParmDict[item].append(sampleData.get(item,np.NaN))
89+
sampleParmDict[item].append(sampleData.get(item,np.nan))
9090
for item in sampleParmDict:
9191
if sampleParmDict[item]:
9292
frstValue = sampleParmDict[item][0]

GSASII/imports/G2pwd_CIF.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def Reader(self,filename, ParentFrame=None, **kwarg):
255255
for val in cf[blk].get(xcf,'?'):
256256
v,e = cif.get_number_with_esd(val)
257257
if v is None: # not parsed
258-
vl.append(np.NaN)
258+
vl.append(np.nan)
259259
else:
260260
vl.append(v)
261261
x = np.array(vl)
@@ -269,8 +269,8 @@ def Reader(self,filename, ParentFrame=None, **kwarg):
269269
for val in cf[blk].get(ycf,'?'):
270270
v,e = cif.get_number_with_esd(val)
271271
if v is None: # not parsed
272-
vl.append(np.NaN)
273-
v2.append(np.NaN)
272+
vl.append(np.nan)
273+
v2.append(np.nan)
274274
else:
275275
vl.append(v)
276276
if e is None:
@@ -315,7 +315,7 @@ def Reader(self,filename, ParentFrame=None, **kwarg):
315315
for val in cf[blk].get(sucf,'?'):
316316
v,e = cif.get_number_with_esd(val)
317317
if v is None or e is None: # not parsed or no ESD
318-
vl.append(np.NaN)
318+
vl.append(np.nan)
319319
elif e <= 0:
320320
vl.append(1.)
321321
else:
@@ -328,7 +328,7 @@ def Reader(self,filename, ParentFrame=None, **kwarg):
328328
for val in cf[blk].get(ycf,'?'):
329329
v,e = cif.get_number_with_esd(val)
330330
if v is None: # not parsed
331-
vl.append(np.NaN)
331+
vl.append(np.nan)
332332
else:
333333
vl.append(v)
334334
y /= np.array(vl)

0 commit comments

Comments
 (0)