Skip to content

Commit d0871b4

Browse files
authored
Merge pull request #42 from xmnlab/master
Release 0.1.0
2 parents 52d3888 + 7b481fb commit d0871b4

File tree

17 files changed

+83
-327
lines changed

17 files changed

+83
-327
lines changed

.travis.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ python:
66
- "3.5"
77
- "3.6"
88

9-
#env:
10-
# - TOXENV=py35
11-
# - TOXENV=py34
12-
139
install:
1410
- sudo apt-get update
1511
# We do this conditionally because it saves us some downloading if the
@@ -26,21 +22,11 @@ install:
2622
- conda info -a
2723

2824
# Replace dep1 dep2 ... with your dependencies
29-
- conda env create -f environment.yml
25+
- conda create -n pywim python=$TRAVIS_PYTHON_VERSION
3026
- source activate pywim
27+
- conda install --file requirements.txt
3128
- python setup.py install
3229

3330
# command to run tests, e.g. python setup.py test
3431
script: python setup.py test
3532

36-
# After you create the Github repo and add it to Travis, run the
37-
# travis_pypi_setup.py script to finish PyPI deployment setup
38-
deploy:
39-
provider: pypi
40-
distributions: sdist bdist_wheel
41-
user: xmnlab
42-
password:
43-
secure: PLEASE_REPLACE_ME
44-
on:
45-
tags: true
46-
repo: OpenWIM/pywim

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Before you submit a pull request, check that it meets these guidelines:
101101
2. If the pull request adds functionality, the docs should be updated. Put
102102
your new functionality into a function with a docstring, and add the
103103
feature to the list in README.rst.
104-
3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check
104+
3. The pull request should work for Python 3.5 and 3.6. Check
105105
https://travis-ci.org/xmnlab/pywim/pull_requests
106106
and make sure that the tests pass for all supported Python versions.
107107

README.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PyWIM
1313
:target: https://pywim.readthedocs.io/en/latest/?badge=latest
1414
:alt: Documentation Status
1515

16-
Open algorithms to use in WIM research
16+
Open algorithms to use in WIM research.
1717

1818

1919
* Free software: MIT license
@@ -29,7 +29,3 @@ PyWIM - SciPy Latin America - Argentina - 2015
2929

3030
* http://tinyurl.com/pjbn8x3
3131

32-
Features
33-
--------
34-
35-
* TODO

docs/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pywim
2+
=====
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
pywim

docs/pywim.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pywim package
2+
=============
3+
4+
Module contents
5+
---------------
6+
7+
.. automodule:: pywim
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

environment.yml

Lines changed: 0 additions & 144 deletions
This file was deleted.

notebooks/WeightEstimation.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,11 @@
370370
"under the signal curve and the speed of the vehicle traveling. A typical signal curve \n",
371371
"can be viewed as:\n",
372372
"\n",
373-
"![](img/kistler-signal.png)\n",
373+
"\\begin{figure}\n",
374+
"\\centerline{\\includegraphics[width=10cm]{img/kistler-signal.png}}\n",
375+
"\\caption{\\label{fig:kistler-signal} Raw data signal illustration. Source \\cite{kistler2004installation}}\n",
376+
"\\end{figure}\n",
374377
"\n",
375-
"<center>Source: \\cite{kistler2004installation}</center>\n",
376378
"\n",
377379
"The equation \n",
378380
"presented by Kistler \\cite{kistler2004installation} is:\n",

pywim/correction/temperature.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import numpy as np
21

32

43
class Temperature:

pywim/estimation/accuracy_calculation/cost323.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from scipy.stats import norm
2-
from scipy.optimize import root, fsolve
2+
from scipy.optimize import fsolve
33
from scipy import stats
44

55
import numpy as np
@@ -199,13 +199,13 @@ def calc_confidence_level(data: pd.DataFrame) -> pd.DataFrame:
199199
def _calc(v: pd.Series) -> pd.Series:
200200
return 100 * (
201201
1 - stats.t.sf(
202-
(v.d / v['std'] - v['mean'] / v['std']) - stats.t.isf(0.05 / 2,
203-
v.number - 1) /
202+
(v.d / v['std'] - v['mean'] / v['std']) -
203+
stats.t.isf(0.05 / 2, v.number - 1) /
204204
np.sqrt(v.number),
205205
v.number - 1
206206
) - stats.t.sf(
207-
(v.d / v['std'] + v['mean'] / v['std']) - stats.t.isf(0.05 / 2,
208-
v.number - 1) /
207+
(v.d / v['std'] + v['mean'] / v['std']) -
208+
stats.t.isf(0.05 / 2, v.number - 1) /
209209
np.sqrt(v.number), v.number - 1
210210
)
211211
)
@@ -271,13 +271,14 @@ def solver_min_tolerance(data: pd.DataFrame) -> pd.DataFrame:
271271
_factor = stats.t.isf(0.05 / 2, _number - 1) / np.sqrt(_number)
272272
_dof = _number - 1
273273

274-
func = lambda _min_tolerance: _min_confidence - 100 * (
275-
1 -
276-
stats.t.sf(
277-
(_min_tolerance / _std - _mean / _std) - _factor, _dof) -
278-
stats.t.sf(
279-
(_min_tolerance / _std + _mean / _std) - _factor, _dof)
280-
)
274+
def func(_min_tolerance):
275+
return _min_confidence - 100 * (
276+
1 -
277+
stats.t.sf(
278+
(_min_tolerance / _std - _mean / _std) - _factor, _dof) -
279+
stats.t.sf(
280+
(_min_tolerance / _std + _mean / _std) - _factor, _dof)
281+
)
281282

282283
try:
283284
data.loc[i, 'min_tolerance'] = fsolve(func, [1])[0]

pywim/utils/dsp/baseline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def calc_bl_med(x, mw, sf, sigma):
159159
e = np.ma.masked_array(x, mask)
160160

161161
# fill in the median vector
162-
half_mw = mw/2
162+
# half_mw = mw/2
163163
m = scipy.ndimage.median_filter(e, mw+1, mode="mirror")
164164
# using the median_filter might give slightly different results than
165165
# described algorithm but is MUCH faster

0 commit comments

Comments
 (0)