CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
AllenDowney

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: AllenDowney/ModSimPy
Path: blob/master/notebooks/test_install.py
Views: 531
1
"""
2
Code from Modeling and Simulation in Python.
3
4
Copyright 2017 Allen Downey
5
6
License: https://creativecommons.org/licenses/by/4.0)
7
"""
8
9
import logging
10
logger = logging.getLogger(name='modsim.py')
11
12
#TODO: Make this Python 3.7 when conda is ready
13
14
# make sure we have Python 3.6 or better
15
import sys
16
if sys.version_info < (3, 6):
17
logger.warning('modsim.py depends on Python 3.6 features.')
18
19
import inspect
20
import matplotlib.pyplot as plt
21
import numpy as np
22
import pandas as pd
23
import scipy
24
import sympy
25
26
import seaborn as sns
27
sns.set(style='white', font_scale=1.2)
28
29
import pint
30
UNITS = pint.UnitRegistry()
31
Quantity = UNITS.Quantity
32
33
# expose some names so we can use them without dot notation
34
from copy import copy
35
from numpy import sqrt, log, exp, pi
36
from pandas import DataFrame, Series
37
from time import sleep
38
39
from scipy.interpolate import interp1d
40
from scipy.interpolate import InterpolatedUnivariateSpline
41
from scipy.integrate import odeint
42
from scipy.integrate import solve_ivp
43
from scipy.optimize import leastsq
44
from scipy.optimize import minimize_scalar
45
46
import scipy.optimize
47
48
print("All imports were successful.")
49
50