Changeset 3042


Ignore:
Timestamp:
Sep 3, 2017 1:17:19 PM (4 years ago)
Author:
vondreele
Message:

add scipy license to basinhopping
MCSA plot bug fix

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r3033 r3042  
    27122712                prob = np.inner(np.inner(mtrx,b1),mtrx)
    27132713            Probs.append(prob)
     2714            print i,prob
    27142715        Probs += 4*[0.,]
    27152716        chainProb += Probs
     
    40624063           lower=-100, upper=100, dwell=50, slope=0.9,ranStart=False,
    40634064           ranRange=0.10,autoRan=False,dlg=None):
     4065''' Scipy license:
     4066    Copyright (c) 2001, 2002 Enthought, Inc.
     4067All rights reserved.
     4068
     4069Copyright (c) 2003-2016 SciPy Developers.
     4070All rights reserved.
     4071
     4072Redistribution and use in source and binary forms, with or without
     4073modification, are permitted provided that the following conditions are met:
     4074
     4075  a. Redistributions of source code must retain the above copyright notice,
     4076     this list of conditions and the following disclaimer.
     4077  b. Redistributions in binary form must reproduce the above copyright
     4078     notice, this list of conditions and the following disclaimer in the
     4079     documentation and/or other materials provided with the distribution.
     4080  c. Neither the name of Enthought nor the names of the SciPy Developers
     4081     may be used to endorse or promote products derived from this software
     4082     without specific prior written permission.
     4083'''
    40644084    """Minimize a function using simulated annealing.
    40654085
     
    45404560        return np.sqrt(M/np.sum(refList[4]**2))
    45414561   
    4542     def MCSAcallback(x, f, fmin,accept):
     4562    def MCSAcallback(x, f,accept):
     4563        fmin = min(f)
    45434564        return not pgbar.Update(min(100.,fmin*100),
    45444565            newmsg='%s%8.4f%s'%('MC/SA Residual:',fmin*100,'%'))[0]
     
    46794700    bounds = np.array(zip(lower,upper))
    46804701    if MCSA['Algorithm'] == 'Basin Hopping':
    4681         import basinhopping as bs
     4702#        import basinhopping as bs
    46824703        take_step = RandomDisplacementBounds(np.array(lower), np.array(upper))
    4683         results = bs.basinhopping(mcsaCalc,x0,take_step=take_step,disp=True,T=MCSA['Annealing'][0],
     4704        results = so.basinhopping(mcsaCalc,x0,take_step=take_step,disp=True,T=MCSA['Annealing'][0],
    46844705                interval=MCSA['Annealing'][2]/10,niter=MCSA['Annealing'][2],minimizer_kwargs={'method':'L-BFGS-B','bounds':bounds,
    46854706                'args':(refs,rcov,cosTable,ifInv,allFF,RBdata,varyList,parmDict)},callback=MCSAcallback)
  • trunk/GSASIIplot.py

    r3039 r3042  
    64456445        GL.glMultMatrixf(B4mat.T)
    64466446        GL.glDisable(GL.GL_LIGHTING)
    6447         GL.glWindowPos3f(0,0,0)
     6447#        GL.glWindowPos3f(0,0,0)
    64486448        GL.glMultMatrixf(matRot)
    64496449        GL.glRotate(180,1,0,0)             #fix to flip about x-axis
  • trunk/basinhopping.py

    r3000 r3042  
    22basinhopping: The basinhopping global optimization algorithm
    33"""
     4''' Scipy license:
     5    Copyright (c) 2001, 2002 Enthought, Inc.
     6All rights reserved.
     7
     8Copyright (c) 2003-2016 SciPy Developers.
     9All rights reserved.
     10
     11Redistribution and use in source and binary forms, with or without
     12modification, are permitted provided that the following conditions are met:
     13
     14  a. Redistributions of source code must retain the above copyright notice,
     15     this list of conditions and the following disclaimer.
     16  b. Redistributions in binary form must reproduce the above copyright
     17     notice, this list of conditions and the following disclaimer in the
     18     documentation and/or other materials provided with the distribution.
     19  c. Neither the name of Enthought nor the names of the SciPy Developers
     20     may be used to endorse or promote products derived from this software
     21     without specific prior written permission.
     22
     23
     24THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     25AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
     28BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     29OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     30SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     31INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     32CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     33ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     34THE POSSIBILITY OF SUCH DAMAGE.
     35'''
    436from __future__ import division, print_function, absolute_import
    537
Note: See TracChangeset for help on using the changeset viewer.