From 60f351a528f4179225a60b2ffb697c1da1b74fb5 Mon Sep 17 00:00:00 2001 From: Fatou Date: Tue, 19 Sep 2023 19:46:54 +0000 Subject: [PATCH] Add the training script to src --- main.py | 26 ++++++++------------------ src/train.py | 4 ++++ src/utils.py | 3 --- 3 files changed, 12 insertions(+), 21 deletions(-) create mode 100644 src/train.py diff --git a/main.py b/main.py index 1b77b56..0970438 100644 --- a/main.py +++ b/main.py @@ -37,29 +37,19 @@ def generate_project_tree(): 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') + with open('src/train.py', 'w') as training: + training.write(' """Contient entrainement du modele."""\n\n') + training.write('def training():\n') + training.write(' pass\n') # Initialisation du dépôt Git subprocess.run(['git', 'init']) @@ -68,7 +58,7 @@ def generate_project_tree(): subprocess.run(['git', 'add', '.']) # Commit des fichiers ajoutés - subprocess.run(['git', 'commit', '-m', 'Add notebooks and python scripts']) + subprocess.run(['git', 'commit', '-m', 'Add the training script to src']) # Push des fichiers créer subprocess.run(['git', 'push', 'origin', 'branche-1']) diff --git a/src/train.py b/src/train.py new file mode 100644 index 0000000..b0961c3 --- /dev/null +++ b/src/train.py @@ -0,0 +1,4 @@ + """Contient entrainement du modele.""" + +def training(): + pass diff --git a/src/utils.py b/src/utils.py index b0961c3..8b13789 100644 --- a/src/utils.py +++ b/src/utils.py @@ -1,4 +1 @@ - """Contient entrainement du modele.""" -def training(): - pass