Permalink
Browse files

Minor improvements

  • Loading branch information...
hombit committed Dec 12, 2017
1 parent 2383c23 commit 31280b416853185f33f21b0df8adf0a258d4d319
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from __future__ import division, print_function, unicode_literals

@@ -1,5 +1,9 @@
#!/usr/bin/env python3

"""This script finds all modules in the package that can be imported by
`from sub_package import *` and import them one by one.
"""

from __future__ import division, print_function, unicode_literals

from importlib import import_module
@@ -1,8 +1,11 @@
# Base image for Jupyter
FROM jupyter/minimal-notebook

# Install required Python packages
RUN conda install --yes astropy astroquery matplotlib numpy scipy pandas \
lmfit scikit-learn pillow scikit-image requests photutils cython numba

# Install TeX related Ubuntu packages
USER root
RUN apt-get update && \
apt-get install -y texlive-lang-cyrillic dvipng && \
@@ -11,6 +14,7 @@ RUN apt-get update && \
truncate -s 0 /var/log/*log
USER jovyan

# Copy configuration into image
COPY jupyter_notebook_config.py $HOME/.jupyter/
COPY custom.js $HOME/.jupyter/custom/
USER root
@@ -635,4 +635,5 @@ def __convert(model, os_path, contents_manager):
def __call__(self, *args, **kwargs):
self.__queue.put((args, kwargs))

# Convert .ipynb files into .html after each save.
c.FileContentsManager.post_save_hook = PostSave()
@@ -12,8 +12,8 @@

# Unfortunately today there are two incompatible branches of Python language:
# version 2.7 and versions 3.*. The very first difference that you find is a
# print statement. In Python 2 print is literally a statement and should be used
# without parentheses:
# print statement. In Python 2 print is literally a statement and should be
# used without parentheses:
# print 1
# will print '1'. Nowadays you should use Python 3 where print is a function
# (for now just believe there is a reason to be so):
@@ -78,18 +78,18 @@
print(1.5 / 0.5)
# 3.0

# Operator "//" returns integer rounded to smaller value. It returns integer
# typed value for a pair of integers and float typed value if at least one of
# the value is float:
# Operator "//" returns integer number rounded to smaller value. It returns
# integer typed value for a pair of integers and float typed value if at least
# one of the value is float:
print(1 // 2)
# 0
print(4.0 // 2)
# 2.0
print(1.5 // 0.4)
# 3.0

# Operator "%" returns fractional part, return value is determined from the same
# laws as for "//".
# Operator "%" returns fractional part, returned value type is determined from
# the same laws as for "//".
print(1 % 2)
# 1
print(1.5 % 0.4)
@@ -113,19 +113,19 @@

## Dynamic type checking ##

# Python is dynamic type checking language that means you don't need to declare
# variable before assignment. Also you can change type of variable after the
# first assignment
# Python is a dynamic type checking language that means you don't need to
# declare variable before assignment. Also you can change value and type of a
# variable after the first assignment:
a = 10
print(a)
# 10
a = 10.0
print(a)
# 10.0

## Type conversions ##
## Type conversion ##

# You can convert variable from one type to another
# You can convert value from one type to another
a = 7
b = complex(7)
print(b)
@@ -9,7 +9,7 @@

ENV=$HOME/.virtualenvs/scientific_python
mkdir -vp $ENV
virtualenv $ENV
virtualenv $ENV # for Python 3 use `python -m venv $ENV` instead
source $ENV/bin/activate

PYTHON_PATH=$(which python)

0 comments on commit 31280b4

Please sign in to comment.