Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion shablona/shablona.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,26 @@
from matplotlib import mlab
from scipy.special import erf
import scipy.optimize as opt
import os.path as op

def get_data_path(absolute=True):
"""Use special attribute __file__ to return the path to the module data folder.

Parameters
----------
absolute : bool
If True, return an absolute path, as opposed to a path
relative to the current working directory.

Returns
-------
data_path : str
Path to the data folder within this module."""

if absolute:
return op.join(op.dirname(op.abspath(__file__)),'data')
else:
return op.join(op.dirname(__file__),'data')

def transform_data(data):
"""
Expand Down Expand Up @@ -195,4 +214,4 @@ def predict(self, x):
Predicted values of the dependent variable, corresponding to
values of the independent variable.
"""
return self.model.func(x, *self.params)
return self.model.func(x, *self.params)