Skip to content

Commit

Permalink
Use LooseVersion to work with e.g. 1.6.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarbenjamin committed Mar 31, 2020
1 parent 7338b07 commit 3be8445
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions benchmarks/polygon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function, division
from distutils.version import LooseVersion, StrictVersion
from distutils.version import LooseVersion
from sympy import Rational
import sympy
from sympy.geometry import (Line, Point,
Expand Down Expand Up @@ -55,39 +55,39 @@ def time_bench01(self):

class PolygonSecondMoment:
def setup(self):
if StrictVersion(sympy.__version__) < StrictVersion("1.3.0"):
if LooseVersion(sympy.__version__) < LooseVersion("1.3.0"):
raise NotImplementedError
def time_bench01(self):
"Polygon.second_moment_of_area() for w in range(10)"
[listOfPolygons[w].second_moment_of_area() for w in range(10)]

class PolygonFirstMoment:
def setup(self):
if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"):
if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"):
raise NotImplementedError
def time_bench01(self):
"Polygon.first_moment_of_area for w in range(10)"
[listOfPolygons[w].first_moment_of_area() for w in range(10)]

class PolygonPolarSecondMoment:
def setup(self):
if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"):
if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"):
raise NotImplementedError
def time_bench01(self):
"Polygon.polar_second_moment_of_area for w in range(10)"
[listOfPolygons[w].polar_second_moment_of_area() for w in range(10)]

class PolygonSectionModulus:
def setup(self):
if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"):
if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"):
raise NotImplementedError
def time_bench01(self):
"Polygon.section_modulus for w in range(10)"
[listOfPolygons[w].section_modulus() for w in range(10)]

class PolygonCutSection:
def setup(self):
if StrictVersion(sympy.__version__) < StrictVersion("1.5.0"):
if LooseVersion(sympy.__version__) < LooseVersion("1.5.0"):
raise NotImplementedError
def time_bench01(self):
"Polygon.cut_section for w in range(10)"
Expand Down

0 comments on commit 3be8445

Please sign in to comment.