Skip to content

Commit

Permalink
Add notebooks and python scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
fatou1526 committed Sep 19, 2023
1 parent 2b735ad commit dd83ce1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
27 changes: 25 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,35 @@ def generate_project_tree():
os.makedirs('notebooks')
os.makedirs('reports')
os.makedirs('src')
"""
with open('Makefile', 'w') as makefile:
makefile.write('Makefile')
with open('requirements.txt', 'w') as requirements:
requirements.write('numpy\npandas\nmatplotlib\nscikit-learn\njupyter\n')
"""

# Création du fichier main_notebook.ipynb
with open('notebooks/main.ipynb', 'w') as notebook:
notebook.write('{ "cells": [], "metadata": {}, "nbformat": 4, "nbformat_minor": 2 }')

# Création du fichier utils.py
with open('src/utils.py', 'w') as utils:
utils.write('"""Contient les fonctions utilitaires pour le projet."""\n\n')
utils.write('def my_utils():\n')
utils.write(' pass\n')

# Création du fichier process.py
with open('src/process.py', 'w') as process:
process.write('"""Contient le preprocessing des données."""\n\n')
process.write('def processing():\n')
process.write(' pass\n')

# Création du fichier train.py
with open('src/utils.py', 'w') as utils:
utils.write(' """Contient entrainement du modele."""\n\n')
utils.write('def training():\n')
utils.write(' pass\n')

# Initialisation du dépôt Git
subprocess.run(['git', 'init'])
Expand All @@ -45,7 +68,7 @@ def generate_project_tree():
subprocess.run(['git', 'add', '.'])

# Commit des fichiers ajoutés
subprocess.run(['git', 'commit', '-m', 'Adding makefile and requirements to the repo'])
subprocess.run(['git', 'commit', '-m', 'Add notebooks and python scripts'])

# Push des fichiers créer
subprocess.run(['git', 'push', 'origin', 'branche-1'])
Expand Down
1 change: 1 addition & 0 deletions notebooks/main.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "cells": [], "metadata": {}, "nbformat": 4, "nbformat_minor": 2 }
4 changes: 4 additions & 0 deletions src/process.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Contient le preprocessing des données."""

def processing():
pass
4 changes: 4 additions & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Contient entrainement du modele."""

def training():
pass

0 comments on commit dd83ce1

Please sign in to comment.