~ubuntu-branches/ubuntu/wily/yade/wily

« back to all changes in this revision

Viewing changes to py/utils.py

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2014-11-14 12:54:52 UTC
  • mfrom: (20.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20141114125452-t16anreumu4ybg2s
Tags: 1.12.0-2ubuntu1
Add allow-stderr restriction to autopkgtest, to silence a warning
printed by new matplotlib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
751
751
def _deprecatedUtilsFunction(old,new):
752
752
        "Wrapper for deprecated functions, example below."
753
753
        import warnings
754
 
        warnings.warn('Function utils.%s is deprecated, use %s instead.'%(old,new),stacklevel=2,category=DeprecationWarning)
 
754
        warnings.warn('Function utils.%s is deprecated, use %s instead.'%(old,new),stacklevel=2,category=UserWarning)
755
755
 
756
756
# example of _deprecatedUtilsFunction usage:
757
757
#
936
936
                        if ((2*b.shape.radius)  > maxD) : maxD = 2*b.shape.radius
937
937
                        if (((2*b.shape.radius) < minD) or (minD==0.0)): minD = 2*b.shape.radius
938
938
 
939
 
        if (minD==maxD): return false       #All particles are having the same size
 
939
        if (minD==maxD):
 
940
                print 'Monodisperse packing with diameter =', minD,'. Not computing psd'
 
941
                return False       #All particles are having the same size
940
942
  
941
943
        binsSizes = numpy.linspace(minD, maxD, bins+1)
942
944