Changeset 3068 for trunk/GSASIIpy3.py


Ignore:
Timestamp:
Sep 12, 2017 10:54:45 AM (4 years ago)
Author:
vondreele
Message:

fix parameter display to show nan (crashed before)
trap with error if any parameter is nan
skip postprocessing for failed refinements (IfOK=False)
fix Jacobian to use GetProfileDervMP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpy3.py

    r2574 r3068  
    142142            return '0.0'
    143143    # negative numbers, leave room for a sign
    144     if val < 0: maxdigits -= 1
     144    if np.isnan(val):
     145        return str(val)
     146    if val < 0: maxdigits -= 1       
    145147    if abs(val) < 1e-99 or abs(val) > 9.999e99:
    146148        decimals = min(maxdigits-6,sigfigs)
     
    156158        fmt = "{" + (":{:d}.{:d}g".format(maxdigits,decimals))+"}"
    157159    elif abs(val) < 1: # small numbers, add to decimal places
    158         decimals = sigfigs - int(np.log10(abs(val)))
     160        decimals = sigfigs - int(np.log10(np.abs(val)))
    159161        fmt = "{" + (":{:d}.{:d}f".format(maxdigits,decimals))+"}"
    160162    else: # larger numbers, remove decimal places
    161         decimals = sigfigs - 1 - int(np.log10(abs(val)))
     163        decimals = sigfigs - 1 - int(np.log10(np.abs(val)))
    162164        if decimals <= 0:
    163165            fmt = "{" + (":{:d}.0f".format(maxdigits))+"}."
Note: See TracChangeset for help on using the changeset viewer.