Skip to content

Commit

Permalink
[Alam] update the path
Browse files Browse the repository at this point in the history
  • Loading branch information
alamhanz committed May 21, 2023
1 parent 7bcb972 commit d954841
Show file tree
Hide file tree
Showing 16 changed files with 399 additions and 104 deletions.
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"project_name": "Great_Name",
"repo_name": "GreatProject",
"project_short_description": "Just a basic template for your awesome data project",
"release_date": "2013-07-10",
"release_date": "2023-05-20",
"venv_name":"virtual-environment-name"
}
11 changes: 5 additions & 6 deletions {{cookiecutter.repo_name}}/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
path:
raw: "../../data/raw/"
interim: "../../data/interim/"
processed: "../../data/processed/"
artifact: "../../artifacts/"
udf: "../../src"
raw: "data/raw/"
interim: "data/interim/"
processed: "data/processed/"
artifact: "artifacts/"
udf: "src"
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,60 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import yaml\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import os\n",
"import sys\n",
"import numpy as np\n",
"sys.path.insert(1,'../../src/')\n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"CURR_FOLDER_PATH = os.getcwd()\n",
"BASE_PATH = os.path.dirname(os.path.dirname(CURR_FOLDER_PATH))\n",
"sys.path.insert(1,os.path.join(BASE_PATH,'src'))\n",
"\n",
"## import myfunc inside src folder\n",
"import myfunc "
"from utils import get_folder_name"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"with open(\"../../config.yaml\", \"r\") as f:\n",
"with open(os.path.join(BASE_PATH,\"config.yaml\"), \"r\") as f:\n",
" config = yaml.load(f, Loader=yaml.FullLoader)\n",
"\n",
"PATH_RAW = config['path']['raw']\n",
"PATH_INTERIM = config['path']['interim']\n",
"PATH_PROCESSED = config['path']['processed']\n",
"if os.name == 'posix' :\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('/')[-1]+'/'\n",
" rep = '/'\n",
"else:\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('\\\\')[-1]+'/'\n",
" rep = '\\\\'\n",
"\n",
"PATH_UDF = config['path']['udf']"
"PATH_RAW = os.path.join(BASE_PATH,config['raw']).replace('/',rep)\n",
"PATH_INTERIM = os.path.join(BASE_PATH,config['interim']).replace('/',rep)\n",
"PATH_PROCESSED = os.path.join(BASE_PATH,config['processed']).replace('/',rep)\n",
"PATH_MODEL = os.path.join(BASE_PATH,config['artifact'],get_folder_name()).replace('/',rep)\n",
"PATH_UDF = os.path.join(BASE_PATH,config['udf']).replace('/',rep)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -195,9 +213,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.8 ('base')",
"display_name": "pay1",
"language": "python",
"name": "python3"
"name": "pay1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -209,7 +227,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.8.10"
},
"orig_nbformat": 4,
"vscode": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@
"import matplotlib.pyplot as plt\n",
"import os\n",
"import numpy as np\n",
"import sys\n",
"sys.path.insert(1,'../../src/')\n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"CURR_FOLDER_PATH = os.getcwd()\n",
"BASE_PATH = os.path.dirname(os.path.dirname(CURR_FOLDER_PATH))\n",
"sys.path.insert(1,os.path.join(BASE_PATH,'src'))\n",
"\n",
"## import myfunc inside src folder\n",
"import myfunc "
"from utils import get_folder_name"
]
},
{
Expand All @@ -55,17 +65,19 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"../../config.yaml\", \"r\") as f:\n",
"with open(os.path.join(BASE_PATH,\"config.yaml\"), \"r\") as f:\n",
" config = yaml.load(f, Loader=yaml.FullLoader)\n",
"\n",
"PATH_RAW = config['path']['raw']\n",
"PATH_INTERIM = config['path']['interim']\n",
"PATH_PROCESSED = config['path']['processed']\n",
"if os.name == 'posix' :\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('/')[-1]+'/'\n",
" rep = '/'\n",
"else:\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('\\\\')[-1]+'/'\n",
"PATH_UDF = config['path']['udf']"
" rep = '\\\\'\n",
"\n",
"PATH_RAW = os.path.join(BASE_PATH,config['raw']).replace('/',rep)\n",
"PATH_INTERIM = os.path.join(BASE_PATH,config['interim']).replace('/',rep)\n",
"PATH_PROCESSED = os.path.join(BASE_PATH,config['processed']).replace('/',rep)\n",
"PATH_MODEL = os.path.join(BASE_PATH,config['artifact'],get_folder_name()).replace('/',rep)\n",
"PATH_UDF = os.path.join(BASE_PATH,config['udf']).replace('/',rep)"
]
},
{
Expand Down
32 changes: 22 additions & 10 deletions {{cookiecutter.repo_name}}/notebooks/iteration_1/2-model_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@
"import matplotlib.pyplot as plt\n",
"import os\n",
"import numpy as np\n",
"import sys\n",
"sys.path.insert(1,'../../src/')\n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"CURR_FOLDER_PATH = os.getcwd()\n",
"BASE_PATH = os.path.dirname(os.path.dirname(CURR_FOLDER_PATH))\n",
"sys.path.insert(1,os.path.join(BASE_PATH,'src'))\n",
"\n",
"## import myfunc inside src folder\n",
"import myfunc "
"from utils import get_folder_name"
]
},
{
Expand All @@ -52,17 +62,19 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"../../config.yaml\", \"r\") as f:\n",
"with open(os.path.join(BASE_PATH,\"config.yaml\"), \"r\") as f:\n",
" config = yaml.load(f, Loader=yaml.FullLoader)\n",
"\n",
"PATH_RAW = config['path']['raw']\n",
"PATH_INTERIM = config['path']['interim']\n",
"PATH_PROCESSED = config['path']['processed']\n",
"if os.name == 'posix' :\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('/')[-1]+'/'\n",
" rep = '/'\n",
"else:\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('\\\\')[-1]+'/'\n",
"PATH_UDF = config['path']['udf']"
" rep = '\\\\'\n",
"\n",
"PATH_RAW = os.path.join(BASE_PATH,config['raw']).replace('/',rep)\n",
"PATH_INTERIM = os.path.join(BASE_PATH,config['interim']).replace('/',rep)\n",
"PATH_PROCESSED = os.path.join(BASE_PATH,config['processed']).replace('/',rep)\n",
"PATH_MODEL = os.path.join(BASE_PATH,config['artifact'],get_folder_name()).replace('/',rep)\n",
"PATH_UDF = os.path.join(BASE_PATH,config['udf']).replace('/',rep)"
]
},
{
Expand Down
32 changes: 22 additions & 10 deletions {{cookiecutter.repo_name}}/notebooks/iteration_1/2-model_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@
"import matplotlib.pyplot as plt\n",
"import os\n",
"import numpy as np\n",
"import sys\n",
"sys.path.insert(1,'../../src/')\n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"CURR_FOLDER_PATH = os.getcwd()\n",
"BASE_PATH = os.path.dirname(os.path.dirname(CURR_FOLDER_PATH))\n",
"sys.path.insert(1,os.path.join(BASE_PATH,'src'))\n",
"\n",
"## import myfunc inside src folder\n",
"import myfunc "
"from utils import get_folder_name"
]
},
{
Expand All @@ -52,17 +62,19 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"../../config.yaml\", \"r\") as f:\n",
"with open(os.path.join(BASE_PATH,\"config.yaml\"), \"r\") as f:\n",
" config = yaml.load(f, Loader=yaml.FullLoader)\n",
"\n",
"PATH_RAW = config['path']['raw']\n",
"PATH_INTERIM = config['path']['interim']\n",
"PATH_PROCESSED = config['path']['processed']\n",
"if os.name == 'posix' :\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('/')[-1]+'/'\n",
" rep = '/'\n",
"else:\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('\\\\')[-1]+'/'\n",
"PATH_UDF = config['path']['udf']"
" rep = '\\\\'\n",
"\n",
"PATH_RAW = os.path.join(BASE_PATH,config['raw']).replace('/',rep)\n",
"PATH_INTERIM = os.path.join(BASE_PATH,config['interim']).replace('/',rep)\n",
"PATH_PROCESSED = os.path.join(BASE_PATH,config['processed']).replace('/',rep)\n",
"PATH_MODEL = os.path.join(BASE_PATH,config['artifact'],get_folder_name()).replace('/',rep)\n",
"PATH_UDF = os.path.join(BASE_PATH,config['udf']).replace('/',rep)"
]
},
{
Expand Down
32 changes: 22 additions & 10 deletions {{cookiecutter.repo_name}}/notebooks/iteration_1/2-model_3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@
"import matplotlib.pyplot as plt\n",
"import os\n",
"import numpy as np\n",
"import sys\n",
"sys.path.insert(1,'../../src/')\n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"CURR_FOLDER_PATH = os.getcwd()\n",
"BASE_PATH = os.path.dirname(os.path.dirname(CURR_FOLDER_PATH))\n",
"sys.path.insert(1,os.path.join(BASE_PATH,'src'))\n",
"\n",
"## import myfunc inside src folder\n",
"import myfunc "
"from utils import get_folder_name"
]
},
{
Expand All @@ -52,17 +62,19 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"../../config.yaml\", \"r\") as f:\n",
"with open(os.path.join(BASE_PATH,\"config.yaml\"), \"r\") as f:\n",
" config = yaml.load(f, Loader=yaml.FullLoader)\n",
"\n",
"PATH_RAW = config['path']['raw']\n",
"PATH_INTERIM = config['path']['interim']\n",
"PATH_PROCESSED = config['path']['processed']\n",
"if os.name == 'posix' :\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('/')[-1]+'/'\n",
" rep = '/'\n",
"else:\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('\\\\')[-1]+'/'\n",
"PATH_UDF = config['path']['udf']"
" rep = '\\\\'\n",
"\n",
"PATH_RAW = os.path.join(BASE_PATH,config['raw']).replace('/',rep)\n",
"PATH_INTERIM = os.path.join(BASE_PATH,config['interim']).replace('/',rep)\n",
"PATH_PROCESSED = os.path.join(BASE_PATH,config['processed']).replace('/',rep)\n",
"PATH_MODEL = os.path.join(BASE_PATH,config['artifact'],get_folder_name()).replace('/',rep)\n",
"PATH_UDF = os.path.join(BASE_PATH,config['udf']).replace('/',rep)"
]
},
{
Expand Down
40 changes: 29 additions & 11 deletions {{cookiecutter.repo_name}}/notebooks/iteration_1/3-evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,24 @@
"source": [
"import yaml\n",
"import pandas as pd\n",
"import shap\n",
"import matplotlib.pyplot as plt\n",
"import os\n",
"import numpy as np\n",
"import sys\n",
"sys.path.insert(1,'../../src/')\n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"CURR_FOLDER_PATH = os.getcwd()\n",
"BASE_PATH = os.path.dirname(os.path.dirname(CURR_FOLDER_PATH))\n",
"sys.path.insert(1,os.path.join(BASE_PATH,'src'))\n",
"\n",
"## import myfunc inside src folder\n",
"import myfunc "
"from utils import get_folder_name"
]
},
{
Expand All @@ -52,19 +61,28 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"../../config.yaml\", \"r\") as f:\n",
"with open(os.path.join(BASE_PATH,\"config.yaml\"), \"r\") as f:\n",
" config = yaml.load(f, Loader=yaml.FullLoader)\n",
"\n",
"PATH_RAW = config['path']['raw']\n",
"PATH_INTERIM = config['path']['interim']\n",
"PATH_PROCESSED = config['path']['processed']\n",
"if os.name == 'posix' :\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('/')[-1]+'/'\n",
" rep = '/'\n",
"else:\n",
" PATH_MODEL = config['path']['artifact']+os.getcwd().split('\\\\')[-1]+'/'\n",
"PATH_UDF = config['path']['udf']"
" rep = '\\\\'\n",
"\n",
"PATH_RAW = os.path.join(BASE_PATH,config['raw']).replace('/',rep)\n",
"PATH_INTERIM = os.path.join(BASE_PATH,config['interim']).replace('/',rep)\n",
"PATH_PROCESSED = os.path.join(BASE_PATH,config['processed']).replace('/',rep)\n",
"PATH_MODEL = os.path.join(BASE_PATH,config['artifact'],get_folder_name()).replace('/',rep)\n",
"PATH_UDF = os.path.join(BASE_PATH,config['udf']).replace('/',rep)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Loading

0 comments on commit d954841

Please sign in to comment.