Skip to content

Commit a43bdf6

Browse files
committed
Adding version check
1 parent 63707a2 commit a43bdf6

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

code/modsim.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,29 @@
66
License: https://creativecommons.org/licenses/by/4.0)
77
"""
88

9-
#TODO: check that we have at least version 3.6
10-
11-
import inspect
12-
139
import logging
1410
logger = logging.getLogger(name='modsim.py')
1511

12+
# make sure we have Python 3.6 or better
13+
import sys
14+
if sys.version_info < (3, 6):
15+
logger.warn('modsim.py depends on Python 3.6 features.')
16+
17+
import inspect
1618
import matplotlib.pyplot as plt
1719
import numpy as np
1820
import pandas as pd
21+
import scipy
22+
import sympy
1923

2024
import seaborn as sns
2125
sns.set(style='white', font_scale=1.5)
2226

23-
import scipy
24-
import sympy
2527
import pint
2628
UNITS = pint.UnitRegistry()
2729
Quantity = UNITS.Quantity
2830

31+
# expose some names so we can use them without dot notation
2932
from copy import copy
3033
from numpy import sqrt, log, exp, pi
3134
from pandas import DataFrame, Series
@@ -37,7 +40,6 @@
3740
from scipy.optimize import minimize_scalar
3841

3942

40-
4143
def linspace(start, stop, num=50, **kwargs):
4244
"""Returns an array of evenly-spaced values in the interval [start, stop].
4345

0 commit comments

Comments
 (0)