Commit 7c50b32d authored by Nattapong Samanpong's avatar Nattapong Samanpong

bigtest2

parent 928949ae
# Always color, even if piping to a another program
--color
# Python project settings
--ignore-dir=.eggs/
--ignore-dir=.tox/
--ignore-dir=build/
--ignore-dir=cover/
[bumpversion]
current_version = 0.1.0
commit = False
tag = False
[bumpversion:file:setup.py]
search = version = "{current_version}"
replace = version = "{new_version}"
##
# .gitignore
#
# Based on:
#
# https://github.com/github/gitignore/blob/master/Global/OSX.gitignore
# https://github.com/github/gitignore/blob/master/Python.gitignore
##
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
cover
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
extends: globality-opensource-defaults
This diff is collapsed.
# inte
Short Project Description
[![Circle CI](https://circleci.com/gh/nattapong/inte/tree/develop.svg?style=svg)](https://circleci.com/gh/nattapong/inte/tree/develop)
{
"cells": [
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"73.50134999999999"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def f(x):\n",
" return (3*x**2)+(9*x)+2\n",
"def trapezoid4(a,b,n):\n",
" h=(b-a)/n\n",
" return sum([((f(a+i*h)+f(a+(i+1)*h))*h/2)for i in range(n)])"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "'builtin_function_or_method' object is not subscriptable",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-10-461ba1a91c02>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtrapezoid4\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m<ipython-input-9-9187550b668e>\u001b[0m in \u001b[0;36mtrapezoid4\u001b[0;34m(a, b, n)\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mtrapezoid4\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mh\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0msum\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mh\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: 'builtin_function_or_method' object is not subscriptable"
]
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
# CircleCI Configuration file
machine:
python:
version: 2.7.11
general:
artifacts:
- "dist"
- "cover"
dependencies:
override:
- pip install tox tox-pyenv
- pyenv local 2.7.11 3.5.1 # Should correspond to pre-installed Python versions on CircleCI
test:
override:
- tox
deployment:
pypi:
tag: /[0-9]+(\.[0-9]+)*/
owner: nattapong
commands:
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " pypi" >> ~/.pypirc
- echo >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "username:$PYPI_USERNAME" >> ~/.pypirc
- echo "password:$PYPI_PASSWORD" >> ~/.pypirc
- echo >> ~/.pypirc
- python setup.py register -r pypi
- python setup.py sdist upload -r pypi
def f(x):
return (3*x**2)+(9*x)+2
def trapezoid4(a,b,n):
h=(b-a)/n
return sum([((f(a+i*h)+f(a+(i+1)*h))*h/2)for i in range(n)])
[flake8]
max-line-length = 120
max-complexity = 15
#!/usr/bin/env python
from setuptools import find_packages, setup
project = "inte"
version = "0.1.0"
setup(
name=project,
version=version,
description="Short Project Description",
author="nick",
author_email="nattapong.sa.59@ubu.ac.th",
url="https://github.com/nattapong/inte",
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
include_package_data=True,
zip_safe=False,
install_requires=[
],
setup_requires=[
"nose>=1.3.6",
],
dependency_links=[
],
entry_points={
},
tests_require=[
"coverage>=3.7.1",
"mock>=1.0.1",
"PyHamcrest>=1.8.5",
],
)
"""
Example test.
"""
from hamcrest import (
assert_that,
equal_to,
is_,
)
def test_math():
assert_that(1 + 1, is_(equal_to(2)))
[tox]
envlist = py27, py35, lint
[testenv]
commands =
python setup.py nosetests --with-coverage --cover-package=inte --cover-erase --cover-html
python setup.py sdist
deps =
setuptools>=17.1
[testenv:lint]
commands=flake8 inte
basepython=python2.7
deps=
flake8
flake8-print
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment