Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/gradle #127

Merged
merged 12 commits into from
Jul 10, 2020
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void coverageTestSteps() {
commandLine "coverage", "run", "-m", "unittest"
}
exec {
commandLine "coverage", "report", "-m", "--fail-under=80"
commandLine "coverage", "report", "-m", "--fail-under=80", "--omit='darts/tests*,*__init__.py'"
}
}

Expand Down
13 changes: 12 additions & 1 deletion examples/FFT-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
"The following is a brief demonstration of the FFT forecasting model. This model is especially suited for data that is very seasonal. The datasets chosen for this demonstration were selected accordingly."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# fix python path if working locally\n",
"from utils import fix_pythonpath_if_working_locally\n",
"fix_pythonpath_if_working_locally()"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -489,4 +500,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
13 changes: 12 additions & 1 deletion examples/RNN-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
"If you are new to darts, we recommend you first follow the `darts-intro.ipynb` notebook."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# fix python path if working locally\n",
"from utils import fix_pythonpath_if_working_locally\n",
"fix_pythonpath_if_working_locally()"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -710,4 +721,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
13 changes: 12 additions & 1 deletion examples/TCN-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
"In this notebook, we show an example of how TCNs can be used with darts."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# fix python path if working locally\n",
"from utils import fix_pythonpath_if_working_locally\n",
"fix_pythonpath_if_working_locally()"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -372,4 +383,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
13 changes: 12 additions & 1 deletion examples/darts-intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
"As a toy example, we will use the well known [monthly airline passengers dataset](https://github.com/jbrownlee/Datasets/blob/master/monthly-airline-passengers.csv)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# fix python path if working locally\n",
"from utils import fix_pythonpath_if_working_locally\n",
"fix_pythonpath_if_working_locally()"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -961,4 +972,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
13 changes: 12 additions & 1 deletion examples/multivariate-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
"In this notebook, we show examples of how multivariate time series can be created and used in darts."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# fix python path if working locally\n",
"from utils import fix_pythonpath_if_working_locally\n",
"fix_pythonpath_if_working_locally()"
]
},
{
"cell_type": "code",
"execution_count": 40,
Expand Down Expand Up @@ -396,4 +407,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
1 change: 1 addition & 0 deletions examples/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .utils import fix_pythonpath_if_working_locally
11 changes: 11 additions & 0 deletions examples/utils/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# fix pythonpath when working locally
from os.path import dirname, basename
from os import getcwd
import sys


def fix_pythonpath_if_working_locally():
"""Add the parent path to pythonpath if current working dir is darts/examples"""
cwd = getcwd()
if basename(cwd) == 'examples':
sys.path.insert(0, dirname(cwd))